Skip to content
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

Is there a way to extract the lat/long coordinates for each point along a "way?" #64

Closed
00krishna opened this issue Apr 7, 2022 · 3 comments

Comments

@00krishna
Copy link

So I get that a way represents a set of edges between nodes in an OSM graph. I was wondering, is there a method to query all of the points that fall along a way? That is, I would like to identify all of the latitude and longitude points along a way.

I did google this question, and it seems like other people push the OSM graph into a database like PostGIS to do this. I was just wondering if there was a way to do this without pulling down to a database? Thanks.

The reason is that I have a different geospatial layer, and I need to basically match the points on each path to the points on the raster layer. And then I can basically integrate that path, and assign that integral value to the nodes on either side of the path. And then I can hopefully use that information to make routing decisions. That is the intent anyway.

Thanks.

@ghost
Copy link

ghost commented May 17, 2022

Hi,

As OSMX pakage gives the routes in the format of node IDs and as m.nodes[node_id] command returns an ENU coordinates so you can perhaps use the following:

LLA(m.nodes[node_id]) # which gives latitude and longtitude

@pszufe
Copy link
Owner

pszufe commented May 17, 2022

Basically, the ENU coordinates are ready for plotting.
Having an ENU node you can do getX(::ENU) and getY(::ENU) and use it to plot a map. OpenStreetMapXPlot.jl is actually using this mechanism.
To convert from ENU to LLA you need to provide the reference point where the ENU system is attached.
typically this will be something like:

LLA(enu, some_map_data.bounds)

where enu is an ENU node and some_map_data is a result of loading of an OSM file

@00krishna
Copy link
Author

@pszufe Oh thanks for showing me how to do this. This is very helpful. So ENU coordinates are the way to go. I will try and implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants