Skip to main content
Solved

Find road facing Building

  • January 14, 2025
  • 5 replies
  • 63 views

boubcher
Contributor
Forum|alt.badge.img+11

Hello there 
how could we find the closest road facing  the Building  from the North, south, Est and West 
the ides is to take each side of the building  check its facing what direction and then towered that direct we should check the closest road we can see from that building side 

 


we are expected to get this result  each color represent the relation


​​​​​​​


I am attaching this sample data for reference
Thanks

​​​​​​​

Best answer by geomancer

A variant of the process mentoned above:

  1. Create a bounding box over the house shape
  2. Create lines of 2 vertices from the bouding box with a Chopper
  3. Create a perpendicular line to one side, through the midpoint of each line
  4. intersect with the roads
  5. find the nearest intersection for each line

For creating the perpendicular lines I used the 2DVectorCalculator from FME Hub.

View original
Did this help you find an answer to your question?

5 replies

liamfez
Influencer
Forum|alt.badge.img+34
  • Influencer
  • January 15, 2025

This questions seems a bit broad, could you clarify what you are looking for?

In particular, how are you defining sides? Looking at the image I see what appears to be 2 segments that make up the “red side”, more importantly in the yellow and purple “sides” you have 2 segments highlighted that are disjoint and separated by segments that you have not highlighted. This task may require generalization of the input polygon to some degree depending on your definitions of “side”.


max_h
Supporter
Forum|alt.badge.img+10
  • Supporter
  • January 16, 2025

WIthout knowing more, the workspace could give greatly different results. But I suppose this could maybe help you:

  1. bounding box over the house shape
  2. Chopper á 2 vertices on the bouding box
    and now for the tricky part to get the closest road in a 90° angle from the midpoint of each side (at least that’s how I interpreted what you want):
  3. centerpoint extractor
  4. rotator with 90° around each extracted centerpoint
  5. looper with ‘line extender’ until ‘line on line overlayer’ has a result


Though you would still have to cover some special cases like: 

  • as line extender extends in both directions you want the road facing away from the bounding box (maybe a filter on y/x coordinates beforehand could help here)
  • if the roads or building is placed differently (e.g. building a bit to the right) he would find the same line on both sides (here the yellow one for north and east)
    ​​​​​

I bet there are even better ways, but I hope this helps at least a bit as it would work on your given example at least.


liamfez
Influencer
Forum|alt.badge.img+34
  • Influencer
  • January 16, 2025

I agree ​@haverm, I was thinking of something along the same lines as you with steps 2-4. I think those steps could also be applied on a generalized shape effectively as well.

@boubcher I think a defined max distance would be helpful.


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • Best Answer
  • January 16, 2025

A variant of the process mentoned above:

  1. Create a bounding box over the house shape
  2. Create lines of 2 vertices from the bouding box with a Chopper
  3. Create a perpendicular line to one side, through the midpoint of each line
  4. intersect with the roads
  5. find the nearest intersection for each line

For creating the perpendicular lines I used the 2DVectorCalculator from FME Hub.


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • January 17, 2025
geomancer wrote:

A variant of the process mentoned above:

  1. Create a bounding box over the house shape
  2. Create lines of 2 vertices from the bouding box with a Chopper
  3. Create a perpendicular line to one side, through the midpoint of each line
  4. intersect with the roads
  5. find the nearest intersection for each line

For creating the perpendicular lines I used the 2DVectorCalculator from FME Hub.

@geomancer 
Thanks  I did some adjustment to fit the Geometry Shape 


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