itinero / routing

The routing core of itinero.
Apache License 2.0
221 stars 69 forks source link

Question: fastest method to get edges contained in an area #216

Closed alecava58 closed 6 years ago

alecava58 commented 6 years ago

What would be the fastest method to get the edge ids contained in an area. The area could be a circle or a polygon.

The method could be: uint[] GetEdgesInCircle(GeometricGraph _graph, Coordinate center, int radiusInMeter) or IList GetEdgesInCircle(GeometricGraph _graph, Coordinate center, int radiusInMeter)

or uint[] GetEdgesInPolygon(GeometricGraph _graph, Polygon _polygon)

or RoutingNetwork extension

xivk commented 6 years ago

This could be a nice addition to the API, what is your usecase? Perhaps to get this done using the current version you can look at the routerdb extension methods like this one:

https://github.com/itinero/routing/blob/develop/src/Itinero/RouterDbExtensions.cs#L1527

alecava58 commented 6 years ago

Thanks @xivk ,

The usecase is to add an attribute (at runtime) to all the edges included in an area.

I'll take a look at the method you suggested.

xivk commented 6 years ago

Closing this as it seems to be answered now. Feel free to reopen if you still have related questions.