Comments (9)
Thanks @alon this is interesting. I'll have a look at it
from rio-cogeo.
from rio-cogeo.
Is it possible to serve a COG without a tiling service
Absolutely, I'm usually using https://github.com/cogeotiff/rio-tiler (and https://github.com/vincentsarago/lambda-tiler) to do this but you could also check https://github.com/DHI-GRAS/terracotta or https://github.com/mojodna/marblecutter which provide the full architecture.
That's said, if you have int16 dataset you'll need custom script to rescale your data to int8.
from rio-cogeo.
@alon This is a rasterio
problem and I'm not sure if there is a way around it.
Basically rasterio.shutil.copy https://github.com/mapbox/rasterio/blob/master/rasterio/shutil.pyx#L56 is swallowing GDAL warnings but I don't think there is a way to fix that.
cc @sgillies
from rio-cogeo.
@vincentsarago the errors occur during the execution of GDALCreateCopy
at https://github.com/mapbox/rasterio/blob/master/rasterio/shutil.pyx#L137, right? Because we've released Python's global interpreter lock, the errors cannot be turned into exceptions. It might be possible to create a GDAL error handler that would break out of GDALCreateCopy and the nogil block using setjmp and longjmp, but I've never done that in Cython before and I'm hesitant to do so 😰 Validating the data type before copying is probably the best solution.
from rio-cogeo.
@sgillies thanks for the investigation.
That's said, I think GDAL doesn't throw error but just warnings (ERROR 1: JPEGSetupEncode:BitsPerSample 16 not allowed for JPEG
)
Validating the data type before copying is probably the best solution
Yeah I think this is what we should do 🙏
from rio-cogeo.
🤔 @sgillies I've just encountered this with other options
# This command runs find but the result is empty (data is not copied)
$ rio cogeo create float64.tif float64cog.tif --co BLOCKXSIZE=256 --co BLOCKXSIZE=256 --cog-profile deflate --co ZLEVEL=6 --co PREDICTOR=2
while with gdal
gdal_translate float64.tif float64cog.tif -co BLOCKXSIZE=256 -co BLOCKYSIZE=256 -co COMPRESS=DEFLATE -co ZLEVEL=6 -co PREDICTOR=2
Input file size is 301, 520
0...10...20...30...40...50...60...70...80...90...100 - done.
ERROR 1: PredictorSetup:Horizontal differencing "Predictor" not supported with 64-bit samples
ERROR 1: PredictorSetup:Horizontal differencing "Predictor" not supported with 64-bit samples
ERROR 1: WriteEncodedTile/Strip() failed.
ERROR 1: PredictorSetup:Horizontal differencing "Predictor" not supported with 64-bit samples
ERROR 1: WriteEncodedTile/Strip() failed.
ERROR 1: PredictorSetup:Horizontal differencing "Predictor" not supported with 64-bit samples
I feel there are a lot of corner case I'll need to check ...
from rio-cogeo.
Is it possible to serve a COG without a tiling service
Absolutely, I'm usually using https://github.com/cogeotiff/rio-tiler (and https://github.com/vincentsarago/lambda-tiler) to do this but you could also check https://github.com/DHI-GRAS/terracotta or https://github.com/mojodna/marblecutter which provide the full architecture.
Right, I understand it is doable with a service which creates the tiles on demand, and then serves them:
COG -> TILER -> FRONTEND
And showing the artifacts:
COG: single file on disk
TILER: in memory / cached on disk tiles (png per X/Y/Z)
But I'd like to forgoe the tiler, and have
COG -> FRONTEND
where the arrow signifies HTTP traffic.
My current flow is:
Preprocessing: TIFF (not COG) -> tiles -> cloud (azure)
CLOUD -> FRONTEND (via leaflet)
The tiling stage is very slow, I'm using gdal2tiles with zoom levels 18, which is brutal for a 50k x 20k image, even though most of it is NODATA.
@vincentsarago I would happily discuss this offline, or publically but on a more appropriate place than this ticket :) I'm alon at pobox dotcom
from rio-cogeo.
COG -> FRONTEND
checkout https://github.com/geotiffjs/geotiff.js
I would happily discuss this offline, or publically but on a more appropriate place than this ticket :) I'm alon at pobox dotcom
We have a #cogeotiff Chanel on thespatialcommunity
slack -> https://thespatialcommunity.org
from rio-cogeo.
Related Issues (20)
- remove call to rasterio._path module
- Creating COG out of big rasters HOT 8
- mercantile.bounds for cog HOT 2
- Installation error on ubuntu 20.04 docker image HOT 2
- Installing rio_cogeo 3.1.0 on virtualenv for a Python package HOT 1
- Displaying continuous data with multiple transparency values?
- add `ZOOM_LEVEL` creation option for web optimized COG
- installation give error
- 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
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.