Required C libraries: GDAL, GEOS
On Ubuntu: apt install g++ gcc libgdal-dev python3.6-dev
Requires: python 3.6
pip install -r requirements.txt
This script fetches administrative boundary definitions from EMUiA repository and converts it to OSM XML.
It is possible to fetch:
Because AWS API Gateway calls are limited to 60 seconds and the process may take more than 60 seconds, SNS queues are used to allow longer Lambda calls. Clients
package-rest.zip
+-------------------+ 2. Submit fetch task
| /<type>/<prg>.osm +-------------+
+-+-----------------+ |
| |
| 1. Check cache +------+-----+
| | Amazon SNS |
| 5. Fetch from cache +------+-----+
| |
| |
| +-------+-------------+ 3. Fetch +-----------+
| | package-fetcher.zip +------------+ Geoportal |
| +--+------------------+ data +-----------+
+-+--------+ 4. Put into |
| DynamoDB +-----------------+
+----------+ cache
amazon.rest_endpoint function at /<prg>.osm.queue_nameMessage schema:
{
"terc": "123331",
"type": "all",
"request_time": 1515263002
}
amazon.fetcher listens on Amazon SNS queue
get_<type>_borders. Results are put into DynamoDB table table_nameInstall docker:
apt install docker.io
Assuming you will have terraform in your path, amazon/ folder contains Terraform scripts to create AWS Lambda / DynamoDB deployment. To deploy on your Amazon environment:
export AWS_ACCESS_KEY_ID="YOUR_AWS_KEY_ID"
export AWS_SECRET_ACCESS_KEY="YOUR_AWS_ACCESS_KEY"
export AWS_DEFAULT_REGION="DEPLOYMENT_REGION"
$ cd amazon
$ terraform init
And then, to deploy:
$ ( cd .. && build_package.sh )
$ terraform apply
[...]
Outputs:
url = https://xxx.execute-api.eu-west-1.amazonaws.com/api
Where the last line presents URL of your deployment
Content type
Image
Digest
Size
210.2 MB
Last updated
over 6 years ago
docker pull wiktorn/osm-borders