API mocks
On this page
ArcGIS REST feature layers
A mock of the ArcGIS REST query API: the MapServer and FeatureServer layers that public GIS portals publish, such as cadastral parcels, house-number plates, zoning and socio-economic strata. You upload the layers, or load a synthetic Bogotá preset, and your app swaps only the portal's host for the mock's base URL. Testlie is not affiliated with Esri.
Connect
Create an ArcGIS REST feature layers system under No-code. A layer lives at its ArcGIS path below the base URL:
<base URL>/arcgis/rest/services/<folder>/<service>/MapServer/<layer> (or FeatureServer)
<base URL>/arcgis/rest/services/<folder>/<service>/MapServer/<layer>/querySo https://serviciosgis.catastrobogota.gov.co/arcgis/rest/services/catastro/lote/MapServer/0 becomes <base URL>/arcgis/rest/services/catastro/lote/MapServer/0. The base URL is HTTPS on Testlie, for clients that require it.
Reads need no token, as for public layers. Uploading layers needs Authorization: Bearer <layer management key> (ARCGIS_MOCK_API_KEY).
Load layers
POST /__testlie/presets/bogotaloads synthetic layers in the shape of Bogotá's public cadastral services, consistent with each other:catastro/placadomiciliaria/MapServer/0: house-number plates (PDONVIAL,PDOTEXTO,PDOCLOTE,PDOCODIGO). Five plates on each ofKR 7(cross street 45),CL 26(68),AK 68(13) andCL 93A(12), e.g.KR 745 10to45 42.catastro/lote/MapServer/0: the parcels the plates sit on (LOTCODIGO, 12 digits, the first six being the sector).catastro/sectorcatastral/MapServer/0: sector names (SCACODIGO,SCANOMBRE).ordenamientoterritorial/estratificacion/MapServer/1: estrato blocks (CODIGO_MANZANA,ESTRATO4, 3, 2 and 6,FECHA_ACTO_ADMINISTRATIVO,NORMATIVA): each street's block, plus one across the street to the north (same estrato) and one to the south (one lower), so an evidence map has neighbours. The block's description says "Fecha de actualización del dato: 2019-08-15".
The geometry and codes are invented: they are not real addresses.
POST /__testlie/layersuploads your own layer:{ path, name, description?, editedAt?, fields?, features: [{ attributes, geometry }] }.- Geometry is a point (
{ x, y }), a polygon ({ rings }) or a polyline ({ paths }), in WGS 84 longitude and latitude. - Fields are inferred from the attributes when not given.
- Every layer gets an
OBJECTIDfield. - A mock holds up to 20 layers of 5,000 features.
- Geometry is a point (
Query
GET or POST (form-encoded) <layer>/query takes:
| Parameter | Supported |
|---|---|
where |
1=1, =, <>, <, >, <=, >=, IN (…), NOT IN, LIKE with % and _, IS [NOT] NULL, NOT, AND, OR, parentheses. Field names are case-insensitive; an unknown field is an error. |
geometry, geometryType, inSR, spatialRel |
esriGeometryPoint ({ x, y, spatialReference } JSON or x,y) and esriGeometryEnvelope, with esriSpatialRelIntersects. A point finds the polygons containing it; distance (meters) buffers points against point layers. |
outFields |
* or a list |
returnGeometry |
true (default) or false |
outSR |
4326 only |
outStatistics |
count, min, max, sum, avg, with outStatisticFieldName |
returnCountOnly, orderByFields, resultOffset, resultRecordCount |
Up to 2,000 features per answer, with exceededTransferLimit when there are more |
GET <layer>?f=json returns the layer's metadata: name, description, geometryType, fields, extent, and editingInfo.dataLastEditDate. GET <service>/MapServer/tile/{z}/{y}/{x} returns a blank 256 px tile, so basemaps load.
Errors are ArcGIS's, with HTTP 200, e.g. { "error": { "code": 400, "message": "Failed to execute query.", "details": ["Invalid field: NOPE"] } }. The Outcome scenario "decline" makes every query fail that way, and the API failure scenarios answer 429 or 5xx.