neighboursgrid

GET https://tern.retail.roofstreet.io/api/v1/neighboursgrid

Get the Hexagons (GID and Geom) of the Roofstreet standard grid closest to coordinates

Using the parameters, the service filters Hexagons that have interesting data for your use case.

The GID returned by this API may be used in other Tern APIs to identify a place.

Roofstreet standard grid

Parameters

Parameter Type Usage
lon float (-180 to 180) WSG84 Longitude (e.g. 2.4290276323522635 for Paris)
lat float (-90 to 90) WSG84 Latitude (e.g. 48.85225019822305 for Paris)
count integer (1 to 50) The number of Hexagons required (default : 1)
filter text Set of data that must be present to return the Hexagon (default : all)
all : Any Hexagon even without any statistic computed on it
pedestrian : Hexagons that includes an estimation of pedestrians for Flow Count Services
motorized : Hexagons that includes an estimation of motorized individuals for Flow Count Services

Returns : JSON Object

{
    "success" : true|false,
    "error" : "error message",
    "neighboursgrid" : [
        {
            "gid" : 123456789,
            "geom" : {
                "type" : "polygon",
                "coordinates" : [[[2.42892667076392,48.8524626348923],[2.42931565269225,48.8523144305581],[2.42931565269225,48.852018020566],[2.42892667076392,48.8518698149081],[2.4285376888356,48.852018020566],[2.4285376888356,48.8523144305581],[2.42892667076392,48.8524626348923]]]
            },
            "centroid" : {
                "type" : "point",
                "coordinates" : [2.42892667076392,48.8524626348923]
            }
        },
        ...
    ]
}
Value Type Usage
success boolean True if the call was succesfull
error string If success is false, the reason of the failure
neighboursgrid array set of Hexagons
neighboursgrid[].gid bigint Grid ID that can be used in TernAPI calls to identify a place
neighboursgrid[].geom geojson Geographical description of the Hexagon
neighboursgrid[].centroid geojson Geographical description of the center of the Hexagon

Usage / Example

With basic auth :

curl --user 'APIKEY:APISECRET' --basic  "https://tern.retail.roofstreet.io/api/v1/neighboursgrid?lon=2.4290276323522635&lat=48.85225019822305&count=7&filter=pedestrian"

Auth in URL :

curl "https://tern.retail.roofstreet.io/api/v1/neighboursgrid?lon=2.4290276323522635&lat=48.85225019822305&count=7&filter=pedestrian&apikey=APIKEY&apisecret=APISECRET"