Hello everyone,
How can I find all points and lines that intersect or are included in a polygon?
I am writing a console application to list pipes and points with a specific criteria inside a polygon.
Thanks
ISpatialFilter Example
How do I populate or initialize the envelope with the shape of the current polygon I am selecting.
The goal is to select a polygon and list all points and lines.
// Create the envelope and define its position.
IEnvelope envelope = new EnvelopeClass();
envelope.PutCoords(-84.4078, 33.7787, -84.3856, 33.7997);
How to execute spatial queries
Get the feature and its geometry given an ObjectID.
Dim stateFeature As IFeature = stateFeatureClass.GetFeature(14)
Dim queryGeometry As IGeometry = stateFeature.Shape
' Create the spatial filter; "highwayFeatureClass" is the feature class containing
' the highway data. Set the SubFields property to "FULL_NAME" as only that field
' is shown.
Dim spatialFilter As ISpatialFilter = New SpatialFilterClass()
spatialFilter.Geometry = queryGeometry
spatialFilter.GeometryField = highwayFeatureClass.ShapeFieldName
spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects
spatialFilter.SubFields = "FULL_NAME"
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.