livingcount

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

Return the number of inhabitants estimated on an input zone.

2 isochronic zones with the count of living poeple

The zone to use as input could be a Geojson or a set of parameters necessary to compute an isochronic zone.

This service uses the INSEE 2015 census and the area of building implentation from gouv.fr to estimate the amount if living persons of a given area.

Parameters

You can either provide a polygonal zone, or request our system to compute an isochronic zone around a given point.

Option 1 : Provide a tailor made zone

Parameter Type Usage
zone geojson Zone that will be used to compute the inhabitants. Must be a Polygon

Option 2 : Request on an isochronic zone

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)
travel text Type of travelling method used to compute the distance coverable in a given time. This also define the type of roads that can be used (e.g. pedestrians area or motorways)
pedestrian : The API will return an isochronic zone based on pedestrians allowed roads and speed (about 5 km/h)
motorized : The API will return an isochronic zone based on car allowed roads and speed (depending on the speed limits)
time integer (from 60) The travel time in seconds. Should be 60 at minimum.

Returns : JSON Object

{
    "success" : true,
    "error" : "Reason if it failed",
    "livingcount" : 65325,
    "isochrone" : {
        "type" : "Feature",
        "properties" : {},
        "geometry" : {
            "type" : "Polygon",
            "coordinates" : [[[3.0511466417239124, 50.63056111992749], [3.050587187616239, 50.63005943227943], [3.050529375166367, 50.62999501010041], [3.0504924811160374, 50.62992467273477], [3.050477922378514, 50.62985112174587], [3.050448933681868, 50.62916412334786], [3.050456493137037, 50.62909312757666], [3.0507271173786825, 50.628040324855164], [3.0508759801641827, 50.62700521010206], [3.050885786707995, 50.62625984622555], [3.050897517709507, 50.62618827595896], [3.050930401940678, 50.62611941015503], [3.051104404442154, 50.62585041199085], [3.0511567870197176, 50.62578719274596], [3.0512269689212217, 50.6257313472778], [3.051312447784338, 50.62568486673023], [3.0514101758730052, 50.62564940834373], [3.0515166687390987, 50.62562623637196], [3.0516281294491425, 50.62561617700843], [3.051740583949189, 50.62561958893026], [3.053125726874404, 50.62574550909217], [3.0543306131375587, 50.62559624450392], [3.055347616729888, 50.62506173459661], [3.055421361914324, 50.62502861515518], [3.055513361140973, 50.624993615446655], [3.0555195682771457, 50.62499128629238], [3.0556449512038224, 50.624944884723945], [3.055928338751929, 50.62483849007526], [3.0560275403531207, 50.62480869303461], [3.056679533689231, 50.62465769391698], [3.0568001334038435, 50.62463851758558], [3.058098119455144, 50.624521516906896], [3.058232352455731, 50.624519106152896], [3.058364031375874, 50.624535814237916], [3.0584864765875, 50.62457079365738], [3.059598473245737, 50.624989788083234], [3.0597011848999256, 50.62503869312988], [3.0609216648867092, 50.62576251482507], [3.061561919321452, 50.626076158621714], [3.063344998354739, 50.62646088784433], [3.0634511985422916, 50.62649144161213], [3.063545993912668, 50.62653452341928], [3.0636257588490845, 50.62658848557788], [3.0636874425479563, 50.626651264254534], [3.0637286857090427, 50.62672045839808], [3.06412470128824, 50.6276514575774], [3.0641440106209723, 50.62772521707388], [3.064140071654751, 50.62779994500301], [3.0638420925191436, 50.62921895104726], [3.0638200884407905, 50.629281993994816], [3.063781501867422, 50.62934174452346], [3.0632221755085407, 50.63003290507166], [3.063020063052037, 50.631319968985714], [3.0629687981272276, 50.632069400592826], [3.0629521369259645, 50.632143251121754], [3.062912949239599, 50.632213591287496], [3.062852759235722, 50.63227768507168], [3.0627739080436847, 50.632333039409964], [3.06267946269898, 50.63237750117185], [3.0613924518711317, 50.63286650524316], [3.0613075454344707, 50.632893197835415], [3.0612170450069325, 50.63291102280578], [3.059040021675158, 50.633222023202535], [3.0590164766303194, 50.633225071640396], [3.0572054821998798, 50.63343551219108], [3.0552291216631597, 50.6337639136456], [3.055101495152906, 50.63377596620622], [3.054972768812963, 50.63377032438915], [3.0548489690341403, 50.63374725235081], [3.05473589152794, 50.63370783025297], [3.0543015705131387, 50.63351489302621], [3.0520745727779652, 50.633022144969715], [3.0519469767656946, 50.632982545766154], [3.051851976563799, 50.632943545276255], [3.0517590192595536, 50.632896411200726], [3.0516826689181267, 50.63283850780439], [3.0516259661921343, 50.63277214118786], [3.0515911692040785, 50.632699954489574], [3.051579663632439, 50.63262482261525], [3.0515872232516292, 50.63108416601899], [3.0511466417239124, 50.63056111992749]]]
        }
    }
}
Value Type Usage
success boolean True if the call was succesfull
livingcount integer The number of inhabitants estimated
isochrone geojson A Geojson Feature object containing a Polygon or Multipolygon describing the isochbronic zone that were computed (Option 2 only)

Usage / Example

With basic auth :

# returns the number of inhabitants at a 7 minutes walking distance from a point
curl --user 'APIKEY:APISECRET' --basic  "https://tern.retail.roofstreet.io/api/v1/livingcount?lon=3.057256&lat=50.62925&travel=pedestrian&time=420"

Auth in URL :

# returns the number of inhabitants at a 7 minutes walking distance from a point
curl "https://tern.retail.roofstreet.io/api/v1/livingcount?lon=3.057256&lat=50.62925&travel=pedestrian&time=420&apikey=APIKEY&apisecret=APISECRET"

Self provided geojson :

# returns the number of inhabitants of a giving zone
curl -g  'https://tern.retail.roofstreet.io/api/v1/livingcount?apikey=APIKEY&apisecret=APISECRET&zone={"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[2.3546065957411897,48.87278048205041],[2.3546188093369156,48.87279498282275],[2.354635286948723,48.87280752660858],[2.3546065957411897,48.87278048205041]]]}}'

Performance

A first call to that service (first time with specific parameters) could take up to few seconds.

Subsequent calls with same parameters will take about 300 ms.

External data sources

https://www.data.gouv.fr/fr/datasets/cadastre-parcelles-cadastrales/

https://www.insee.fr/fr/information/3561862