Skip to content

Instantly share code, notes, and snippets.

@xivk
Created September 27, 2017 08:45
Show Gist options
  • Save xivk/b2f8d636d47adc0c052f50bb9561625a to your computer and use it in GitHub Desktop.
Save xivk/b2f8d636d47adc0c052f50bb9561625a to your computer and use it in GitHub Desktop.
Add way id's to an OsmSharp stream
// add way_id.
var eventsFilter = new OsmSharp.Streams.Filters.OsmStreamFilterDelegate();
eventsFilter.MoveToNextEvent += (OsmSharp.OsmGeo osmGeo, object param) =>
{
if (osmGeo.Type == OsmSharp.OsmGeoType.Way)
{
osmGeo.Tags.Add("way_id", osmGeo.Id.ToString());
}
return osmGeo;
};
eventsFilter.RegisterSource(progress);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment