-
Notifications
You must be signed in to change notification settings - Fork 2
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
suggestion: parser returns absolute coordinates of each height #1
Comments
@Vichoko : Sorry I don't understand what you mean. Can you provide an example or give more detail ? |
I were confused by the square corners, as i imagined the hgt file contained punctual heights not a tiling of the surface. Now i see that the iterator include the square corners coordinates, and with that i can get the coordinates of each cell by getting the mean of the corners or subtracting 1/2400 to the top-right corner. (i'm trying to export the hgt files to a more flexible data structure) |
I think for indexing it is useful and lighter to retrieve the coordinate of the center of the square instead of the corners (1 value versus 4 values) |
Indeed, you are right, it would be more like only : lat of the center, lng of the center and another global one for the whole file which is the size of a square. But the intended use case of this library was with PostGIS and its raster format which needs the 4 coordinates of a square. And with the rounding issue (it took me a few hours to find a solution without errors), I did not want to have somebody else with the same problem. If needed, we could imagine something like this: >>> with HgtParser('/tmp/N00E010.hgt') as parser:
... for elev_value in parser.get_value_iterator(square_mode=False):
... # each value is a tuple (zero based line number, zero based column number, zero based index, (center coordinates, square width), elevation value)
... print(elev_value)
... break
...
(0, 0, 0, ((0.9995833333333334, 9.999583333333334), 0.83333333333334), 57) |
It's kinda tricky to do the mapping of row / columns to coordinates.
It could be a useful feature.
The text was updated successfully, but these errors were encountered: