I have one point type feature class and another feature class with a polygon. Using ArcGIS Pro, in the feature class type point > Definition Query > create new definition query in SQL. I want as a result the points that are inside that polygon. Only SQL code will be used.
-
1Welcome to GIS SE. As a new user, please tale the Tour. Your Question is not particularly clear. You can only have a spatial constraint in an RDBMS which supports spatial operators (not shapefile or file geodatabase), but if the geographic boundary is encoded in a attribute, the SQL would be very basic.– VinceJan 19 at 16:43
2 Answers
Definition queries work with attributes so your points need to be attributed with the polygon ID. You achieve that by using the Spatial Join tool then you can apply the definition query.
But if what you want is a "quick a dirt technique" for hiding all points outside your polygon then visually you can use the clipping properties of the Map.
Before:
Setting up visual clipping:
Results:
Be aware such data is just being visually clipped so if you do any geoprocessing then all points would be included.
With Field Calculator you can set a specific attribute using Select by Location between the polygon and the point.
Then set your DQuery using this new attribute.
If you don't want to make set a new attribute, you can right click on the layer with the selected points > selection > create new layer w/ selected features.
Visual Clipping is also a good option.