Skip to content
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

Unable to load COG from Stanford Digital Repository #261

Open
mapninja opened this issue Jul 22, 2021 · 4 comments
Open

Unable to load COG from Stanford Digital Repository #261

mapninja opened this issue Jul 22, 2021 · 4 comments

Comments

@mapninja
Copy link

I've been experimenting with COGs from our Stanford Digital Repository, developing support materials for scholars who would like to begin depositing spatial imagery using the spec. I've a number of images I'm experimenting with, which can be found at these PURLs:

https://purl.stanford.edu/vq494qx9344

https://purl.stanford.edu/vg200wn5932

I've checked this one with the COG Validator, and it conforms, loads into QGIS, using HTTPS, without issue, and with pretty decent performance: https://stacks.stanford.edu/file/druid:vq494qx9344/odm_orthophoto_COG_c.tif

Note: I use URL Encoding so that the address becomes: https://stacks.stanford.edu/file/druid%3Avq494qx9344/odm_orthophoto_COG_c.tif

Here's the gdalinnfo for this file:

Driver: GTiff/GeoTIFF Files: odm_orthophoto_COG_c.tif Size is 6656, 5376 Coordinate System is: PROJCRS["WGS 84 / Pseudo-Mercator", BASEGEOGCRS["WGS 84", ENSEMBLE["World Geodetic System 1984 ensemble", MEMBER["World Geodetic System 1984 (Transit)"], MEMBER["World Geodetic System 1984 (G730)"], MEMBER["World Geodetic System 1984 (G873)"], MEMBER["World Geodetic System 1984 (G1150)"], MEMBER["World Geodetic System 1984 (G1674)"], MEMBER["World Geodetic System 1984 (G1762)"], ELLIPSOID["WGS 84",6378137,298.257223563, LENGTHUNIT["metre",1]], ENSEMBLEACCURACY[2.0]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433]], ID["EPSG",4326]], CONVERSION["Popular Visualisation Pseudo-Mercator", METHOD["Popular Visualisation Pseudo Mercator", ID["EPSG",1024]], PARAMETER["Latitude of natural origin",0, ANGLEUNIT["degree",0.0174532925199433], ID["EPSG",8801]], PARAMETER["Longitude of natural origin",0, ANGLEUNIT["degree",0.0174532925199433], ID["EPSG",8802]], PARAMETER["False easting",0, LENGTHUNIT["metre",1], ID["EPSG",8806]], PARAMETER["False northing",0, LENGTHUNIT["metre",1], ID["EPSG",8807]]], CS[Cartesian,2], AXIS["easting (X)",east, ORDER[1], LENGTHUNIT["metre",1]], AXIS["northing (Y)",north, ORDER[2], LENGTHUNIT["metre",1]], USAGE[ SCOPE["Web mapping and visualisation."], AREA["World between 85.06°S and 85.06°N."], BBOX[-85.06,-180,85.06,180]], ID["EPSG",3857]] Data axis to CRS axis mapping: 1,2 Origin = (-13601606.107462760061026,4498949.720065975561738) Pixel Size = (0.074645535434963,-0.074645535434857) Metadata: AREA_OR_POINT=Area OVR_RESAMPLING_ALG=NEAREST Image Structure Metadata: INTERLEAVE=PIXEL LAYOUT=COG Tiling Scheme: NAME=GoogleMapsCompatible ZOOM_LEVEL=21 Corner Coordinates: Upper Left (-13601606.107, 4498949.720) (122d11' 7.10"W, 37d25'41.21"N) Lower Left (-13601606.107, 4498548.426) (122d11' 7.10"W, 37d25'30.91"N) Upper Right (-13601109.267, 4498949.720) (122d10'51.04"W, 37d25'41.21"N) Lower Right (-13601109.267, 4498548.426) (122d10'51.04"W, 37d25'30.91"N) Center (-13601357.687, 4498749.073) (122d10'59.07"W, 37d25'36.06"N) Band 1 Block=256x256 Type=Byte, ColorInterp=Red Overviews: 3328x2688, 1664x1344, 832x672, 416x336, 208x168 Mask Flags: PER_DATASET ALPHA Overviews of mask band: 3328x2688, 1664x1344, 832x672, 416x336, 208x168 Band 2 Block=256x256 Type=Byte, ColorInterp=Green Overviews: 3328x2688, 1664x1344, 832x672, 416x336, 208x168 Mask Flags: PER_DATASET ALPHA Overviews of mask band: 3328x2688, 1664x1344, 832x672, 416x336, 208x168 Band 3 Block=256x256 Type=Byte, ColorInterp=Blue Overviews: 3328x2688, 1664x1344, 832x672, 416x336, 208x168 Mask Flags: PER_DATASET ALPHA Overviews of mask band: 3328x2688, 1664x1344, 832x672, 416x336, 208x168 Band 4 Block=256x256 Type=Byte, ColorInterp=Alpha Overviews: 3328x2688, 1664x1344, 832x672, 416x336, 208x168

To Reproduce

  1. Load default app.geotiff.io and paste URL encoded version into "URL to your GeoTIFF" text box
  2. Click Go
  3. Loading Raster message persists
  4. Watching the network activity in Dev Tools, it looks as if the app is waiting until the tiff is fully loaded, which eventually seems to happen
  5. Once the tiff has fully downloaded, it remains unrendered.
  6. Zoom works, and does not seem to force rendering
  7. Panning seems to be disabled for some reason, once the tif has loaded.

Expected behavior
COG is rendered, using overviews, before full download (should full DL occur, even?)

  • OS: Mac Big Sur
  • Browser: Brave
  • Version: Version 1.26.77 Chromium: 91.0.4472.164 (Official Build) (x86_64)

Additional context

  • Checked with our Access Services Team, to make sure HTTP Range Queries are enabled, and they are.
  • All of the COGs under the above PURLs perform as expected, when loaded using HTTPS in QGIS-ltr
@mapninja
Copy link
Author

Follow up:

With this new COG, projected to EPSG:4326:

https://stacks.stanford.edu/file/druid:vq494qx9344/odm_orthophoto_COG_d.tif

THe image eventually loads, and is rendered at a downsampled resolution, both through URL, and from local file.

@DanielJDufour
Copy link
Member

Hi, @mapninja . Thank you for posting this issue. Looks like a great use case for COGs! Unfortunately, geotiff.io doesn't support COGs yet. I'm working on a major upgrade to georaster (providing a unified function for COG and non-COG GeoTIFFs). After that, it'll be easier to add COG support to geotiff.io and its analytical engine, geoblaze. Hopefully that will be done in a couple months. However, if you just need visualization (without the analysis), the underlying Leaflet plugin georaster-layer-for-leaflet does support COGs. Let me know if you have any more questions.

@DanielJDufour
Copy link
Member

I should also mention that regarding downsampled resolution issue, you should be able to adjust the resolution via the resolution url parameter. You can read more about it here: https://github.com/GeoTIFF/geotiff.io/blob/e8af1321501966631aa7e320ee60e8955d682769/ADVANCED_FEATURES.md#adjusting-resolution

@mujyuki
Copy link
Contributor

mujyuki commented Jan 8, 2023

Hi, all.
I think this issue can be solved by using geoblaze.parse. In my repository it seems to work fine.
Is there any update on this? if no one is working on it yet, I can send a Pull Request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants