Comments (8)
Apparently add_mask=True
is a culprit. With add_mask=False
it takes same amount of time as for gdal_translate
.
from rio-cogeo.
I don't know the root cause of the issue but I've found a workaround.
In my case blockxsize
/ blockysize
values of the source raster are 512px
. When I set blockxsize=512
and blockxsize=512
for the output raster then everything works fine (1024px
is also ok). But if change it to 256px
then performance becomes very poor. Closing for now.
from rio-cogeo.
- what happens if you create the COG using
gdal_translate
? - can you check the memory consumption?
- are you using
--allow-intermediate-compression
from rio-cogeo.
- memory consumption is quite low (2G out of 15G) but CPU is under 100% load
--allow-intermediate-compression
is not being used
I'm going to check how it behaves with gdal_translate
.
from rio-cogeo.
@drnextgis try with --allow-intermediate-compression
. The problem is that you are creating a really big temporary file. using intermediate compression might do the trick (by default it will use deflate but this is configurable when using the API)
from rio-cogeo.
gdal-translate: 30 minutes
$ gdal_translate \
-of COG -co COMPRESS=DEFLATE \
-co BLOCKSIZE=256 \
-co BIGTIFF=IF_SAFER \
-co TILING_SCHEME=GoogleMapsCompatible \
-co RESAMPLING=CUBIC \
--config GDAL_TIFF_OVR_BLOCKSIZE 256 \
--config GDAL_TIFF_INTERNAL_MASK TRUE \
--config GDAL_NUM_THREADS ALL_CPUS \
20211207_023956_SN8_L3_SR_MS.tif cog.tif
rio-cogeo (even with allow_intermediate_compression
enabled) : 8 hours
from rio_cogeo.cogeo import cog_translate
from rio_cogeo.profiles import cog_profiles
dst_profile = cog_profiles.get("deflate")
dst_profile.update({"blockxsize": 256, "blockysize": 256, "BIGTIFF": "IF_SAFER"})
gdal_config = dict(
GDAL_NUM_THREADS="ALL_CPUS",
GDAL_TIFF_INTERNAL_MASK=True,
GDAL_TIFF_OVR_BLOCKSIZE="256",
)
cog_translate(
"20211207_023956_SN8_L3_SR_MS.tif",
"cogeo.tif",
dst_profile,
add_mask=True,
resampling="cubic",
config=gdal_config,
web_optimized=True,
allow_intermediate_compression=True,
)
from rio-cogeo.
thanks for the comparison @drnextgis
rio-cogeo (even with allow_intermediate_compression enabled) : 8 hours
can you tell which step took most of the time?
from rio-cogeo.
Writing mask slows down the whole process.
from rio-cogeo.
Related Issues (20)
- Creating a COG in place rather than generating a new file? HOT 1
- add option to forward namespaced metadata
- add python 3.10 support
- All Console output is standard error HOT 6
- COG convesion succeeds with GDAL but not with rio-cogeo HOT 4
- Change folder of "execution" HOT 11
- NetCDF to CoG workflow
- GeoTIFF with invalidated optimizations shows up as valid HOT 1
- installation issues - coggeo command HOT 3
- limit pydantic to `1.0` HOT 3
- Shift/zoom after updating to >=4 HOT 2
- Pydantic 2.0 incompatible with morecantile HOT 1
- Unexpected GET Requests Count with web-optimized COG
- Clarify arguments used only when producing "web-optimized" COGs HOT 4
- set blocksize from the TileMatrixSet
- COG validation fails for files that are SPARSE and have sparse edge tiles in the overviews. HOT 4
- Colormap extended to 255 HOT 2
- cog drive in cog_translate function enforce creation of overviews
- Convert toCOG an in MemoryFile raster.
- do not wrap the input dataset in a WarpedVRT when it's not needed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rio-cogeo.