Skip to main content
Question

How to compare roads attributes in two cities?


bobo
Contributor
Forum|alt.badge.img+3
  • Contributor

Hi, everyone, I have road data of 2 cities, roads at their boarder may have same attributes like name, width and lane and I want to know if their attributes are the same. If there's only 1 road on each side, it's easy by using list. But like the figure below, if there're more than 1 road on each side, I can't find a way to build the right list. Maybe road A in city 1 and road D in city 2 are same road, or road A in city 1 and road C in city 2 are same road, so I want to build two lists with road attributes( road A and C, road A and D). No matter I use PointOnLineOverlayer or Intersector, I can only build a list with all roads attributes in it. Road A, B ,C ,D intersect at same point on the boarder.

Can anyone help me out? I want to build 4 lists, A and C, A and D, B and C, B and D

无标题

6 replies

Forum|alt.badge.img+2
  • December 30, 2020

@bobo​ Can you attach a small sample dataset? Someone might create an example workspace for you.

What you need to do is process the lists you've created. Have a look at the many list processing transformers available in FME. If those don't quite work ten you might need to revert to PythonCaller - see the very end of the article above for a small example of using Python with FME lists


bobo
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • January 5, 2021
markatsafe wrote:

@bobo​ Can you attach a small sample dataset? Someone might create an example workspace for you.

What you need to do is process the lists you've created. Have a look at the many list processing transformers available in FME. If those don't quite work ten you might need to revert to PythonCaller - see the very end of the article above for a small example of using Python with FME lists

Hi @Mark Stoakes​ , I've upload a sample dataset. I want to put the attributes of each two roads on both sides in the same list, then I can compare if their attributes are the same. May I can use Intersector to get the intersect point and then PointOnLineOverlayer to create the list. For example, road A and road C in list 1, road A and road D in list 2. But now I can only get road A, B, C, D in same list.


Forum|alt.badge.img+2

You can use a NeighborFinder it looks like. To compare both sides, add a 2nd NeightborFinder with the inputs switched and that should give you all possible combinations.

 

Workbench

neighborsTable

table


Forum|alt.badge.img+2
  • January 5, 2021

@bobo​ Thanks for including the data. NeighborFinder will work as suggested by @jlbaker2779​ . You could add a Group By: Name so only the same roads match.

Or use the SpatialRelator, something like this:

workspaceexample workspace attached (FME 2020.2)


bobo
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • January 6, 2021
markatsafe wrote:

@bobo​ Thanks for including the data. NeighborFinder will work as suggested by @jlbaker2779​ . You could add a Group By: Name so only the same roads match.

Or use the SpatialRelator, something like this:

workspaceexample workspace attached (FME 2020.2)

Thanks Mark, but sometimes each name of the intersected roads may not be the, I mean that there're​ maybe four names for four roads, then group by may not work as expected.


Forum|alt.badge.img+2
  • January 6, 2021
bobo wrote:

Thanks Mark, but sometimes each name of the intersected roads may not be the, I mean that there're​ maybe four names for four roads, then group by may not work as expected.

@bobo​  In that case drop the group by and add a ListExploder. That will give you every pair.


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