Solved

road network extraction


Badge

Hi,

I am trying to build a network using the OSM roads dataset. From this i would like to extract all roads within a set distance from a point. This should not be a simple as the crow flies buffer selection but by road distance on each road from the point.

Thoughts?

icon

Best answer by mark_f 30 July 2017, 22:42

View original

10 replies

Badge +2

@lemzip have a look at the NetworkCostCalculator transformer. Set the Weight Type By Length and output cost by Z value. Then test the Z values for your distance.

 

 

Badge +2

@lemzip have a look at the NetworkCostCalculator transformer. Set the Weight Type By Length and output cost by Z value. Then test the Z values for your distance.

 

 

 

P.S. You'll need to reproject the OSM from geographic lat long for a measure of distances or consider custom transformer GeographicLengthCalculator.
Badge

sounds good mark, will give it a try. thanks

Userlevel 4
Badge +25

@lemzip have a look at the NetworkCostCalculator transformer. Set the Weight Type By Length and output cost by Z value. Then test the Z values for your distance.

 

 

To add to @mark_1spatial's answer: I have recently done something quite similar, also using the NetworkCostCalculator and assigning educated guesses for the max speed in cases where it wasn't available in OSM. I've also used the Overpass Turbo API to extract only the roads in a certain radius (determined by assuming somebody driving at 20% over the overall max speed in a straight line for x minutes) around my starting point.

 

 

You may also want to look into parallel processing on the NetworkCostCalculator, it'll save you a lot of time.

 

 

See this thread for some more discussion.

 

 

 

Badge
To add to @mark_1spatial's answer: I have recently done something quite similar, also using the NetworkCostCalculator and assigning educated guesses for the max speed in cases where it wasn't available in OSM. I've also used the Overpass Turbo API to extract only the roads in a certain radius (determined by assuming somebody driving at 20% over the overall max speed in a straight line for x minutes) around my starting point.

 

 

You may also want to look into parallel processing on the NetworkCostCalculator, it'll save you a lot of time.

 

 

See this thread for some more discussion.

 

 

 

@redgeographics

 

 

Any chance you could kindly share the workbench part for the OSM/network cost work? Still struggling with this.

 

 

Thanks

 

Badge +2

I'd recommend validating the network first. All the FME network transformers assume that the network is clean. All intersections are fully noded and junctions occur at endpoints, not mid-point vertices. Use the NetworkTopologyCalculator to help validate the network and look for segments that do not connect

Userlevel 4
Badge +25
@redgeographics

 

 

Any chance you could kindly share the workbench part for the OSM/network cost work? Still struggling with this.

 

 

Thanks

 

I'll try and dig it up on monday.
Badge
I'll try and dig it up on monday.
@redgeographics

 

thats brilliant, thanks!
Userlevel 4
Badge +25
@redgeographics

 

thats brilliant, thanks!
Here you go. I'm using the OpenCage geocoder (removed my API key) to geocode an address, build a buffer around that and use that to extract data from OSM through the Overpass API (many thanks to @pimverver for figuring that one out). Then I'm adding some more data, built-up areas for The Netherlands, so I can make a guesstimate of the max speed in case it's not in OSM. The resulting road data is then cut in 4 slightly overlapping chunks to facilitate parallel processing. The NetworkCostCalculator does the actual work and I'm storing the drivetime distance as Z-values, then a ContourGenerator with some cleanup to end up with something that looks reasonably accurate and correct.

 

drivetime-sample.fmw

 

 

The problem is that it's still taking a fair amount of time to process, the parallel processing does make a big difference but it still takes my Mac 2 minutes to calculate an 8-minute drivetime contour and the processing time increases exponentially as the drivetime increases.

 

Badge

@lemzip have a look at the NetworkCostCalculator transformer. Set the Weight Type By Length and output cost by Z value. Then test the Z values for your distance.

 

 

@redgeographics Thanks for the workbench. I have got it working but just a query, it looks like it is not including roads from OSM that should be within the aloted contour. Is this due to it being non node ended?

 

 

Thanks

 

Reply