Question

Check if point is within polygon based on matching attribute.

  • 15 December 2016
  • 14 replies
  • 61 views

Hi,

One of the things I currently have to work on is checking if points from an Arc shapefile are within their proper postal code. I normally have to check this visually, but a coworker suggested I may be able to do this check in FME but he doesn't use it so could not really give any input as to how to do it.

Basically, there are points that have a postal code assigned to them in their attributes and polygons that outline those postal codes.

Looking at the software I was thinking this would be done with the PointOnAreaOverlayer transformer but I cannot figure out how to tell it to check if, for example, the point with postal code 62025 is inside the 62025 polygon.

Any help with this would be greatly appreciated.

Thank you.


14 replies

Badge +16

Hi @jaymartin you are correct about the transformer, I would pay attention to the attributes handling especially when they are identical in both inputs.

After overlaying it's a matter of testing for overlap (_overlap attribute created by default) and if point post code is equal to polygon post code.

Hope this helps

p.s. If you have the same attribute on both features, you could also use a group by in the overlay, that way only points that have the same value in the postcode attribute will be compared with polygons having identical value.

Userlevel 2
Badge +12

Following up the right approach by @itay, if the attribute names are not the same on both datasets, you can rename (or copy) one of the attributes to match the other and then use the Group by option on the PointonAreaOverlayer.

Following up the right approach by @itay, if the attribute names are not the same on both datasets, you can rename (or copy) one of the attributes to match the other and then use the Group by option on the PointonAreaOverlayer.

I'm running into an issue trying to do as yourself and itay suggest. My data is in shapefiles, but when I try to use them with the PointOnAreaOverlayer it just rejects them all but I can't find that it tells me why exactly it is rejecting them. Converting them to CAD files fixes the issues but I lose the attributes.

 

 

Sorry if I'm missing something obvious, I have very little experience with this sort of stuff.

 

 

Userlevel 2
Badge +12
I'm running into an issue trying to do as yourself and itay suggest. My data is in shapefiles, but when I try to use them with the PointOnAreaOverlayer it just rejects them all but I can't find that it tells me why exactly it is rejecting them. Converting them to CAD files fixes the issues but I lose the attributes.

 

 

Sorry if I'm missing something obvious, I have very little experience with this sort of stuff.

 

 

Do you actually have areas or do you have closed lines in shape?

 

 

Badge +16

in case of lines try an areabuilder to create areas for the proces.

Do you actually have areas or do you have closed lines in shape?

 

 

They are Arc polygons in a shapefile.

 

 

Userlevel 4
Badge +13
They are Arc polygons in a shapefile.

 

 

 

Could you post the rejection message? Be sure to be routing the areas to the Area port and the Points to the Point port as well.

Following up the right approach by @itay, if the attribute names are not the same on both datasets, you can rename (or copy) one of the attributes to match the other and then use the Group by option on the PointonAreaOverlayer.

 

@daleatsafe

 

 

http://pastebin.com/iiCj1wGU

 

Userlevel 2
Badge +12

 

@daleatsafe

 

 

http://pastebin.com/iiCj1wGU

 

The failing feature does not have a geometry. You probably want to check if the features are actually polygons by using a GeometryFilter transformer.

 

 

The failing feature does not have a geometry. You probably want to check if the features are actually polygons by using a GeometryFilter transformer.

 

 

I can't really figure out how to change it. Arc says they are actually polygons and they are used as polygons inside ArcMap. Is there a way to give it geometry somehow?

 

 

Userlevel 1
Badge +10

You could also try the geometrycoercer with geometry type set to fme_polygon

You could also try the geometrycoercer with geometry type set to fme_polygon

It still rejects the data as IFMENull which supposedly means it has no geometry. I guess I'm just not understanding why polygons from Arc, which obviously do have geometry aren't considered to have it by FME.

 

 

Badge +16

I would advise you to send your workspace and some data to support.

Userlevel 4
Badge +13
It still rejects the data as IFMENull which supposedly means it has no geometry. I guess I'm just not understanding why polygons from Arc, which obviously do have geometry aren't considered to have it by FME.

 

 

I htink that there area few NULL polygons in the input file, which ArcGIS just is happy to ignore. If you connect a visualizer/logger to the Rejected port on the overlayer, then you'll be able to see how many there are and if you care.

 

 

You can also use a GeometryFilter ahead of the overlayer to get rid of the NULL ones or route them early as well.

 

 

Let us know how it goes @jaymartin

 

Reply