Skip to main content
Solved

How to find points that aren't in a polygon (but they match on an attribute)

  • January 21, 2021
  • 8 replies
  • 124 views

I'm trying to create a validation routine that tells me what points are not in their expected polygon.

 

I have two tables with an areaid common to both- one has point geometry (building b) and the other has polygons (area a). something along the lines of the following badly phrased pseudocode!

select * from building where building point does not exist in area and a.areaid = b.areaid

All help appreciated! Thanks in advance

Best answer by david_r

You can e.g. use a PointOnAreaOverlayer with a GroupBy on areaid. On the Points output, connect a Tester and check for _overlaps = 0.

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

8 replies

david_r
Celebrity
  • Best Answer
  • January 21, 2021

You can e.g. use a PointOnAreaOverlayer with a GroupBy on areaid. On the Points output, connect a Tester and check for _overlaps = 0.


redgeographics
Celebrity
Forum|alt.badge.img+50

If you use a PointOnAreaOverlayer that's set to group by the areaid and then a Tester or TestFilter to filter out the points with _overlaps = 0 you'll get all the points that are not within an area with the same areaid.


  • Author
  • January 21, 2021

Thanks for the quick response folks! I've tried that but it's not working - they all seem to have 'passed' and there's no area attribution on the point! I've had a look at the data, I've looked at projections, included an areabuilder to make sure I wasn't passing a line - is there anything else that I need to look at?

I've got a vertexcreator directly before the PointOnAreaOverlayer if that makes a difference

 

(I'd love to post the existing work bench with some data but it's licensed!)


redgeographics
Celebrity
Forum|alt.badge.img+50
abbas_lokat wrote:

Thanks for the quick response folks! I've tried that but it's not working - they all seem to have 'passed' and there's no area attribution on the point! I've had a look at the data, I've looked at projections, included an areabuilder to make sure I wasn't passing a line - is there anything else that I need to look at?

I've got a vertexcreator directly before the PointOnAreaOverlayer if that makes a difference

 

(I'd love to post the existing work bench with some data but it's licensed!)

Hmmm...

If we can't see the workspace or data that's going to make it a bit difficult, but there's a few things you can check:

  • Do all your points have an areaid? Is it spelled the same as the ones on the areas? Any trailing spaces perhaps?
  • Are your points in the same coordinate system as the areas? You can check this by viewing them in the Data Inspector but switch off the background map (with the background map FME will reproject on the fly to that system, but that's not what will happen inside transformers)

I'm a bit unclear about what you mean when you say "there's no area attribution on the point", my assumption is that before the PointOnAreaOverlayer they do (because otherwise there is no way to connect them to the areas)


david_r
Celebrity
  • January 22, 2021
abbas_lokat wrote:

Thanks for the quick response folks! I've tried that but it's not working - they all seem to have 'passed' and there's no area attribution on the point! I've had a look at the data, I've looked at projections, included an areabuilder to make sure I wasn't passing a line - is there anything else that I need to look at?

I've got a vertexcreator directly before the PointOnAreaOverlayer if that makes a difference

 

(I'd love to post the existing work bench with some data but it's licensed!)

First thing to check is that the attribute "areaid" that is used for the Group By exists with the exact same name (case sensitive!) on both the point and area dataset.


  • Author
  • January 22, 2021
redgeographics wrote:

Hmmm...

If we can't see the workspace or data that's going to make it a bit difficult, but there's a few things you can check:

  • Do all your points have an areaid? Is it spelled the same as the ones on the areas? Any trailing spaces perhaps?
  • Are your points in the same coordinate system as the areas? You can check this by viewing them in the Data Inspector but switch off the background map (with the background map FME will reproject on the fly to that system, but that's not what will happen inside transformers)

I'm a bit unclear about what you mean when you say "there's no area attribution on the point", my assumption is that before the PointOnAreaOverlayer they do (because otherwise there is no way to connect them to the areas)

Thank you! that cracked it - it was the areaid and an '_'.

A small thing, big headache! Thanks for your help!


  • Author
  • January 22, 2021
david_r wrote:

First thing to check is that the attribute "areaid" that is used for the Group By exists with the exact same name (case sensitive!) on both the point and area dataset.

That's it! Thank you!


redgeographics
Celebrity
Forum|alt.badge.img+50
redgeographics wrote:

Hmmm...

If we can't see the workspace or data that's going to make it a bit difficult, but there's a few things you can check:

  • Do all your points have an areaid? Is it spelled the same as the ones on the areas? Any trailing spaces perhaps?
  • Are your points in the same coordinate system as the areas? You can check this by viewing them in the Data Inspector but switch off the background map (with the background map FME will reproject on the fly to that system, but that's not what will happen inside transformers)

I'm a bit unclear about what you mean when you say "there's no area attribution on the point", my assumption is that before the PointOnAreaOverlayer they do (because otherwise there is no way to connect them to the areas)

You're welcome!


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