-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raster_exporter: COG support added #108
Conversation
The bug in COG creation is caused by color table export. The COG driver sets a TIFF color table even if this is not supported by the TIFF specs. With TIFF, color tables can only be set for datatypes Byte and UInt16. Therefore we need to explicitly set the "-c" flag with r.out.gdal when exporting to COG. |
@@ -128,7 +128,7 @@ def __init__(self): | |||
|
|||
@swagger.doc({ | |||
'tags': ['Raster Management'], | |||
'description': 'Export an existing raster map layer as GeoTiff using the raster map layer specific region. ' | |||
'description': 'Export an existing raster map layer as GeoTiff or COG (if COG driver available) using the raster map layer specific region. ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the upper text is better. This sounds more like having a choice
args.extend(["createopt=COMPRESS=LZW,TILED=YES", "overviews=5"]) | ||
|
||
# current workaround due to color table export | ||
# TODO: DELETE AND TEST ONCE GDAL 3.2 HAS BEEN RELEASED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# TODO: DELETE AND TEST ONCE GDAL 3.2 HAS BEEN RELEASED | |
# TODO: DELETE AND TEST ONCE GDAL 3.1.4 HAS BEEN RELEASED |
Co-authored-by: Markus Neteler <neteler@gmail.com>
Co-authored-by: Markus Metz <33666869+metzm@users.noreply.github.com>
Co-authored-by: Markus Metz <33666869+metzm@users.noreply.github.com>
I have the impression that COG requires BIGTIFF activation (the implemented auto-detection failed for me several times). And also compression to be activated, as there is none set as the default: https://gdal.org/drivers/raster/cog.html#general-creation-options ). Any COG > 4GB was corrupted for me (GDAL 3.1.2 on Alpine). Hence, e.g.:
But with that I get:
Does @metzm have an idea? |
Raster exporter does not yet support COG, for which GDAL >= 3.1 is required. Current workaround because of GDAL bug in overview creation.
Status: should work for now, but more elegant solution to come after GDAL bugfix