Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hey!

I've been tinkering around with trying to reduce file size of height & elevation data, and was wondering about the value (or not) of adding support for float16 in rasterio.

Reasoning for this:

  • Most height rasters are in meters. This means that realistically, on Earth, values will be between, taking at max: 9000 (Everest) and -13000 if we go underwater, to Marianna trench.
  • For most applications, the accuracy of any measurements would be pushing it to go beyond millimetres, i.e. 10^-3

This looks like float16 would be a dtype data fit for this type of raster. Benefits being able to store the same amount of information practically speaking as a float32 raster, but for a much smaller file.

I was surprised to see float16 not being implemented in rasterio actually, so am I missing something here? I also haven't found previous discussion about this hence why I'm opening this post

Genuinely curious!

You must be logged in to vote

Replies: 2 comments · 3 replies

Comment options

it's not supported in rasterio because it's not yet supported in GDAL

ref: OSGeo/gdal#10144

You must be logged in to vote
3 replies
@MaxLenormand
Comment options

Hah, that's so obvious I didn't even think about it

Thanks, I'll keep en eye out for developments on that side!

@vincentsarago
Comment options

yeah, things are moving in GDAL 🔥

just keep in mind that there might be some delay between stuff added in GDAL to be added in rasterio 🙏

@sgillies
Comment options

Good question @MaxLenormand, good answer @vincentsarago !

This would be best handled upstream in GDAL. FWIW, the point cloud community (for one) comes at it from a different direction: integer units and float scale factors.

Comment options

I wanted to follow up on this issue. It seems gdal now support float16: https://gdal.org/en/stable/user/raster_data_model.html. I would be very much interested in using this. I am sure supporting gdal 3.11 might have a lot more new features than just this one (making it a bigger lift to integrate). I wanted to ask given as this datatype is currently excluded: https://github.com/rasterio/rasterio/blob/main/rasterio/dtypes.py

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
Labels
None yet
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.