Skip to main content
Solved

Networkcostcalutor: I'm doing something wrong with the network preparation

  • June 18, 2024
  • 8 replies
  • 223 views

michiedem
Contributor
Forum|alt.badge.img+7

I am trying some network analisys (isochrones and route/gpx creation) and I am obviously doing something wrong, I just can't figure out what.

I am using OSM highways, unfiltered (I also tried a local route network, same result). The only manipulation I did is convert it to espg 28992RDnew (because it's in meters) before using it as an input for the topologybuilder (also tried topology calculator).

 

Since I have multiple start points I created a road network Per stop_id and used ‘group by’ on the topologybuilder and networkcostcalculator.

 

 

The results are very weird. Connected and (way too many) not connected seem random:

 

(green = connected, red = not connected)

 

Zoomed in:

I tried pretty much all settings on the networkcostacalculator.

 

When I try the shortestpathfinder it's also clear that something is off, it refuses to use some (random) paths/roads/lines. So it's obvious I am doing something wrong, I just cannot figure out what.

 

 

Best answer by nielsgerrits

Not sure what is happening. When I use your workspace I can’t get it to work. When I build something from scratch no issues. Maybe something wrong in 2023.0.0? I used 2023.2 (and never ever use .0 versions for production work honestly)

I think it also has to do with you source points being that far off the vertices in the network. For it to work it needs to be snapped to a vertex, not a segment. If I set Snap Source Points in the NetworkCostCalculator to 100 meters it does work for me.

Also, one of the source points in your sample set has the x / y swapped as it lands in Germany.

===

Looking through the Changelog:

NetworkCostCalculator: Inconsistent results when source node is not a valid node in the network
https://fme.safe.com/changelog/?_change_log_platform=fme-form

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

michiedem
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 18, 2024

I just noticed sometyhing very weird: If I remove all attributes from the input point except strops_id (and nothing else), it changes the amount of roads that are connected. That shouldn't happen??


liamfez
Influencer
Forum|alt.badge.img+44
  • Influencer
  • June 18, 2024

Have you tried using the TopologyBuilder without a Group By?

A LineCombiner may also be helpful to combine some of those lines between intersections, where appropriate.


nielsgerrits
VIP
Forum|alt.badge.img+62

Hard to say what is going on, but I would start with one stop input. Put a Sampler before the first counter set to 1st N and get it to work, then process more or all features.


michiedem
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 18, 2024

Hard to say what is going on, but I would start with one stop input. Put a Sampler before the first counter set to 1st N and get it to work, then process more or all features.

It works as intended with one stop. It goes wrind as soon as I add another one. Something else very weirs: I use the featurereader to read the OSM lines which I stored in postgis. I use an area (buffer around the point) with the stop_id. So all roads in that area get an extra attribute ‘styop_id’ which is the id of the stop. So far, soi good.

 

When I use the line combiner and combine on the stop ID I should get 2 sets of lines if I use 2 stops as input. If I open the attribute table there are only 2 sets of ID's. But the line combiner gives me a couple of hundred lines.

 

It must be something small/stupid, but I just can't find it


michiedem
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 18, 2024

Have you tried using the TopologyBuilder without a Group By?

A LineCombiner may also be helpful to combine some of those lines between intersections, where appropriate.

Same random result unfortunately :(

 

I also tried a different source for the network (for the Dutch people: I also tried the NWB). Same random result as soon as I add a second stop


michiedem
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 18, 2024

Here is the workspace with some sample data. The result on my computer:

 


nielsgerrits
VIP
Forum|alt.badge.img+62
  • Best Answer
  • June 18, 2024

Not sure what is happening. When I use your workspace I can’t get it to work. When I build something from scratch no issues. Maybe something wrong in 2023.0.0? I used 2023.2 (and never ever use .0 versions for production work honestly)

I think it also has to do with you source points being that far off the vertices in the network. For it to work it needs to be snapped to a vertex, not a segment. If I set Snap Source Points in the NetworkCostCalculator to 100 meters it does work for me.

Also, one of the source points in your sample set has the x / y swapped as it lands in Germany.

===

Looking through the Changelog:

NetworkCostCalculator: Inconsistent results when source node is not a valid node in the network
https://fme.safe.com/changelog/?_change_log_platform=fme-form


michiedem
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 21, 2024

Not sure what is happening. When I use your workspace I can’t get it to work. When I build something from scratch no issues. Maybe something wrong in 2023.0.0? I used 2023.2 (and never ever use .0 versions for production work honestly)

I think it also has to do with you source points being that far off the vertices in the network. For it to work it needs to be snapped to a vertex, not a segment. If I set Snap Source Points in the NetworkCostCalculator to 100 meters it does work for me.

Also, one of the source points in your sample set has the x / y swapped as it lands in Germany.

===

Looking through the Changelog:

NetworkCostCalculator: Inconsistent results when source node is not a valid node in the network
https://fme.safe.com/changelog/?_change_log_platform=fme-form

Just updating to the latest version did the trick. Thank you!!

 

(now I have a weird bug with the anchorsnapper though, I can only connect it to 1 input, whatever I do. Worked around it)