Solved

Finding lines within polygons

  • 15 February 2016
  • 3 replies
  • 82 views

Badge

Hi. I have a geodatabase with lots of overlapping polygons and line features. Each polygon has two line features which lie totally within it but also parts of other lines. How can I select only the lines which are totally contained within each polygon? I've tried the LineOnAreaOverlayer but this chops up the lines into smaller segments based on the overlapping polygons which is not what I'm looking for.

icon

Best answer by ebygomm 15 February 2016, 15:30

View original

3 replies

Userlevel 1
Badge +10

You could try a spatialfilter, spatialrelator or the clipper transformers

Spatialfilter - areas going into the filter port, lines into the candidate port with the tests to perform set to contains will only output lines completely within an area.

Clipper - areas go into the clipper port, lines into the clippee then test for unclipped features coming out the inside port.

Userlevel 2
Badge +12

If the geodatabase is an Oracle geodatabase containing SDO_Geometry fields you can also use the SQLCreator and having the database do the hard work. The query would look like this:

SELECT line.id, polygon.id FROM line, polygon

WHERE SDO_INSIDE(line.shape,polygon.shape) = 'TRUE';

Badge

You could try a spatialfilter, spatialrelator or the clipper transformers

Spatialfilter - areas going into the filter port, lines into the candidate port with the tests to perform set to contains will only output lines completely within an area.

Clipper - areas go into the clipper port, lines into the clippee then test for unclipped features coming out the inside port.

Thanks for answers. The spatial relator seems to do the job.

Reply