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

Support a normalize option on the GeoTIFF source #12836

Merged
merged 1 commit into from
Sep 29, 2021
Merged

Support a normalize option on the GeoTIFF source #12836

merged 1 commit into from
Sep 29, 2021

Conversation

tschaub
Copy link
Member

@tschaub tschaub commented Sep 29, 2021

By default, we normalize values in GeoTIFF sources so that style expressions on the layer work with values between 0 and 1. This change makes it so the GeoTIFF source accepts a normalize option to control this behavior. If normalize is set to false, then the raw GeoTIFF values will be make available to style expressions on the layer.

The current implementation uses 8-bit values for normalized data and 32-bit otherwise. In the future, we may change this to support higher bit depth for normalized values as well. But this implementation detail is not exposed to users.

I haven't had any luck finding a CORS-friendly source of elevation data hosted as GeoTIFF. Both the AWS Terrain Tiles and Copernicus DEM data are not CORS-friendly. But here is a movie of a elevation tile from the Terrain Tiles with a CORS proxy in front:

elevation

Fixes #12834.

@tschaub tschaub merged commit 709139c into openlayers:main Sep 29, 2021
@tschaub tschaub deleted the denormalized branch September 29, 2021 21:57
@mike-000
Copy link
Contributor

mike-000 commented Apr 5, 2022

AWS Terrain Tiles are CORS friendly as long as you use https://elevation-tiles-prod.s3.amazonaws.com/ (https://s3.amazonaws.com/elevation-tiles-prod/ is not CORS enabled)

https://codesandbox.io/s/webgl-tiles-forked-yx38uh?file=/main.js

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

Successfully merging this pull request may close these issues.

GeoTiff style avoiding normalization.
3 participants