ArcGIS Pro空间查询
using (Geodatabase geodatabase = new Geodatabase(connectionProperties)) using (FeatureClass schoolBoundaryFeatureClass = geodatabase.OpenDataset<FeatureClass>("LocalGovernment.GDB.SchoolBoundary")) { // Using a spatial query filter to find all features which have a certain district name and lying within a given Polygon. SpatialQueryFilter spatialQueryFilter = new SpatialQueryFilter { WhereClause = "DISTRCTNAME = 'Indian Prairie School District 204'", FilterGeometry = new PolygonBuilder(new List<Coordinate2D> { new Coordinate2D(1021880, 1867396), new Coordinate2D(1028223, 1870705), new Coordinate2D(1031165, 1866844), new Coordinate2D(1025373, 1860501), new Coordinate2D(1021788, 1863810) }).ToGeometry(), SpatialRelationship = SpatialRelationship.Within }; using (RowCursor indianPrairieCursor = schoolBoundaryFeatureClass.Search(spatialQueryFilter, false)) { while (indianPrairieCursor.MoveNext()) { using (Feature feature = (Feature)indianPrairieCursor.Current) { // Process the feature. Console.WriteLine(feature.GetObjectID()); } } } }