How to get array indices from geo coordinates? #34
-
Hello, For my project I want to calculate the sky-view-factor of different Points in Germany. For this I'm using a digital elevation model of Germany in Geotiff format. I also have a list of points (given as tuples of EPSG:3857 coordinates) of which I need to calculate SVF of. I already got my algorithm working, now I only need the matching array indices to my given geo coordinates. I saw that there is the I already tried to implement it myself using the appropriate formulas of the Mercator projection, but I just couldn't get the latitude right :( So my question is: Best wishes, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @MartinKist, there are 2 hidden/internal methods that might help. geo_tiff._get_y_int(lat)
geo_tiff._get_x_int(lon) These methods round to the nearest Note this will only work if your |
Beta Was this translation helpful? Give feedback.
Hi @MartinKist, there are 2 hidden/internal methods that might help.
These methods round to the nearest
int
, but if you want a float, changes will have to be made.Note this will only work if your
as_crs
code is the same ascrs_code
.