Skip to main content
Solved

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

  • Jan 21, 2021 10:05 AM UTC
  • 8 replies
  • 278 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
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

david_r
Celebrity
  • Best Answer
  • Jan 21, 2021 10:13 AM UTC

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
VIP
Forum|alt.badge.img+63

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.


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
VIP
Forum|alt.badge.img+63

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
  • Jan 22, 2021 11:12 AM UTC

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
  • Jan 22, 2021 11:22 AM UTC

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
  • Jan 22, 2021 11:23 AM UTC

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
VIP
Forum|alt.badge.img+63

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!