Wykres commitów

131 Commity (master)

Autor SHA1 Wiadomość Data
Tomas Pohanka eae7d7e1ed
Documentation update. (#1654)
- Unifying `name_de` description for `mountain_peak` layer.
- Update the version of PostGIS for `generate-sqltomvt` function.
2024-04-03 15:26:59 +02:00
Andrea Mennillo 9f891b625a
Replace spritezero with spreet (#1631)
This updates `build-sprite` and `build-style` to use `spreet`.

It depends on https://github.com/openmaptiles/openmaptiles-tools/pull/442
2024-02-26 15:06:12 +01:00
Tomas Pohanka de2fa04c37
Docs clean up. (#1636)
Update docs, license year and clean up `.env`.
2024-02-21 13:40:46 +01:00
Yaser Kalali 692b0a7afe
Fix issues in compose and quickstart.sh (#1530)
* Chore(quickstart.sh):

Handle spaces in fonts name when calculating their md5 digest

* Chore(Makefile):

Change docker pull to docker-compose pull to read image from compose file
2023-05-15 12:36:15 +02:00
benedikt-brandtner-bikemap d97d86320b
Do not raise errors with diagnostics code after local test in order to let executors of the script propagate the appropriate status-code (#1519)
Propagate the appropriate status-code during failed unit-test runs. (eg.: CI-Runs)
2023-03-22 07:56:34 +01:00
William Edmisten 02dcc41e1f
Support new docker compose version (#1497)
Currently the Makefile and `quickstart.sh` expect the [deprecated docker compose V1](https://docs.docker.com/compose/#compose-v2-and-the-new-docker-compose-command) syntax, `docker-compose`.
The new V2 syntax uses `docker compose` instead.
2023-03-15 22:16:00 +01:00
Tomas Pohanka 624cf7a8a3
Minor docs enhancement. (#1481)
Update docs, links, and comments.
2023-01-30 14:04:47 +01:00
Adam Laža aa9c39ba3b
Add `build-style` and `download-fonts` targets. (#1445)
This PR adds `build-style` and `download-fonts` targets to `start-tileserver` target. 

Calling `build-style` and `download-fonts` ensures that there is the OSM OpenMapTiles style build and ready and fonts downloaded.
2022-11-28 15:56:00 +01:00
Adam Laža f21b677083
OSM OpenMapTiles style (#1420)
* OpenMapTiles style

* Rename style snippets from layer_name.json to defaultstyle.json

* Add README to icons dir.

* Add README to icons dir.

* Rename snippets to style.json

* Fix spritezero - move icons to svg subdir

* Move icons from style/icons/svg directly to style/icons

Co-authored-by: Tomas Pohanka <TomPohys@gmail.com>
2022-10-06 16:09:21 +02:00
zstadler 1c1231e430
Update UPDATE.md including Makefile improvements (#1408)
- Add `make import-diff` and `make generate-changed-tiles`
- Update `UPDATE.md` accordingly
- Other updates and clarifications in `UPDATE.md`
2022-07-26 18:59:34 +02:00
zstadler 5add9a5cef
Restore controlability with environment variables (#1364)
Since PR #922 the contents of `.env` are included in `Makefile` in order for `make` to by aligned with the `docker-compose` settings.

```
# Make all .env variables available for make targets
include .env
```

The down-side of employing the `include` mechanism is that the settings  in `.env` now take higher precedence than the shell environment variables. As a result, controlling the OpenMapTiles flow because more difficult. For example, tests for `DIFF_MODE=true` had to modify the contents of `.env` in order to work:
b0e7f7884c/.github/workflows/integrity.yml (L45-L47) and
b0e7f7884c/Makefile (L629-L630)

Users were also faced with similar difficulties.

This PR restores the ability to control `make` and `quickstart.sh` using environment variable while keeping the use of the `.env` at a lower priority.

The result is restoring the ability to easily adjust the OpenMapTiles flow using environment variables, such as:
```
PGPORT=54321 DIFF_MODE=true ./quickstart.sh monaco
```

#### Notes: 
1. This PR depends on #1363
2. This PR includes some clean-up of `Makefile`
2022-04-28 09:30:15 +02:00
zstadler b0e7f7884c
Use `docker-compose up -d` for on-going processes (#1353)
Make targets `start-tileserver`, `start-maputnik`, and `update-osm` initialize on-going processes rather than perform a one-time task. It is more appropriate to execute them using `docker-compose up -d`. With the current `docker-compose run` execution, the user needs to run `make` as a background process. This PR also allows the use of `docker-compose logs` rather than the need to handle `stdout` and `stderr` redirection and avoids the dependency of `stdin` handling for `docker-compose run`

Using `docker-compose` rather than `docker`
Use appropriate` start-*` and `stop-*` make target names

Resolves #1352
2022-02-22 12:43:59 +01:00
Brian Sperlongano d7ea45349e
Add highway tests (#1294)
This PR adds unit tests for the transportation layer, and fixes several bugs in the unit testing code.  It verifies the correct zoom association to the various highway classes, and verifies that updates to highway attributes are populated.

Additionally, the documentation for unit tests in the CONTRIB guide is updated to note the specific make commands for developers to run.
2021-11-11 08:27:01 +01:00
Brian Sperlongano be37f3a565
Framework for SQL-based unit tests for import and updates (#1249)
This PR adds the ability to create SQL tests that ensure that OSM data is properly imported and updated in the OpenMapTiles data schema. The tests work by injecting test OSM data and updates into the database and checking to ensure that the data is properly loaded into the database using standard SQL statements.  With this framework in place, developers can now write small tests to inject known data into the database and ensure that imports and updates are working correctly.

In addition to the framework, basic tests are provided for four layers.  These initial tests are in no way comprehensive, but they provide a structure and framework for developers to add their own tests or expand the existing ones to cover more cases.

Usage:

`make clean && make sql-test`

## How it works
The SQL tests consist of the following parts:

1. **Test import data**, located in `tests/import`.  This test data is in the [OSM XML](https://wiki.openstreetmap.org/wiki/OSM_XML) format and contains the data that should be initially injected into the database.  The files are numbered in order to ensure that each test data file contains OSM id numbers that are distinct from the other files.  For example, the file starting with `100` will use node ids from 100000-199999, way ids from 1000-1999, and relation ids from 100-199.
1. **Test update data**, located in `tests/update`.  This test data is in the [osmChange XML](https://wiki.openstreetmap.org/wiki/OsmChange) format, and contains the data that will be used to update the test import data (in order to verify that the update process is working correctly.  These files are also numbered using the same scheme as the test import data.
1. **Import SQL test script**, located at `tests/test-post-import.sql`.  This script is executed after the test import data has been injected, and runs SQL-based checks to ensure that the import data was properly imported.  If there are failures in the tests, an entry will be added to the table `omt_test_failures`, with one record per error that occurs during the import process.  A test failure will also fail the build.  To inspect the test failure messages, run `make psql` and issue the comment `SELECT * FROM omt_test_failures`.
1. **Update SQL test script**, located at `tests/test-post-update.sql`.  This script performs the same function as the import test script, except that it occurs after the test update data has been applied to the database.  Note that script will only run if the import script passes all tests.
2021-10-28 13:38:46 +02:00
Yuri Astrakhan 5fb15d5c31
Re-create cache dir after destroying (#1263)
Cache dir should always exist, so after deleting it,
it must be recreated. This is done in `make init-dirs`,
but if gets destroyed here, it won't auto-recreate.
2021-10-13 15:54:19 -04:00
zstadler 8ec986e01d
Expose `make all` errors (#1254)
Avoid redirection of error messages to output files
- build/openmaptiles.tm2source/data.yml
- build/mapping.yaml

Currently, if an error occurs when `make all` creates any of these files, the error message is not printed to the console.
```
docker-compose run --rm --user=1000:1000 openmaptiles-tools generate-tm2source openmaptiles.yaml --host="postgres" --port=5432 --database="openmaptiles" --user="openmaptiles" --password="openmaptiles" > build/openmaptiles.tm2source/data.yml
Creating openmaptiles_openmaptiles-tools_run ... done
ERROR: 1
make: *** [Makefile:257: build/openmaptiles.tm2source/data.yml] Error 1
```

An inexperienced user would not know where to look for the details.

With this PR, the error is sent to the console:
```
docker-compose run --rm --user=1000:1000 openmaptiles-tools bash -c \
        'generate-tm2source openmaptiles.yaml --host="postgres" --port=5432 --database="openmaptiles" --user="openmaptiles" --password="openmaptiles" > build/openmaptiles.tm2source/data.yml'
Creating openmaptiles_openmaptiles-tools_run ... done
Could not parse /tileset/layers/aeroway/mapping.yaml
found undefined alias 'refkjbkjkhh'
  in "/tileset/layers/aeroway/mapping.yaml", line 94, column 7
ERROR: 1
make: *** [Makefile:257: build/openmaptiles.tm2source/data.yml] Error 1
```

Redirection of stdout is now done in the container, leaving stderr to go to the host.
2021-10-06 18:02:52 +02:00
zstadler ed65036766
Restore `make psql` acceptance of SQL from stdin (#1250)
Following https://osmus.slack.com/archives/CH6GFAFRC/p1632824401121100?thread_ts=1632711389.118900&cid=CH6GFAFRC
2021-09-29 14:51:00 +02:00
Brian Sperlongano b4b897999d
Replace osmborder with imposm/SQL (#1213)
Fixes #1156
Fixes #810
Fixes #1228

This PR replaces `osmborder`, which is no longer maintained, with `imposm` mappings and SQL code to generate borders.  Key features that were moved into the imposm/SQL layer:
1. Grouping by `osm_id` and aggregating by lowest `admin_level` value so that there's only one copy of ways that are members of multiple relations.
2. Filtering out of point features in boundary relations (typically `admin_centre` and `label` roles).
3. Move disputed boundary detection logic into SQL.

This will increase the database size slightly because of the limits of what imposm can do, as some of the filtering is done in the SQL layer after importing, rather than being done in `osmborder`.
2021-09-29 11:08:55 +02:00
Falke Design 6f0ab57547
Print error of `import-sql` at the end of the output (#1237)
Because of the parallel processing of `import-sql` the error message is printed in the middle of the output. With this PR the error is displayed again at the end:
![grafik](https://user-images.githubusercontent.com/19800037/133897373-656ed3d0-e580-4f67-9290-0e83949d63d7.png)

Issue: https://github.com/openmaptiles/openmaptiles-tools/pull/370

```
awk '1{print; fflush()} $$0~".*ERROR" {txt=$$0} END{ if(txt){print "\n*** ERROR detected, aborting:"; print txt; exit(1)} }'
```
Explanation:
- `1{print; fflush()}` means if true then print output -> `1{}` same as `if(true){}`
- `$$0~".*ERROR" {txt=$$0}` get first argument `$$0` (line of output) and check if it contains (regex string) `ERROR`. If true save line to var `txt`: `{txt=$$0}`
- `END{ ... }` if last line of output is reached
- `if(txt){print "\n*** ERROR detected, aborting:"; print txt; exit(1)}` if error was found in a line / var `txt` is existing print it out
2021-09-21 10:42:50 +02:00
Falke Design d19aa5bf24
Makefile: Replace static DB properties with the variables (#1222)
* Replace static DB properties with the variables
2021-09-17 12:04:40 -04:00
Yuri Astrakhan d205f4a433
Fix Ctrl+C when generating tiles (#1205)
Adding -T fixes the issue when users are unable to stop tile genartion with ctrl+c

For some reason it doesn't work without it, even though the process of building
and running both docker images is the same.
2021-09-01 14:18:06 +02:00
Falke Design 910db7f60c
Remove area checks in Makefile for `import-borders` & `generate-tiles-pg` (#1200)
While importing multiple .pbf files into postgres I was confronted with some unnecessary problems:

1. I wanted to use the borders of the planet which I had already generated. But `make import-borders` needs a .pbf file which is not necessary if the line.csv file is already existing -> So I added a check if the line.csv is **not** existing it checks for the `area parameter` / .pbf file
2. `make generate-tiles-pg` is only possible with a specified `area parameter` BUT the area is not used / needed for generation -> So I removed the area check
2021-09-01 10:10:29 +02:00
Yuri Astrakhan 1cea73cb7c
Use st-asmvt pg tilegen in quickstart (#1193)
* Use generate-tiles-pg target in quickstart
* update makefile documentation
2021-08-25 21:35:06 -04:00
Brian Sperlongano 8d91cb3d94
Improve "make help" output (#1121)
This PR makes three improvements to the current `make help` output:

1. Adds additional help entries for useful `make` targets that were not currently in `make help`
2. Pipes the help output through `less` so that the user can scroll up or down through the various `make` targets if it overflows the length of the user's screen
3. Re-groups the "developer" targets into separate entries for database and docker-related commands

In addition, an unneeded whitespace was removed from line 7 of the Makefile.
2021-06-09 12:36:27 +02:00
zstadler 68ec5c7ac8
Update makefile to catch WSL folder error (#1108)
- Resolve #1103
- Remove dead code
2021-04-30 07:57:12 +02:00
Yuri Astrakhan 1f6eb7b4a3
Improve logging - show BBOX if exists (#1096)
The generate-bbox target will now show the value of BBOX if it is already generated.
2021-03-30 21:02:34 +02:00
zstadler 2943e9dc8d
Avoid grep errors in `clean-unnecessary-docker` (#1089)
When `make clean-unnecessary-docker` is run twice, or when there are no docker images tagges as "<none>", make fails because grep fails:

```
Deleting unnecessary container(s)...
Deleting unnecessary image(s)...
make: *** [Makefile:562: clean-unnecessary-docker] Error 1
```

Using `awk` to _also_ search for "<none>", instead of `grep`, solves this issue.
2021-03-16 17:20:25 +01:00
Taro Matsuzawa aka. btm 924558d7d9
Enable pgquery (#1048)
I try to use pgquery, it needs some configuration in .env file.
I think if we use pgquery instead of mapnik, the performace will be good.
2020-12-08 15:56:01 +02:00
Andrii Korzh 01d53a26c6
Fix detected area filename (#1049)
User can be confused that script detected non existing file.
2020-12-07 17:30:16 +02:00
Tomas Pohanka d180988f5f
Move "qa" tools from OMT to OMT-T (#1031)
With the new release of OMT-T (5.3) are available tools [`layer-stat`](https://github.com/openmaptiles/openmaptiles-tools/pull/293). 

With the new release of OMT-T can be replaced `make` target `generate-qareports` by `generate-qa`

Used as:
```
make generate-qa STAT_FUNCTION=frequency LAYER=transportation ATTRIBUTE=class
```
2020-11-12 11:23:06 +02:00
Yuri Astrakhan 97ffabcb49
Use 5.3 - new bbox value (#1012)
Migrate to tools 5.3 and use the new bbox value.

* Use 5.3 - new bbox value
* Return correct bbox for meta-generate
mbtiles-tools meta-generate is now able to use bbox from *.bbox file

Thanks @nyurik
2020-10-26 18:39:49 +02:00
zstadler e8bf4aa94a
Update makefile for hierarchical area names (#1009)
- Use `find` instead of `wildcard` to detect existing `.osm.pbf` files
- Use `patsubst` to extract an `area` from a filename
- Clarify messssage, especially for errors

Resolve https://github.com/openmaptiles/openmaptiles/issues/1008
2020-10-01 08:10:01 +03:00
swiss-knight 0245b21634
NOOP: Minor Makefile clean up (#994)
Minor fix.
2020-09-22 11:27:45 +03:00
zstadler fb7c1ef42b
Update Makefile (#984)
Update `make help` according to #750
2020-09-15 08:18:18 +03:00
zstadler c82c706bc3
Clean output of `list-views` and `list-table` (#985)
Avoid printing a fixed `public,` prefix in the output of `make list-views` and `make list-table`.
As `make help` says, `list-views` and `list-table` list only the public schema views and tables.

New output:

```
viewname
boundary_z0
boundary_z1
boundary_z10
boundary_z11
boundary_z12
boundary_z13
boundary_z3
boundary_z4
boundary_z5
boundary_z6
boundary_z7
boundary_z8
boundary_z9
geography_columns
geometry_columns
...
```

Existing output:

```
schemaname,viewname
public,boundary_z0
public,boundary_z1
public,boundary_z10
public,boundary_z11
public,boundary_z12
public,boundary_z13
public,boundary_z3
public,boundary_z4
public,boundary_z5
public,boundary_z6
public,boundary_z7
public,boundary_z8
public,boundary_z9
public,geography_columns
public,geometry_columns
...
```
2020-09-14 15:07:35 -04:00
Frédéric Rodrigo 10efc29280
Make tileset def openmaptiles.yaml a variable (#968)
Move the hard coded `openmaptiles.yaml` from Makefile to a variable. Allows use other tileset definition.
A step forward easy alternative layer definition.
2020-08-27 12:43:09 -04:00
zstadler 1daacf354e
Use line buffering by `awk` in `make import-sql` (#962)
Resolve https://github.com/openmaptiles/openmaptiles/issues/958
2020-08-10 10:41:14 +02:00
zstadler 6a512af90f
Special cache handling for Docker Toolbox on Windows (#957)
resolves https://github.com/openmaptiles/openmaptiles/issues/807
2020-08-03 18:12:09 +02:00
zstadler 751551f910
Add `$OMT_HOST` support to `make start-postserve` (#956)
Resolve https://github.com/openmaptiles/openmaptiles/issues/955
2020-07-28 18:28:04 +02:00
zstadler 897846380a
Rephrase `area` detection messages (#954)
Thanks @zstadler.
2020-07-28 07:25:52 +02:00
Yuri Astrakhan 447a8380e0
Fix incorrect Imposm config updates (#922)
* Current code incorrectly passes `IMPOSM_CONFIG_FILE` to the `generate-tiles` image, but should pass it to the tools.
* add a test to ensure imposm config exists
* add a test to ensure area is set during updates
2020-06-09 10:00:10 -04:00
zstadler ffd237d5c8
Fix `clean-unnecessary-docker` make target (#921)
Add missing `-q` flag
2020-06-08 12:40:04 -04:00
Yuri Astrakhan 60a3e1ea70
Fix Makefile duplicate runs (#923)
Make sure that core targets (i.e. part of the `all` target like build-sql and build yaml files) do not run multiple times if they already exist.

Makefile for some reason does not like it when a real target depends on a PHONY target, and re-runs it. I added an `if` statement to skip building targets if their result already exists.
2020-06-08 12:26:11 -04:00
Yuri Astrakhan 805d95df09
Fix import-borders if runs multiple times (#916)
Running './quickstart monaco' twice in a row will cause an error the second time.
2020-06-05 12:48:48 -04:00
Yuri Astrakhan 1a9f6132c3
New generate-dc-config target, rm QUICKSTART_MIN/MAX_ZOOM (#915)
* Set `MAX_ZOOM` to 7 by default.
* Remove `QUICKSTART_MIN/MAX_ZOOM` - unneeded complexity with two env vars. We can just use `MIN_ZOOM` and `MAX_ZOOM`. See also #261
* Generate dc-config yaml file with a new `make generate-dc-config` step. It will compute BBOX based on the downloaded data file. This step is not needed for planet generation.
* Generate Imposm replication file only when `DIFF_MODE` is `true`. Not needed otherwise. If the data source does not support it, it will throw an error.
2020-06-04 15:45:04 -04:00
Yuri Astrakhan 1486b7e0cb
Rework download area support (#908)
Closes #904
* Make all data-related targets like `download*`, `import-osm`, `import-borders`, and `generate-tiles` into `area`-aware -- making it possible for multiple data files to coexist inside the `./data` dir.
* Add `make download area=... [url=...]` command to automatically download any kind of area by checking Geofabrik, BBBike, and OSM.fr, optionally from a custom URL. Supports `area=planet` too.
* Do not re-download area with `make download-*` if it already exists.
* Automatically rename `<area>-latest.osm.pbf` into `<area>.osm.pbf`
* If `area=...` parameter is not given to `make`, see if there is exactly one `*.osm.pbf` file, and if so, use `*` as the `area`.
* Configure many variables in the .env file, overriding the defaults in tools
* If `<area>.osm.pbf` exists, but `<area>.dc-config.pbf` is missing, generate it using `download-osm make-dc` command.

Also:
* closes #614
* closes #647
* partially addresses #261
2020-06-03 15:37:45 -04:00
Yuri Astrakhan fca53ef0ee
Minor makefile/quickstart cleanup (#907)
* Make a few spacing adjustments for ease-of-reading and consistency
* fix bbbike naming and other source urls
* remove unneeded `override`
* added `list-bbbike` target
2020-06-01 12:54:30 -04:00
Yuri Astrakhan 546f26e68a
MVT: use gzip and generate for v3.0 (#906)
This only changes the generated `getmvt(...)` function used by mvt users.

Beginning with tools 5.1, postgis docker images uses postgis v3.0, and includes gzip extension
2020-06-01 12:46:34 -04:00
Yuri Astrakhan 1a31b9212e
Minor fix import-borders file param (#905)
just like import-osm, import-borders can accept PBF_FILE param
2020-06-01 12:33:26 -04:00
Yuri Astrakhan 907fc58ee2
Use tools v5.2 (#903)
* Use [tools v5.2](https://github.com/openmaptiles/openmaptiles-tools/releases/tag/v5.2.0)
* Use `mbtiles-tools meta-generate` instead of the removed `generate-metadata` script.
* Remove `show-metadata` make target - it was just added and is not needed.

## Relevant changes
* Upgrade [osml10n PG extension](https://github.com/giggls/mapnik-german-l10n) to the faster v2.5.9 (significant performance improvements merged upstream by @nyurik)
2020-06-01 12:15:36 -04:00