Skip to main content
2 of 2
naming; removed thanks
Vince
  • 20.3k
  • 16
  • 48
  • 65

Wildcard SQL in ArcGIS REST API

I'm querying the ArcGIS REST API and I'm trying to write a request that includes a wildcard. The normal request (without wildcard) looks like this:

https://serviciosgis.catastrobogota.gov.co/arcgis/rest/services/ordenamientoterritorial/catastro/MapServer/6/query?f=json&where=ESOCLOTE=%22005611022010%22&spatialRel=esriSpatialRelIntersects&geometry={%22xmin%22:-8248284.5749014811590314,%22ymin%22:523903.3499047987861559,%22xmax%22:-8248034.5749014811590314,%22ymax%22:524153.3499047987861559,%22spatialReference%22:{%22wkid%22:102100,%22latestWkid%22:3857}}&outFields=*

This one works, and returns a valid json object with one feature. However, if I include a wildcard with virtually the same parameters it doesn't return anything. Here's the request with the wildcard:

https://serviciosgis.catastrobogota.gov.co/arcgis/rest/services/ordenamientoterritorial/catastro/MapServer/6/query?f=json&where=ESOCLOTE+like+%22005611022010%22&spatialRel=esriSpatialRelIntersects&geometry={%22xmin%22:-8248284.5749014811590314,%22ymin%22:523903.3499047987861559,%22xmax%22:-8248034.5749014811590314,%22ymax%22:524153.3499047987861559,%22spatialReference%22:{%22wkid%22:102100,%22latestWkid%22:3857}}&outFields=*

Am I writing the request correctly?

The first one says where=ESOCLOTE=%22005611022010%22 (this works) and the second one says where=ESOCLOTE+like+%22005611022010%22 (this doesn't work).

Any ideas?