Hi, GIS ignorant here, so I may not be using the correct terms (but hoping to change that).
I have a lat/long point that I geocoded using the REST API. How do I check to see if this point exists within the boundary of a map layer using the REST API?
For example, I would like to check if any point x, y is located on this map of a Town's jurisdictional limits: CorporateData/JurisdictionalLimits (MapServer)
Could I use a query? If so, what would I query? I simply need a true/false for whether it exists within the boundaries of the map.
Solved! Go to Solution.
Daniel,
This would work:
https://gisweb.townofchapelhill.org/arcgis/rest/services/CorporateData/JurisdictionalLimits/MapServer/0/query?geometry=geometry%3D-104%2C35.6&geometryType=esriGeometryPoint&spatialRel=esriSpatialRelIntersects&returnGeometry=false&outSR=102100&returnIdsOnly=false&returnCountOnly=true&f=json
Daniel,
This would work:
https://gisweb.townofchapelhill.org/arcgis/rest/services/CorporateData/JurisdictionalLimits/MapServer/0/query?geometry=geometry%3D-104%2C35.6&geometryType=esriGeometryPoint&spatialRel=esriSpatialRelIntersects&returnGeometry=false&outSR=102100&returnIdsOnly=false&returnCountOnly=true&f=json
Thanks Robert! In that example, after what param should I put the x, y coordinates?
When I try a known lat, long within the boundary, it returns a 0 count:
https://gisweb.townofchapelhill.org/arcgis/rest/services/CorporateData/JurisdictionalLimits/MapServe...
Daniel,
You have your lat,lon switched. Try this:
I guess that's what I get for copying and pasting from Google Maps! Thank you Robert. This is immensely helpful.
Daniel,
Google uses lat, lon(y,x) and esri expects x,y.