flowquality

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

Based on a given place, it returns

  • A quantitative indicator (from 0 to 5) for measured flow at the zone
  • The distribution of the flow intraday (base 100)
  • The distribution of the flow intraweek (base 100)
  • The distribution of the flow within Socio-professional categories

The place could be given either

  • in lat/lon coordinates : in that case the quality is computed as the best pedestrian rank detected at 150 meters arround the coordinates

or

  • in gid reference : in that case the quality is computed at the Hexagon given precision 50 meters

if both lat/lon and gid are given, only gid will be used.

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)
gid bigint GID given by a call to neighboursgrid
flowtype text Type of flow to measure (default = "pedestrian")
Roofstreet flow quality pedestrian : The API will return a 0 to 5 indicator depending on the amount of pedestrians
Roofstreet flow quality motorized : The API will return a 0 to 5 indicator depending on the amount of motorized individual

if both lat/lon and gid are given, only gid will be used.

Returns : JSON Object

{
    "success" : true|false,
    "error" : "error message",
    "flowquality" : {
        "gid" : 304012934,
        "indicator" : 3,
        "intraday" : {
            "8-10" : 13,
            "10-12" : 20,
            "12-14" : 25,
            "14-16" : 16,
            "16-18" : 14,
            "18-20" : 12            
        },
        "intraweek" : {
            "1" : 4,
            "2" : 19,
            "3" : 19,
            "4" : 18,
            "5" : 17,
            "6" : 16,
            "7" : 7
        },
        "category" : {
            "1_farmer":0,
            "2_business_owner":5,
            "3_manager":39,
            "4_intermediate":16,
            "5_employee":11,
            "6_worker":5,
            "7_retired":11,
            "8_no_activity":13
        }
    }
}
Value Type Usage
success boolean True if the call was succesfull
error string If success is false, the reason of the failure
flowquality object
flowquality.gid integer the Grid identifier (GID) that identifies the hexagonal area that were choosen. It could be either the GID given on your call, or a GID found near the lat/lon positions + 200 meters (the most crowded hexagonal area at this distance is returned)
flowquality.indicator integer If parameter flowtype is pedestrian: Indicator (0 to 5) depending on the amount of pedestrians.Roofstreet flow quality
If parameter flowtype is motorized: Indicator (0 to 5) depending on the amount of motorized individuals.Roofstreet flow quality
flowquality.intraday object a set of key-value pair where the key represent the 2 hours time slot, and the value is a 100 based distribution indicator. Roofstreet flow quality
flowquality.intraweek object a set of key-value pair where the key represent the day number (sunday is "1", monday is "2", ...) and the value is a 100 based distribution indicator.Roofstreet flow quality
flowquality.category object a set of key-value pair where the key represent the category of individuals in INSEE standards. The value is a 100 based distribution indicator.

Usage / Example

With basic auth :

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

Auth in URL :

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

Performance

At the first call to coordinates, the system must wake-up a lot of data. So the first call to that API will take up to 11 seconds depending on the traffic.

Subsequent calls to the same site will take less than 300 ms