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 of DTED and SRTM #13

Open
raggnic opened this issue Feb 15, 2018 · 5 comments
Open

Support of DTED and SRTM #13

raggnic opened this issue Feb 15, 2018 · 5 comments

Comments

@raggnic
Copy link

raggnic commented Feb 15, 2018

Hello

Are DTED format or SRTM Supported?

With a DTED I run the following command rio rgbify -b 10000 -i 0.1 N43.dt0 n43.rgb.tif and I get the following message : rasterio._err.CPLE_NotSupportedError: DTED driver only uses the first band of the dataset

With a SRTM downloaded from http://dwtkns.com/srtm/ i run the same command rio rgbify -b 10000 -i 0.1 srtm_38_04.tif srtm_38_04_rgb.tif and I get this message Given nodata value, -32768.0, is beyond the valid range of its data type, <class 'numpy.uint8'>.

I may be doing something wrong somewhere but so far i've not seen where...
Regards

@raggnic
Copy link
Author

raggnic commented Feb 16, 2018

Ok never mind, I was able to change the nodata value using gdal

@dnomadb
Copy link
Contributor

dnomadb commented Feb 19, 2018

@raggnic thanks for the ticket! This is happening because while we are updating the output data type, I neglected to also update the nodata value: https://github.com/mapbox/rio-rgbify/blob/master/rio_rgbify/scripts/cli.py#L46

The fix to avoid this would be straightforward (just update the destination profile with a nodata of None). I am not sure that this fixes the underlying problem, however, which is -- how do you support transparency with this encoding?

Side note: any specific reason you are outputting to a tif instead of an mbtiles? I mention this because almost any usage (tiling or otherwise) could introduce artifacts due to resampling that would break the encoding.

@raggnic
Copy link
Author

raggnic commented Feb 20, 2018

It's fine, i don't need transparency currently, but yes, it should be possible to have nodata areas. I've seen Dted with no data areas.
I'm tried mbtiles format, but when I run the command nothing happens, Python keeps forking new process but CPU is at 5% and the output does not grow for hours. I'm on windows.

Besides this format is useful to be able to serve the result through tms. So far I've not seen artefacts on tile borders

@dnomadb
Copy link
Contributor

dnomadb commented Feb 20, 2018

should be possible to have nodata areas

Yes, agree, I am just not sure how to implement it with 8 bit rgb encoding without using a possibly valid data value (0 0 0); the best solution might be to add an alpha band.

So far I've not seen artefacts

Excellent -- you wouldn't see them on borders, youd see them in the encoding. The problem is that a slope proceeds, the B (for example) band goes from 0, 1, ... 256, then back to 0, 1; is any resampling is performed in between subsequent pixels, it will add artifacts between 255 and 0 (unless using nearest neighbor resampling).

That said, it shouldn't take hours (minutes if that), I'll take a look at an SRTM from above. Do you have the exact command you are using?

@ThomasHalwax
Copy link

I'm tried mbtiles format, but when I run the command nothing happens, Python keeps forking new process but CPU is at 5% and the output does not grow for hours. I'm on windows.

This is still an issue. I am running rasterio inside a docker container with Ubuntu 18 and Python 3.

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