Skip to content

kamicut/osmforcities

 
 

Repository files navigation

OSM for Cities

A platform for distributing OpenStreetMap data presets for cities.

Requirements

Getting started

Init .env file

Copy .env.example to .env. The example file contains some of the environment variables that can be set to configure the platform.

Start the git server

docker-compose up

This command will start a Gitea server and mount data volumes to the directory ./app-data on your local filesystem.

Setup Gitea

  1. Access the server at http://localhost:3000, create an user name runner that will be used for updating the git repositories. Save its password on your password manager as it won't be possible to reset it on a development environment.

  2. Generate an access token with write:org and delete_repo scope.

  3. Copy token to GITEA_ACCESS_TOKEN environment variable in .env file

Setup command line runner

Activate required Node version, if nvm is installed:

nvm install

Install Node modules:

yarn

Initialize history file:

yarn cli init-history

This command will download the full planet history and perform a geographic extract for the area covered by osmforcities defined in config/coverage.poly.

Initialize remote git repository:

yarn cli context cities-of-brazil setup

Generate data

The following command will apply all the daily diff files available at Planet OSM. This is necessary because the full history file is always outdated by some days.

yarn cli update-history --recursive

At this point you should have the full history available locally for processing. Now run the following to extract and publish data to the git repository:

yarn cli context cities-of-brazil update --recursive

License

MIT

Build docker image

To create the Docker images and publish them to the Docker registry, we will utilize Charpress.

pip install chartpress
docker login
chartpress --push

Copy the docker images tag version into your config osm-for-cities/values.yaml file.

Install application charts

Once you have access to your kubernetes cluster, you can install Gitea and Runner applications using helm. Make sure that you have the correct configuration in osm-for-cities/values.develop.yaml or osm-for-cities/values.production.yaml file.

Helm install Staging

# namespace for staging will be default
# Install
helm install staging ./osm-for-cities -f ./osm-for-cities/values.staging.yaml
# Upgrade
helm upgrade staging ./osm-for-cities -f ./osm-for-cities/values.staging.yaml
# Delete
helm delete staging

Helm install production

kubectl create namespace production
# Install
helm install prod ./osm-for-cities -f ./osm-for-cities/values.production.yaml  --namespace production
# Upgrade
helm upgrade prod ./osm-for-cities -f ./osm-for-cities/values.production.yaml  --namespace production
# Delete
helm delete prod -n production

Packages

No packages published

Languages

  • TypeScript 50.4%
  • JavaScript 45.8%
  • Smarty 1.8%
  • Other 2.0%