Skip to main content
Question

Shortest path from all points to all other points in my dataset


ohashkii
Contributor
Forum|alt.badge.img+6

I am trying to find shortest distance from all points in red to all other points in green using network connecting all of them.

 

The point feature has only types (A,B).
Is it possible to have the short path finder to search the path always staring from point A to pint B.

18 replies

geomancer
Evangelist
Forum|alt.badge.img+46
  • Evangelist
  • January 27, 2025

Create a topologically correct network from your lines, and input it to the Network port of the ShortestpathFinder.

Create lines from every point of Type A to every point of Type B, and input them to the From-To port.

The results should give you the paths from every point of Type A to every point of Type B.

See the attached workspace for a working example.

 


ohashkii
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 28, 2025

@geomancer 

Thank you very much indeed.

I ran the attached workspace. As shown on the image I got 63 paths. although I have only 9 destinations.

I was expecting to get only short path 9.

 


geomancer
Evangelist
Forum|alt.badge.img+46
  • Evangelist
  • January 28, 2025

The workspace above returns a line between every point A and every point B. As there are 7 points A and 9 points B, 7*9=63 lines are returned.

If you want to know what point A is nearest to a point B, you can get that information by adding (and setting) a Sorter and a Sampler.

Note: when there are several points A at the same distance from a point B, only one point A is shown in the results.

 


ohashkii
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 28, 2025

Thanks,

Is there is anything preventing workspace output to be written to (gdb or CAD).

I have tried but get no feature written. 


geomancer
Evangelist
Forum|alt.badge.img+46
  • Evangelist
  • January 28, 2025

That shouldn't be a problem.

Are any features entering the export file in FME?

Do you get any error messages?


ohashkii
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 28, 2025

At the log file 0 feature  is written.


geomancer
Evangelist
Forum|alt.badge.img+46
  • Evangelist
  • January 28, 2025

Does FME show there are features entering the writer?

 


ohashkii
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 29, 2025

Yes, 9 features, but when adding them to arcmap no records found and it exit directly. 

I tried your workspace and the same workspace with my own data.

Thaks for your follow, appreciated! 


ohashkii
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 29, 2025

@geomancer ..Thanks


geomancer
Evangelist
Forum|alt.badge.img+46
  • Evangelist
  • January 29, 2025

So it may be a problem with how the features are wrtten to the geodatabase.

What happens when you write the resulting lines to a shapefile? Can that be opened in ArcMap?


ohashkii
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 29, 2025

I am out of office.I will try later..but what about your  machine, do you have any issues. 

The other workspace you send early about adjacent attributes works fine.

 


geomancer
Evangelist
Forum|alt.badge.img+46
  • Evangelist
  • January 30, 2025

From my workspaces in this question I can export to DWG without any problems, the DWG file contains the features I exported.

For the geodatabase I exported to 'ESRI Geodatabase (File Geodb Open API)’ and set the Geometry type to geodb_polyline. When I open this geodatabase-folder with FME Data Inspector (I don't use ArcMap) I see all the features I exported with their attributes. 

So no problems on my side.


ohashkii
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 30, 2025

@geomancer 

Thank you very much.you input is remarkable. 

Although the workspace shows features are written inside gdb. Unfortunately ,nothing is written when exploring data at arcmap.,however in cad and shape file no problem.every thing is there.

I have created a small polygons with an ID.

Can l limit the shortpath to searched within each polygon.

BR.

 


ohashkii
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 31, 2025

geomancer
Evangelist
Forum|alt.badge.img+46
  • Evangelist
  • February 3, 2025

I am certain it is possible. What have you tried?


ohashkii
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • February 3, 2025

I have given all polygons unique ID. Joining all points (A,B) have their unique polygon ID.

I stuck  with setting the approprate parameters  to limit the search condition. 


ohashkii
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • February 4, 2025

@geomancer 

Sir

Any thoughts or ideas will help.


geomancer
Evangelist
Forum|alt.badge.img+46
  • Evangelist
  • February 12, 2025

It took me some time to think this through.

I think you just need to remove the lines (after intersecting) that cross a polygon boundary, and you can limit the From-To lines to points within the same polygon.

The parts highlighted in orange are new.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings