Skip to content

AWS Lambda function (deployed by serverless) to check the district in Hong Kong for a given GPS coordinate

License

Notifications You must be signed in to change notification settings

ocinpp/aws-hk-district-check

Repository files navigation

HK District Check (AWS Lambda)

FOSSA Status

AWS Lambda function (deployed by serverless) to check the district in Hong Kong of a given GPS coordinate

Usage

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)

Requirement

Pytohn Libraries

  • pandas
  • matplotlib

Setup and Deployment

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

Example

22.301590, 114.174826 => Yau Tsim Mong

Remarks

Reference

Handle Lambda Errors in API Gateway

How to Handle your Python packaging in Lambda with Serverless plugins

License

FOSSA Status

About

AWS Lambda function (deployed by serverless) to check the district in Hong Kong for a given GPS coordinate

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages