In my ArcObjects program, I need to check where a polygon feature (named f_A here) is included / overlapped with another polygon feature (named f_B hear). Is there an ArcObjects method for the this check-up? Thanks.
How to Execute Spatial Queries—ArcObjects 10.4 Help for Java | ArcGIS for Desktop . The article is for Java, but the concepts translate to .NET.
It's an IGeometry5 object
Ken: Thanks for your code. Could you tell me what is the data type of pOverlapGeometry since I need to convert your VB into c#. Thanks.<BR />
pOverlapGeometry since I need to convert your VB into c#. Thanks.<BR />
Here's how I determine if a polygon overlaps another polygon
pTopoOp <SPAN class="operator token">=</SPAN> pFeature<SPAN class="punctuation token">.</SPAN>Shape Dim pInGeometry As ESRI<SPAN class="punctuation token">.</SPAN>ArcGIS<SPAN class="punctuation token">.</SPAN>Geometry<SPAN class="punctuation token">.</SPAN>IGeometry5 pInGeometry <SPAN class="operator token">=</SPAN> pOtherFeature<SPAN class="punctuation token">.</SPAN>Shape If pInGeometry<SPAN class="punctuation token">.</SPAN>Dimension <SPAN class="operator token">=</SPAN> ESRI<SPAN class="punctuation token">.</SPAN>ArcGIS<SPAN class="punctuation token">.</SPAN>Geometry<SPAN class="punctuation token">.</SPAN>esriGeometryDimension<SPAN class="punctuation token">.</SPAN>esriGeometry2Dimension Then 'check <SPAN class="keyword token">if</SPAN> the feature <SPAN class="keyword token">is</SPAN> a polygon pOverlapGeometry <SPAN class="operator token">=</SPAN> pTopoOp<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Intersect</SPAN><SPAN class="punctuation token">(</SPAN>pInGeometry<SPAN class="punctuation token">,</SPAN> ESRI<SPAN class="punctuation token">.</SPAN>ArcGIS<SPAN class="punctuation token">.</SPAN>Geometry<SPAN class="punctuation token">.</SPAN>esriGeometryDimension<SPAN class="punctuation token">.</SPAN>esriGeometry2Dimension<SPAN class="punctuation token">)</SPAN> If Not pOverlapGeometry Is Nothing And Not pOverlapGeometry<SPAN class="punctuation token">.</SPAN>IsEmpty Then <SPAN class="string token">'you'</SPAN>ve got an overlapping polygon End If End If<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Thanks a lot.
Hi Shaning,
This would be really easy with arcpy, but from what I can tell this article might help you out with how to use the Intersect tool with ArcObjects geoprocessing:
https://www.esri.com/news/arcuser/1207/files/gp_arcobjects.pdf
Or, the ITopologicalOperator.Intersect method could be used to determine if there is overlap.
Good luck!
Micah
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.