You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at IDP I'd need to add a custom tag if the nodes referenced by a way is inside an area.
My idea was to create a filter like AddWayId but I don't know how to get the coordinates of the nodes contained in the Nodes collection of the Way.
Could you help me doing this.
Thanks static OsmSharp.OsmGeo EventsFilter_AddWayId(OsmSharp.OsmGeo osmGeo, object param) { if (osmGeo.Type == OsmSharp.OsmGeoType.Way) { var w = (OsmSharp.Way)osmGeo; foreach(var node in w.Nodes) { //var lat = ?? how to get latitude of node } osmGeo.Tags.Add("way_id", osmGeo.Id.ToString()); } return osmGeo; }
The text was updated successfully, but these errors were encountered:
This is why Itinero does 2 passes over the OSM-data. This is what happens in each pass:
Checks way tags and if usefull adds the node id's to a large set.
Saves the node coordinates that are in the set from pass 1.
This is the only way to get all the node coordinates. Itinero already does so you should be able to reuse the way I have done this.... have a look at the code processing the OSM data in Itinero.
Looking at IDP I'd need to add a custom tag if the nodes referenced by a way is inside an area.
My idea was to create a filter like AddWayId but I don't know how to get the coordinates of the nodes contained in the Nodes collection of the Way.
Could you help me doing this.
Thanks
static OsmSharp.OsmGeo EventsFilter_AddWayId(OsmSharp.OsmGeo osmGeo, object param) { if (osmGeo.Type == OsmSharp.OsmGeoType.Way) { var w = (OsmSharp.Way)osmGeo; foreach(var node in w.Nodes) { //var lat = ?? how to get latitude of node } osmGeo.Tags.Add("way_id", osmGeo.Id.ToString()); } return osmGeo; }
The text was updated successfully, but these errors were encountered: