This repository has been archived by the owner on Sep 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace bash scripts with workflow (#278)
And remove the docker configuration files as they are difficult to maintain and rarely used in practice.
- Loading branch information
Showing
35 changed files
with
772 additions
and
1,559 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,71 +5,42 @@ | |
OpenStreetMap Vecto is a general-purpose configuration for [Baremaps](https://github.com/baremaps/baremaps). | ||
It is used to generate vector tiles and to produce a Mapbox style inspired by [OpenStreetMap Carto](https://github.com/gravitystorm/openstreetmap-carto). | ||
|
||
![OpenStreetMap Vecto](screenshot.png) | ||
## Requirements | ||
|
||
### Requirements | ||
* [Postgres](https://www.postgresql.org/) 13+ | ||
* [PostGIS](https://postgis.net/) 3+ | ||
* [Java](https://adoptium.net/) 17+ | ||
* [Baremaps](https://www.baremaps.com/) 0.7+ | ||
|
||
* [Docker](https://www.docker.com/) 18.09+. | ||
* [Docker Compose](https://docs.docker.com/compose/) 1.27+. | ||
The database should be accessible with the following jdbc settings: | ||
|
||
``` | ||
jdbc:postgresql://localhost:5432/baremaps?user=baremaps&password=baremaps | ||
``` | ||
|
||
## Getting started | ||
|
||
In order to experiment with OpenStreetMap Vecto, you first need to clone the current repository | ||
|
||
``` | ||
git clone [email protected]:baremaps/openstreetmap-vecto.git | ||
cd openstreetmap-vecto/ | ||
``` | ||
|
||
Then, you can start the docker images, import the data, and edit the map with the following commands. | ||
Assuming that the necessary requirements have been installed, the database can be populated with the following command. | ||
|
||
``` | ||
docker-compose up --build -d | ||
baremaps workflow execute --file workflow.json | ||
``` | ||
|
||
This default environment will: | ||
|
||
* Import OSM data of the Liechtenstein | ||
* Import natural earth data (https://www.naturalearthdata.com/downloads/) | ||
* import osm water polygon | ||
* import osm simplified water polygons. | ||
|
||
You can override this data loaded by modifying the `scripts/import.sh` file. | ||
|
||
To override settings. Copy the `env.sample` file to `.env` and modify env var. | ||
|
||
|
||
## Docker compose setup | ||
|
||
A docker container containing a PostGIS database and all the tools required to run [Baremaps](https://github.com/baremaps/baremaps) can be started with [docker-compose](https://docs.docker.com/compose/). | ||
|
||
The `docker-compose.yml` file contains two services: `db` and `app`. | ||
The former holding a PostgreSQL 13.1 / PostGIS 3.1 database and the latter serving the applicative content, namely baremaps. | ||
It's from the `app` containers that you want to run all baremaps commands to populate the database from data, or to start the web application using some of the commands defined hereunder. | ||
The development server can be started with the following command. | ||
|
||
The version of baremaps can be changed via the variable `BAREMAPS_VERSION` in the `env.sample` file. To find a specific version of baremaps go to the [github release page](https://github.com/baremaps/baremaps/releases/) of the project. | ||
|
||
### Useful commands | ||
|
||
Command | Description | ||
:--------------------------------------- | :-------------------------------------------------- | ||
`docker-compose up --build` | Run the application in the foreground. | ||
`docker-compose up --build --detach` | Run the application in the background. | ||
`docker-compose stop` | Stop all containers. | ||
`docker-compose down` | Stop and remove all containers (but keep the data). | ||
`docker-compose down --volumes` | Stop and permanently delete all containers and data. | ||
`docker-compose down --volumes --remove-orphans` | Same as previous and remove all dangling containers not defined in the Compose file. | ||
`docker-compose exec app <command>` | Execute a command inside the running `app` container. | ||
`docker-compose exec app bash -c ./scripts/import.sh` | Execute the import.sh script to populate the database (inside the container). | ||
`docker-compose exec app bash -c ./scripts/edit.sh` | Edit the map (the db must be populated before running that command). | ||
`docker-compose ps` | List running containers. | ||
`docker-compose logs --tail 20 -f` | Print all containers logs to stdout (usefull when they were launched in the background). | ||
|
||
|
||
Your browser ([http://localhost:9090/](http://localhost:9090/)) should now preview OpenStreetMap Vecto. | ||
Here, the port is `9090`, but you will have to use the one you defined in your `.env` if you changed it. | ||
You will also have to change the port and host in `tileset.json` if you don't use the standard ones. | ||
Notice that a change in the configuration files (`tileset.json`) will automatically be reloaded by the browser. | ||
``` | ||
baremaps map dev --log-level DEBUG \ | ||
--database 'jdbc:postgresql://localhost:5432/baremaps?user=baremaps&password=baremaps' \ | ||
--tileset 'tileset.json' \ | ||
--style 'style.json' | ||
``` | ||
|
||
## Editing the tileset | ||
|
||
|
@@ -80,7 +51,7 @@ Simply put, it adds in the ability to describe the `vector_tiles` and their cont | |
{ | ||
"tilejson": "2.2.0", | ||
"tiles": [ | ||
"http://localhost:9090/tiles/{z}/{x}/{y}.mvt" | ||
"http://localhost:9000/tiles/{z}/{x}/{y}.mvt" | ||
], | ||
"vector_layers": [ | ||
{ | ||
|
@@ -108,13 +79,4 @@ Baremaps integrates [Maputnik](https://maputnik.github.io/) and most of the modi | |
|
||
## Contributing | ||
|
||
As a lot remains to be done, contributions and feedbacks are welcome. | ||
|
||
## Troubleshooting windows | ||
|
||
On windows, be careful with line endings (LF), especially when the files are mounted in a docker container. | ||
|
||
``` | ||
docker run -d --name osmvecto --publish 5432:5432 --publish 9090:9090 --volume C:\openstreetmap-vecto:/home baremaps/osmvecto:latest | ||
docker exec -ti osmvecto bash -c ./import.sh https://download.geofabrik.de/europe/switzerland-latest.osm.pbf | ||
``` | ||
As a lot remains to be done, contributions and feedbacks are welcome. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.