This repository contains the implementation for the Geospatial Device Count API. The API provides the count of unique devices based on geospatial coordinates, leveraging the power of H3 geospatial indexing and AWS Lambda.
- Fetch count of unique devices for specific geospatial coordinates.
- Built using AWS Lambda for serverless execution.
- Utilizes H3 for geospatial indexing.
- Securely fetches database credentials using AWS Secrets Manager.
- AWS CLI
- AWS SAM CLI
- Python 3.8
- Navigate to the
propin-apidirectory of the project. - Build the SAM application:
sam build - Start the local API server:
sam local start-api
- Navigate to the
propin-api/testsdirectory. - Run the unit tests using pytest:
pytest unit/
- Navigate to the
propin-apidirectory. - Build the SAM application:
sam build - Deploy the SAM application:
sam deploy --guided
Follow the prompts in the deploy process to specify the stack name, AWS region, and any other parameters. Once deployed, the API Gateway URL will be displayed in the output.
- Method: GET
- Query Parameters:
latitude: Latitude of the location.longitude: Longitude of the location.
Example Request:
GET /location/device-query?latitude=4.62142480&longitude=-74.10983950
Example Response:
{
"statusCode": 200,
"headers": {
"Content-Type": "application/json"
},
"body": {
"level_6": 1234,
"level_9": 5678
}
}