AWS Lambda function (deployed by serverless) to check the district in Hong Kong of a given GPS coordinate
GPS coordinates (latitude, longitude) will be checked against the district boundaries defined using the data from https://data.gov.hk/en-data/dataset/hk-had-json1-hong-kong-administrative-boundaries
Please note that the data is in GML, with the format (longitude, latitude)
- pandas
- matplotlib
Clone the repository
Install the required npm packages
npm install
Setup AWS Credentials following the article https://serverless.com/framework/docs/providers/aws/guide/credentials/
Create a virtual environment (venv) for developing locally and to have the dependencie separated from other environments
virtualenv venv --python=python3
Generate the file requirements.txt in the virtual environment using the below command
pip freeze > requirements.txt
Deploy to AWS with the below command
serverless deploy
22.301590, 114.174826 => Yau Tsim Mong
Handle Lambda Errors in API Gateway
How to Handle your Python packaging in Lambda with Serverless plugins