Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rio cogeo create fails when converting sentinel-2 preview files

See original GitHub issue

In all sentinel-2 directories, there is a PVI (preview) file in jp2 format that throws a blocksize exceeds raster width error when you try to convert using rio cogeo create [file].

gdalinfo confirms that the blocksize is 192x192 while the band dimension is just 171x171. So the issue seems to be more of a corner case of really small (tiled) jp2s rather than a bug with rio cogeo.

If in SAFE format, the approximate location of this file is: $(PRODUCT_NAME).SAFE/GRANULE/$(IMAGE_GRANULE)/QI_DATA/TILE_ID..._PVI.jp2

Here’s a command to pull a random preview file out of the sentinel s3: aws s3 cp s3://sentinel-s2-l1c/tiles/7/J/FL/2019/2/12/0/preview.jp2 . --request-payer requester

As you can see, rio cogeo create preview.jp2 preview.tif fails.

It looks like this generic error comes when instantiating the DatasetWriterBase class. Is there a way to keep current protections but allow for cog creation on even really small preview files?

Thanks in advance for any suggestions or advice 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

vincentsaragocommented, Jul 3, 2019

@alando46 sure thing

I’ll try to fix this, this week

vincentsaragocommented, Jul 14, 2019

@DanSchoppe @alando46 @mojodna could you please review the changes in #82 please

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To - rio-cogeo
From a command line point of view, it just means you need to add --co TILED=TRUE in a gdal_translate command. 1. Get some...
Read more >
rio-tiler - PyPI
Rasterio pluggin to serve tiles from AWS S3 hosted files. ... Get mercator tile from Landsat, sentinel or other AWS hosted rasters. Rio-tiler...
Read more >
common module - geemap
Convert coordinates of a bounding box to a geojson. Parameters: Name, Type, Description, Default. bounds, list. A list ...
Read more >
COGs in production. Leveraging Cloud Optimised GeoTIFFs…
They are as performant as map tiles making them a lower cost alternative. ... A Cloud Optimized GeoTIFF (COG) is a regular GeoTIFF...
Read more >
Unanswered 'rasterio' Questions - Page 3 - Stack Overflow
Correctly convert leaflet bounding coordinates to rasterio bounding ... Im using Rasterio to create a Geojson from a tif file but I noticed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found