Skip to main content
Solved

Combine Featurereader and neighborfinder

  • January 5, 2016
  • 6 replies
  • 25 views

bubblebeb
Contributor
Forum|alt.badge.img+6
Combine Featurereader and neighborfinder

Best answer by erik_jan

So, if you want to select only those points from the PostGis database that are within or close to a polygon you want to enlarge the polygons by a margin (using the Bufferer) and use those polygons as Initiator for the FeatureReader to read the points. For performace reasons you might even want to replace the polygons by bounding boxes before enlarging them (using BoundingBoxReplacer).

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.

6 replies

bubblebeb
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 5, 2016

I have a shapefile with polygons which I want to find the nearest neighbour from a postgis database of points. If the postgis database was in shapefile I would use the neighborfinder but I want to be more efficent and query the Postgis to find the nearest neighbour.

Is there a way of combining the two together in FME?


erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • January 5, 2016

If you mean: Find the objects in an area surrounding a point objects, you can use the Bufferer to create a circle of interest and feed that to the FeatureReader. That way you will read the objects in a radius from the point object.


bubblebeb
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 6, 2016

It is the other way round. I have a polygon which I want to find which is the nearest point and then take the attributes from that point. e.g. a boundary of a property I want to find the nearest postcode point (Codepoint) to the polygon and then take the postcode from the point.

The codepoint is in a postgis database.

Rather than reading the entire postgis database in as a reader and then using the neighborfinder to do find the nearest point I wanted to use featurereader to streamline the process.


erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • Best Answer
  • January 6, 2016

So, if you want to select only those points from the PostGis database that are within or close to a polygon you want to enlarge the polygons by a margin (using the Bufferer) and use those polygons as Initiator for the FeatureReader to read the points. For performace reasons you might even want to replace the polygons by bounding boxes before enlarging them (using BoundingBoxReplacer).


mark2atsafe
Safer
Forum|alt.badge.img+59
  • Safer
  • January 7, 2016

So, if you want to select only those points from the PostGis database that are within or close to a polygon you want to enlarge the polygons by a margin (using the Bufferer) and use those polygons as Initiator for the FeatureReader to read the points. For performace reasons you might even want to replace the polygons by bounding boxes before enlarging them (using BoundingBoxReplacer).

Yes, I think it will be a two-step process (get near features with the buffer search then use a NeighborFinder). It is an interesting idea to combine the two - and perhaps you could suggest that in the ideas pages to see if it picks up votes from other users.


erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • January 7, 2016

Yes, I think it will be a two-step process (get near features with the buffer search then use a NeighborFinder). It is an interesting idea to combine the two - and perhaps you could suggest that in the ideas pages to see if it picks up votes from other users.

@Mark2AtSafe and @sebkingsley: I will add the "Find the nearest object" as a Spatial filter to the FeatureReader as an idea.