Skip to main content
Solved

Combine Featurereader and neighborfinder


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).

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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+18
  • 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+18
  • 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+44
  • Safer
  • January 7, 2016
erik_jan wrote:

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+18
  • Contributor
  • January 7, 2016
mark2atsafe wrote:

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.


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