3

I have a polyline that I would like to query features that are on it's left, right, top, bottom. I am not looking for the features surrounding it but for features that are on a certain location from the polyline. Example: I am trying to query features that are on the left side of the polyline. The pictures below demonstrate what I am looking for.

I tried ItopologicalOporator, but the buffering takes all the features surrounding it which is not what I want. any Ideas ?

enter image description here

3
  • Possibly related questions gis.stackexchange.com/questions/156578/… gis.stackexchange.com/questions/120794/… gis.stackexchange.com/questions/149661/… Commented Sep 6, 2015 at 12:50
  • I would start with a simple solution and see if the results are good enough. Create a new line with 0.01 m offset to the left of the original file. Compute distances. If feature is closer to the leftside offset line than to the original line, it belongs to your leftside group. Commented Sep 6, 2015 at 14:58
  • Does a simple bounding box test? For left of polyline s, select polygons i where xmax(i) > xmin(s) and ymin(i)>ymin(s) & ymax(i)<ymax(s) assuming you want polygons that are fully within the N-S limits of s... Commented Sep 7, 2015 at 9:43

2 Answers 2

3

You can try to use a Spatial Query. Just define the geometry, and you will get features depending on that geometry.

// create a spatial query filter ESRI.ArcGIS.Geodatabase.ISpatialFilter spatialFilter = new ESRI.ArcGIS.Geodatabase.SpatialFilterClass(); // specify the geometry to query with spatialFilter.Geometry = searchGeometry; // perform the query and use a cursor to hold the results ESRI.ArcGIS.Geodatabase.IQueryFilter queryFilter = new ESRI.ArcGIS.Geodatabase.QueryFilterClass(); queryFilter = (ESRI.ArcGIS.Geodatabase.IQueryFilter)spatialFilter; ESRI.ArcGIS.Geodatabase.IFeatureCursor featureCursor = featureClass.Search(queryFilter, false); 

The question now is which geometry you should use. My suggestion is to create a circle, and divide the circle in 4 portions, so every portion is related with one option: left, top, right, bottom.

1
  • I also came to this solution but using polygons instead of circles. I called it the long way since I have to build a polygon from each edge, decide if the polygon is in the right direction, and get the features that intersect the polygon. I was hoping I would find a quick way through a method or interface within the arcobjects apis. It seems the long way is the way to go, I will post my solution soon. Commented Sep 8, 2015 at 10:09
1

Here is the solution to my problem, I was hoping I would find an interface or some class that would do this for me, but I guess I'll have to do it manually. Simply, my problem was I have a polygon named "A". This polygon is made up from segments, and I want to decide which segment has the most features that are on its outer side.

then I get the segments that make up Polygon A and start analyzing and examining it. I used queryNormal twice on the segment being examined (once for using from point and once using the to point as the distance). The resulting lines will be parallel, so I get those lines ToPoint and create a line that connects them now I have 3 new lines plus the examined segment from Polygon A. I used IsegmentCollection interface and added those 4 segments, thus creating a polygon shape(casted it to Ipolygon). once I had the geomatry that I want to use in my search, I used the spatial reference to query those features that intersect the new polygon I created. This process is repeated for all the segments that make up Polygon A.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.