Proximity search

Geofencing search, real proximity using routing and traffic info.

Web Services

Proximity search API documentation,

URL base service:

  • HTTP requests in GET or POST
  • Response in JSON / XML format

Get the N nearest points

Request

Example:

https://lb.cercalia.com/services/json?cmd=prox&mo=42.369140,-3.489919|CENTER&mocs=gdd&rqmolist=%5b40.369140,-3.589919|A%5d,%5b40.367223,-3.583056|B%5d&num=2&key=YOUR_API_KEY

Where:

ParameterDescription
moSearch center, format: lat, lon
mocsgdd Coordinate system (gdd = geographical - lat, long)
rqmolistList of points (coordinates) to be ordered by proximity, in format `[lat1,lon1
rpoicats(Alternative to rqmolist) List of POIs categories (separated by commas) to be searched, ordered by proximity
numMaximum number of points to return (optional)
radMaximum radius, in meters (optional)

Response

{
    "cercalia": {
        "cmd": "prox",
        "version": "1",
        "proximity": {
            "center": "-3.48991895,42.369141",
            "num": "2",
            "type": "mo",
            "molist": {
                "num": "2",
                "mo": [
                    {
                        "dist": "222546",
                        "id": "A",
                        "pos": "1",
                        "coord": {
                            "x": "-3.5899194",
                            "y": "40.36914023"
                        }
                    },
                    {
                        "dist": "222739",
                        "id": "B",
                        "pos": "2",
                        "coord": {
                            "x": "-3.58305627",
                            "y": "40.36722322"
                        }
                    }
                ]
            }
        },
        "server": {
            "$valor": "lb.cercalia.com"
        },
        "instance": {
            "$valor": "http://cercalia-lbs-both-lines"
        }
    }
}

Where:

ParameterDescription
distProjected straight-line distance, in meters
posProximity order (from closest to least)

Get the N nearest points, using routing

Request

Example:

https://lb.cercalia.com/services/json?cmd=prox&mo=42.369140,-3.489919|CENTRO&mocs=gdd&rqmolist=%5b40.369140,-3.589919|A%5d,%5b40.367223,-3.583056|B%5d&weight=time&num=2&key=YOUR_API_KEY

Where:

ParameterDescription
moSearch center, format: lat, lon
mocsgdd Coordinate system (gdd = geographical - lat, long)
rqmolistList of points (coordinates) to be ordered by proximity, in format `[lat1,lon1
numMaximum number of points to return (optional)
radMaximum radius, in meters (optional)
weightRoute type:
time: faster
distance: shortest
money: faster, avoiding tolls
realtime: quickest, considering real-time traffic data
iweightrealtime: Complementary to &weight=. Use this parameter to obtain the route time, based on the current traffic state, keeping the route path.
inverseIf
0: Route times are from the center to the point list
1: Route times are from the list of points to the center

Routing based on departure time:

ParameterDescription
weightRoute type:
sptime: quickest, based on departure time
spmoney: quickest, based on departure time and avoiding toll roads
departuretimeDeparture date and time, in ISO 8601 format. Example: 2019-10-16T07:30:12Z (UTC time). Mandatory to include the &weight= parameter.

Response

{
    "cercalia": {
        "cmd": "prox",
        "version": "1",
        "proximity": {
            "center": "-3.48991895,42.369141",
            "inverse": "0",
            "num": "2",
            "type": "mo",
            "weight": "time",
            "molist": {
                "num": "2",
                "mo": [
                    {
                        "dist": "222739",
                        "id": "B",
                        "pos": "1",
                        "routedist": "267696",
                        "routerealtime": "8705039",
                        "routetime": "8705039",
                        "routeweight": "8705039",
                        "coord": {
                            "x": "-3.58305627",
                            "y": "40.36722322"
                        }
                    },
                    {
                        "dist": "222546",
                        "id": "A",
                        "pos": "2",
                        "routedist": "267294",
                        "routerealtime": "8725122",
                        "routetime": "8725122",
                        "routeweight": "8725122",
                        "coord": {
                            "x": "-3.5899194",
                            "y": "40.36914023"
                        }
                    }
                ]
            }
        },
        "server": {
            "$valor": "lb.cercalia.com"
        },
        "instance": {
            "$valor": "http://cercalia-lbs-both-lines"
        }
    }
}

Where:

ParameterDescription
distProjected straight-line distance, in meters.
routedistRoute distance, in meters.
routetimeRoute time, in milliseconds.

Get the buffer of one or more polylines / polygons, in WKT format

Request

Call parameters:

https://lb.cercalia.com/services/xmlgeo?cmd=buffergeoms
ParameterDescription
geomsList of geometries separated by commas. Each geometry has the following format: `[wkt
srsCoordinates system. Default: geographical coordinates (EPSG:4326).
bufferBuffer, in meters.
toleranceOptional. Geometry simplification, in meters (default: 0 meters).

Response

Example:

<cercalia cmd="buffergeoms" version="1">
   <buffergeoms>
      <geometry id="1"> POLYGON((-3.708452 40.411246, -3.708434 40.411191, -3.706925 40.411582, -3.705362 40.412022, -3.708362 40.411294, -3.708452 40.411246))</geometry >
      <geometry id="2"> POLYGON((-3.708452 40.411246, -3.708434 40.411191, -3.706925 40.411582, -3.705362 40.412022, -3.708362 40.411294, -3.708452 40.411246))</geometry>
   </buffergeoms>
</cercalia>

Geofencing: Get the points that are within one or more geometries

Request

Call parameters:

ParameterDescription
geomsList of geometries separated by commas. Each geometry has the following format: `[wkt
srsCoordinates system. Default: geographical coordinates (EPSG:4326).
molistList of points, in MO format `[x,y
mocsCoordinates system (MOLIST). Default: EPSG:4326.

Response

Fer each geometry returns the list of points located insinde.

Request example:

https://lb.cercalia.com/services/xmlgeo?cmd=insidegeoms&geoms=[CIRCLE(2.2090 41.4141, 12)|ID1],[CIRCLE(2.3090 41.4141, 5)|ID2]&srs=epsg:4326&molist=[2.2090,41.4141|P1],[2.3090,41.4141|P2]&mocs=gdd

Response

<cercalia cmd="insidegeoms" version="1">
   <insidegeoms>
      <geometry id=”ID1”>
         <wkt> CIRCLE(2.2090 41.4141, 12)</wkt>
         <molist num=”1”>
            <mo id=”P1”>
               <coord x=”2.2090” y=”41.4141”>
            </mo>
         </molist>
      </geometry>
      <geometry id=”ID2”>
         <wkt> CIRCLE(2.3090 41.4141, 5)</wkt>
         <molist num=”1”>
            <mo id=”P2”>
               <coord x=”2.3090” y=”41.4141”>
            </mo>
         </molist>
      </geometry>
   </insidegeoms>
</cercalia>
Last modified December 31, 2024: fix: response json geocoding (8b989c0)