eldang / elevation_lookups

Takes an input file of paths described as series of points, outputs a file of data about the elevation changes along those paths.
Apache License 2.0
3 stars 2 forks source link

SRTM results odd #22

Closed dabreegster closed 3 years ago

dabreegster commented 3 years ago

I can now successfully import SRTM data! But in my initial tests around Anchorage and NYC so far, the results seem to have some problems. The issue might be on my side, still looking into it.

Screenshot from 2021-03-27 11-34-46 Lower Manhattan is apparently flat, except for this vertical strip with a very bizarre pattern of extreme steepness. These values are 20,000 % incline...

I'm seeing lots of elevation values of -32776m.

I'll check the raw output file to see if I'm messing up the import on my end.

dabreegster commented 3 years ago

Input: input.txt Output: output.txt

Lot of empty lines in the output; I'm skipping those correctly now. But I also see -32768 show up quite a bit. This is one of the things totally blowing up my contour visualization.

dabreegster commented 3 years ago

Wild guess: is this similar to #13 -- SRTM encodes nodata in a certain way?

eldang commented 3 years ago

Oh my. From a quick investigation, you've found a pair of very silly bugs:

  1. The -32768 is indeed a nodata value. The fix for #13 should have dealt with that (it simply treats anything deeper than Challenger Deep as automatically suspect data, rather than gambling on the exact nodata values being consistent between files), except that I didn't properly handle cases in which it's the last point in the line.
  2. I broke the SRTM tiles downloader in such a way that when it downloads multiple tiles, they end up all being repeats of the NE-most one. As it happens, I have SRTM tiles saved for Anchorage from before I broke that, so I get good data for Anchorage: elevation_anchorage.txt . But I'm getting the same problem you see for Manhattan: everything W of -7 4 longitude is null because the wrong TIFF was downloaded, and those wacky slopes are all where the street grid falls off the edge of the world.

Neither of these things should be very hard to fix, but I probably won't get to them before Monday.

dabreegster commented 3 years ago

where the street grid falls off the edge of the world

world

(And no rush)

eldang commented 3 years ago

The thing giving me the greatest sense of urgency about these two bugs is how embarrassed I am by them....

eldang commented 3 years ago

I ended up working today so I can take some time off and get out on the bike tomorrow when it won't be blowing a gale. The two commits I just made have fixed these bugs. Manhattan is still remarkably flat, but I think that actually reflects reality. I still get a few negative elevations from SRTM in it, but they're small numbers that I suspect reflect real source data issues rather than a bug: nyc.txt