tkrajina / srtm.py

Geo elevation data parser for "The Shuttle Radar Topography Mission" data
Apache License 2.0
245 stars 57 forks source link

No elevation for Hamburg #12

Closed FlorianWilhelm closed 8 years ago

FlorianWilhelm commented 8 years ago

Somehow this magical point GPXTrackPoint(53.51195, 9.97416666667) gets an elevation of None although it is close to Hamburg, Germany. Varying the latitude/longitude a bit works. Is this a rounding error somewhere in srtm.py?

tkrajina commented 8 years ago

That's why I added the API to create sample images from the data. Try this

geo_elevation_data = mod_srtm.get_data()

#53.51195, 9.97416666667
image = geo_elevation_data.get_image((400, 400), (53, 54), (9, 10), 100)
image.save('aaa.png')

This is the result:

aaa

I tried to force using only SRTM1 and it looks like there are no data at all for that square, maybe something is wrong with that.

I'm not sure, maybe I should just assume the elevation is 0 in those points. I'll recheck the code later... If I remember correctly, the blue dots are elevation 0, white dots have some weird value, so I assume(d) it is missing data.

FlorianWilhelm commented 8 years ago

Thanks for the fast explanation. I found that behaviour when I used add_elevations(gpx_obj, smooth=True). In this case if there is a start or end point point with elevation None the code breaks at an assertion statement. It really seems that the height map of the moon is more complete than what we have on earth:-) But I think breaking is okay in this case. So we can close this I guess.