Retrieves population density information in a specified area
client.populationdensitydata.retrieve(PopulationdensitydataRetrieveParams { area, endTime, startTime, 4 more } params, RequestOptionsoptions?): PopulationdensitydataRetrieveResponse { status, timedPopulationDensityData, statusInfo }
POST/populationdensitydata/retrieve
Retrieves population density estimation together with the estimation range related for a time slot for a given area (described as a polygon) as a data set consisting of a sequence of equally-sized objects covering the input polygon area.
Retrieves population density information in a specified area
import Camara from 'camara-sdk';
const client = new Camara({
bearerToken: process.env['CAMARA_BEARER_TOKEN'], // This is the default and can be omitted
});
const populationdensitydata = await client.populationdensitydata.retrieve({
area: { areaType: 'POLYGON' },
endTime: '2024-04-23T14:44:18.165Z',
startTime: '2024-04-23T14:44:18.165Z',
precision: 7,
});
console.log(populationdensitydata.status);{
"status": "SUPPORTED_AREA",
"timedPopulationDensityData": [
{
"startTime": "2024-01-03T10:00:00Z",
"endTime": "2024-01-03T11:00:00Z",
"cellPopulationDensityData": [
{
"geohash": "ezdqemf",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 150,
"minPplDensity": 30,
"pplDensity": 60
},
{
"geohash": "ezdqemg",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 100,
"minPplDensity": 40,
"pplDensity": 90
},
{
"geohash": "ezdqemu",
"dataType": "LOW_DENSITY"
}
]
},
{
"startTime": "2024-01-03T11:00:00Z",
"endTime": "2024-01-03T12:00:00Z",
"cellPopulationDensityData": [
{
"geohash": "ezdqemf",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 100,
"minPplDensity": 30,
"pplDensity": 70
},
{
"geohash": "ezdqemg",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 200,
"minPplDensity": 40,
"pplDensity": 100
},
{
"geohash": "ezdqemu",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 200,
"minPplDensity": 40,
"pplDensity": 100
}
]
}
]
}{
"status": "AREA_NOT_SUPPORTED",
"timedPopulationDensityData": []
}{
"status": "PART_OF_AREA_NOT_SUPPORTED",
"timedPopulationDensityData": [
{
"startTime": "2024-01-03T10:00:00Z",
"endTime": "2024-01-03T11:00:00Z",
"cellPopulationDensityData": [
{
"geohash": "ezdqemf",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 150,
"minPplDensity": 30,
"pplDensity": 60
},
{
"geohash": "ezdqemg",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 100,
"minPplDensity": 40,
"pplDensity": 90
},
{
"geohash": "ezdqemu",
"dataType": "NO_DATA"
}
]
},
{
"startTime": "2024-01-03T11:00:00Z",
"endTime": "2024-01-03T12:00:00Z",
"cellPopulationDensityData": [
{
"geohash": "ezdqemf",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 100,
"minPplDensity": 30,
"pplDensity": 70
},
{
"geohash": "ezdqemg",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 200,
"minPplDensity": 40,
"pplDensity": 100
},
{
"geohash": "ezdqemu",
"dataType": "NO_DATA"
}
]
}
]
}{
"status": 400,
"code": "INVALID_ARGUMENT",
"message": "Invalid input"
}{
"status": 400,
"code": "INVALID_CREDENTIAL",
"message": "Only Access token is supported"
}{
"status": 400,
"code": "INVALID_TOKEN",
"message": "Only bearer token is supported"
}{
"status": 400,
"code": "INVALID_SINK",
"message": "sink not valid for the specified protocol"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.INVALID_AREA",
"message": "The area is not a polygon shape or has an arbitrary complexity"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.MAX_STARTTIME_EXCEEDED",
"message": "Indicated startTime is greater than the maximum allowed"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.MIN_STARTTIME_EXCEEDED",
"message": "Indicated startTime is earlier than the minimum allowed"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.INVALID_END_TIME",
"message": "Indicated endDate is earlier than the startTime"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.MAX_TIME_PERIOD_EXCEEDED",
"message": "Indicated time period is greater than the maximum allowed (More than maximum hours between startTime and endTime)"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.INVALID_TIME_PERIOD",
"message": "Indicated time period is partially in the past and partially in the future"
}{
"status": 401,
"code": "UNAUTHENTICATED",
"message": "Request not authenticated due to missing, invalid, or expired credentials."
}{
"status": 403,
"code": "PERMISSION_DENIED",
"message": "Client does not have sufficient permissions to perform this action."
}{
"status": 404,
"code": "NOT_FOUND",
"message": "The specified resource is not found."
}{
"status": 422,
"code": "POPULATION_DENSITY_DATA.UNSUPPORTED_REQUEST",
"message": "Indicated combination of area, time interval and precision is too big for both synchronous and asynchronous processing"
}{
"status": 422,
"code": "POPULATION_DENSITY_DATA.UNSUPPORTED_PRECISION",
"message": "Indicated cell precision (Geohash length) is not supported"
}{
"status": 422,
"code": "POPULATION_DENSITY_DATA.UNSUPPORTED_SYNC_RESPONSE",
"message": "Indicated combination of area, time interval and precision is too big for synchronous processing and asynchronous processing is not enabled"
}{
"status": 429,
"code": "QUOTA_EXCEEDED",
"message": "Out of resource quota."
}{
"status": 429,
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit reached."
}Returns Examples
{
"status": "SUPPORTED_AREA",
"timedPopulationDensityData": [
{
"startTime": "2024-01-03T10:00:00Z",
"endTime": "2024-01-03T11:00:00Z",
"cellPopulationDensityData": [
{
"geohash": "ezdqemf",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 150,
"minPplDensity": 30,
"pplDensity": 60
},
{
"geohash": "ezdqemg",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 100,
"minPplDensity": 40,
"pplDensity": 90
},
{
"geohash": "ezdqemu",
"dataType": "LOW_DENSITY"
}
]
},
{
"startTime": "2024-01-03T11:00:00Z",
"endTime": "2024-01-03T12:00:00Z",
"cellPopulationDensityData": [
{
"geohash": "ezdqemf",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 100,
"minPplDensity": 30,
"pplDensity": 70
},
{
"geohash": "ezdqemg",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 200,
"minPplDensity": 40,
"pplDensity": 100
},
{
"geohash": "ezdqemu",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 200,
"minPplDensity": 40,
"pplDensity": 100
}
]
}
]
}{
"status": "AREA_NOT_SUPPORTED",
"timedPopulationDensityData": []
}{
"status": "PART_OF_AREA_NOT_SUPPORTED",
"timedPopulationDensityData": [
{
"startTime": "2024-01-03T10:00:00Z",
"endTime": "2024-01-03T11:00:00Z",
"cellPopulationDensityData": [
{
"geohash": "ezdqemf",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 150,
"minPplDensity": 30,
"pplDensity": 60
},
{
"geohash": "ezdqemg",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 100,
"minPplDensity": 40,
"pplDensity": 90
},
{
"geohash": "ezdqemu",
"dataType": "NO_DATA"
}
]
},
{
"startTime": "2024-01-03T11:00:00Z",
"endTime": "2024-01-03T12:00:00Z",
"cellPopulationDensityData": [
{
"geohash": "ezdqemf",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 100,
"minPplDensity": 30,
"pplDensity": 70
},
{
"geohash": "ezdqemg",
"dataType": "DENSITY_ESTIMATION",
"maxPplDensity": 200,
"minPplDensity": 40,
"pplDensity": 100
},
{
"geohash": "ezdqemu",
"dataType": "NO_DATA"
}
]
}
]
}{
"status": 400,
"code": "INVALID_ARGUMENT",
"message": "Invalid input"
}{
"status": 400,
"code": "INVALID_CREDENTIAL",
"message": "Only Access token is supported"
}{
"status": 400,
"code": "INVALID_TOKEN",
"message": "Only bearer token is supported"
}{
"status": 400,
"code": "INVALID_SINK",
"message": "sink not valid for the specified protocol"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.INVALID_AREA",
"message": "The area is not a polygon shape or has an arbitrary complexity"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.MAX_STARTTIME_EXCEEDED",
"message": "Indicated startTime is greater than the maximum allowed"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.MIN_STARTTIME_EXCEEDED",
"message": "Indicated startTime is earlier than the minimum allowed"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.INVALID_END_TIME",
"message": "Indicated endDate is earlier than the startTime"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.MAX_TIME_PERIOD_EXCEEDED",
"message": "Indicated time period is greater than the maximum allowed (More than maximum hours between startTime and endTime)"
}{
"status": 400,
"code": "POPULATION_DENSITY_DATA.INVALID_TIME_PERIOD",
"message": "Indicated time period is partially in the past and partially in the future"
}{
"status": 401,
"code": "UNAUTHENTICATED",
"message": "Request not authenticated due to missing, invalid, or expired credentials."
}{
"status": 403,
"code": "PERMISSION_DENIED",
"message": "Client does not have sufficient permissions to perform this action."
}{
"status": 404,
"code": "NOT_FOUND",
"message": "The specified resource is not found."
}{
"status": 422,
"code": "POPULATION_DENSITY_DATA.UNSUPPORTED_REQUEST",
"message": "Indicated combination of area, time interval and precision is too big for both synchronous and asynchronous processing"
}{
"status": 422,
"code": "POPULATION_DENSITY_DATA.UNSUPPORTED_PRECISION",
"message": "Indicated cell precision (Geohash length) is not supported"
}{
"status": 422,
"code": "POPULATION_DENSITY_DATA.UNSUPPORTED_SYNC_RESPONSE",
"message": "Indicated combination of area, time interval and precision is too big for synchronous processing and asynchronous processing is not enabled"
}{
"status": 429,
"code": "QUOTA_EXCEEDED",
"message": "Out of resource quota."
}{
"status": 429,
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit reached."
}