itinero / srtm

A library to load SRTM data and return heights in meter.
MIT License
16 stars 11 forks source link

Support for SRTMv4 data #9

Open themohitkhare opened 3 years ago

themohitkhare commented 3 years ago

They have released newer SRTM data, Is it possible to add local data support? https://cgiarcsi.community/data/srtm-90m-digital-elevation-database-v4-1/

xivk commented 3 years ago

This is definitely possible but I personally don't have the time right now. Pull-requests welcome! :+1:

themohitkhare commented 3 years ago

I was thinking the same thing, but they have changed the file format for the version 4. Need some help in how can I parse this latest format.

xivk commented 3 years ago

Is the current way of doing things broken because of some hardcoded URL? We host the source data on our own server so we don't notice any changes to the source data.

xivk commented 3 years ago

If you have some code example somewhere that can parse this new format, please post it here (doesn't have to be C#).

themohitkhare commented 3 years ago

The data is ACSII file, with a 2d array holding the elevation data. But It would take some time to understand as it is all new to me. I believe the tiles contains latitude and longitude data.

https://drive.google.com/drive/folders/17dnXkQKlF_fcqqETrHco5cVfF3R7kty0

xfischer commented 3 years ago

Hi ! The data is in Esri Ascii Grid format, well documented. (see here) I have coded a reader here if you are interested : https://github.com/dem-net/DEM.Net/blob/46c8546117d51b3485912e9f1568587760dfa2c4/DEM.Net.Core/IO/Raster/AsciiGridFile.cs

themohitkhare commented 3 years ago

I tried the above reader, but it seems like the SRTM class is tightly coupled with the .hgt type used in SRTMv3. Either I would have to change the entire structure, or @xivk can add better structure allowing easy compatibility with SRTMv4 ACSII structure. Maybe further abstraction is the way to go.