Wykres commitów

27 Commity (master)

Autor SHA1 Wiadomość Data
Brian Sperlongano a682d50d0d
Document name_* deprecation strategy (#1605)
This PR is a **documentation change only**. It documents the fact that `name:xx` values are present in the tiles and documents that `name_de` and `name_en` will be removed in a future release in favor of `name:de` and `name:en` respectively.
2023-12-30 08:14:35 +01:00
benedikt-brandtner-bikemap d8a8c81f79
Improved update performance of aerodrome_label layer (#1506)
Improved update performance of aerodrome_label layer
- Refactored IDs to be unique in aerodrome_label.osm_ids
- Restricted updates to INSERT and UPDATE operations during aerodrome_label.refresh
- Added analyze statements before update queries during aerodrome_label.refresh

See #1433 for more detailed discussion.
2023-03-21 18:09:32 +01:00
Daniel Schep cd77b07e46
improve `class=path` styling (#1450)
This PR addresses that by:

* rendering oneway arrows on more than `subclass=cycleway`
* less opacity for path/footway casing
* adding the thin black casing to bridges
* adding `subclass=steps` & `subclass=bridleway` rendering
* render `bicycle=designated` as `subclass=cycleway` and `horse=designated` as `subclass=bridleway` (bike taking priority)
* improved tunnel rendering with double casing & adding main line
* made casing min zoom consistent across subclasses

All of these changes were made to mimic OSM Carto.
2023-01-06 10:08:03 +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 2d0b7159d0
Update aerodrome_label class in DIFF_MODE=true (#1371)
The class field was not updated if needed during the import of changes in DIFF_MODE=true.
2022-04-20 05:50:37 +02:00
Brian Sperlongano f744f9c009
Upgrade to omt-tools v6, Imposm 0.11.1 and migrate SQL (#1246)
This PR migrates the SQL in the transportation and transportation_name layer to use the new imposm3 mappings which now map a separate primary key ID.
2021-10-14 11:38:28 -04:00
Brian Sperlongano 5e37a811fb
Update devdocs (#1223) 2021-09-11 15:56:10 -04:00
Brian Sperlongano 7e9a6812d7
Add international airports at z8-9 (#1187)
Closes #1082

This PR moves the aerodrome/aerodrome_type consolidation (via template) into the lower-level `osm_aerodrome_label_point` table, and creates a partial index on class `international` for airports with an `iata` code.  The presence of an `iata` code is more significant than an `icao` code which exists at many smaller, general aviation airport.  Therefore, `international` + `iata` should be a sufficient filter.

Zoom 8 international airports in the NYC area (blue dots):
![image](https://user-images.githubusercontent.com/3254090/130335311-10b7aa35-d2f9-42cc-a054-878048012040.png)

Zoom 10 in the same area:
![image](https://user-images.githubusercontent.com/3254090/130335327-3989cfba-80ca-46dd-a157-45b375f84a8d.png)
2021-08-23 14:14:50 +02:00
Brian Sperlongano 6ef138635d
Fix negative feature IDs (#1185)
This PR removes the possibility of negative feature IDs for the `aerodrome_label` layer by defining the feature as the absolute value of the OSM id (imposm maps relations with negative numbers).  There is a very unlikely  scenario in which a relation and a way have the same ID (and are also in the same tile), however, unique IDs are not a strict requirement of MVT.

Noted in:
https://github.com/openmaptiles/openmaptiles/pull/1176#issuecomment-902503655

Positive feature ID for Quonset State Airport, which is mapped as a relation:
![image](https://user-images.githubusercontent.com/3254090/130232322-c797d491-ece9-4889-9695-ffb6f3ac011f.png)
2021-08-20 16:40:02 +02:00
Brian Sperlongano 36bd917e05
Implement feature IDs in aerodrome_label and mountain_peak (#1176) 2021-08-19 21:03:40 +02:00
Adam Laža 512b3435ad
Bugfix update_aerodrome_label_point() (#1051)
Bug introduced in #944.
Missing exclamation mark in not equal operator caused that tags were not updated thus there were missing `name_int`, `name:latin` and `name:nonlatin`.
2020-12-08 17:27:12 +02:00
Adam Laža 0dc8c3256c
Rename generic layer.sql to actual_layer_name .sql (#1034)
Following layers had generic `layer.sql` name.

- `aerodrome_label`
- `aeroway`
- `housenumber`
- `mountain_peak`
- `park`
- `place`
- `poi`
- `transportation`
- `transportation_name`
- `water_name`

This PR renames `layer.sql` to `aerodrome_label.sql`, `aeroway.sql`...
2020-11-09 11:43:35 +02:00
Frédéric Rodrigo 36b7533d3b
Add timers to trigger function (#1006)
Add timer to all trigger refresh functions to help point where the time is spend on update.
2020-10-08 16:57:16 +03:00
Frédéric Rodrigo bb2a4328f3
Make more simple incremental update (#944)
Replacing update on the whole table with an update only on changed rows.

The goal is to update more quickly by just updating the changing content.
The update now focus on osm_id of changed rows, it use index. Add a where clause tags != update_tags(tags, geometry) en ensure only update when changed.

It requires one more trigger and a table to store changed osm_id.

The UPDATE is keep in a function to be reusable for initial setup and trigger update.

I try many code layout before done it in this way with the goal to keep the code for initial pass and for update. It should have low impact on initial data load. Better performance for row update can be achieve with BEFORE UPDATE, but require to duplicate the logic.

It is not based on the already merged https://github.com/openmaptiles/openmaptiles/pull/896 because calling and update within a function for each updated row was not efficient for larger table (like housenumber).

It addresses #814.


* Remake update_peak_point use incremental update #814

* Make update_aerodrome_label_point use incremental update #814

* Make housenumber_centroid use incremental update #814

* Make update_continent_point use incremental update #814

* Make update_island_point use incremental update #814

* Make update_island_polygon use incremental update #814

* Remove dead code in update_state_point.sql

* Make update_state_point use incremental update #814

* Remove dead code in update_country_point.sql

* Make update_country_point use incremental update #814

* Make osm_poi_polygon use incremental update #814

Thanks @frodrigo
2020-08-28 11:03:27 +02:00
Frédéric Rodrigo 9bb17792a6
Remove alignment of AS in SQL and few others (#932)
* Remove alignment of AS in SQL

* Remove alignment of CREATE TABLE in SQL
2020-07-22 13:48:25 +02:00
Yuri Astrakhan 2b95d1cffa
Fix & optimize incorrect function declarations (#918)
* All functions that access database must be declared as `STABLE`, not `IMMUTABLE` -- because database can change at any moment, e.g. during an update
* there are a few functions that could be made `STRICT` -- passing `NULL` as a parameter will always result in a `NULL`, but for some reason that causes a significant decrease in perf.
* tagged one function as parallel safe

NOTE: somehow `ST_AsMVT()` method of tile generation is showing 70-90% slowdown with this patch. I am not sure of why this is happening. If the reason is the `IMMUTABLE` -> `STABLE` change, we may have to dig deeper into PG optimization
2020-06-17 12:15:26 -04:00
Yuri Astrakhan f889853cb6
aerodrome_label: Remove unused function parameter (#919)
Minor optimization - in function `layer_aerodrome_label(bbox, zoom_level, pixel_width)` last parameter is not being used, so removing.
2020-06-11 14:24:55 -04:00
Yuri Astrakhan 6457419e0d
NOOP: Format all layer's SQL code (#917)
I would like to reformat all of our SQL to have a concise coding style.
This makes it far easier to understand the code for a casual contributor,
and lets us spot errors more easily.

Most importantly, it makes it much easier to grep (search) the code because it is more likely to be in the same syntax

Some key changes:
* SQL keywords are always UPPERCASE, e.g. `SELECT WHEN AS END ...`
* types, variables, aliases, and field names (identifiers) are always lower case
* `LANGUAGE 'plpgsql'` is now `LANGUAGE plpgsql` (no quotes)
* a few minor spacing/semicolon cleanups

P.S. Per @TomPohys request, `TABLE` is spelled using upper case despite being a type for consistency with PG Docs. Same for `LANGUAGE SQL` vs `LANGUAGE plpgsql`.
2020-06-08 12:19:55 -04:00
Frédéric Rodrigo 495e8bd370
Align update.sql file naming to other layers (#897)
Code clean.

Use the same naming convention for the SLQ update file as other layer.
2020-05-26 21:03:07 +02:00
Jorge Sanz ace759590e
Parallel capability to layer functions (#728)
This PR allows queries to be parallelized on recent versions of Postgres. The `PARALLEL SAFE` modifier has been added to the layer functions and a PLPGSQL function to convert strings into number has been replaced.

`PARALLEL SAFE` is a modifier for `CREATE FUNCTION` available since Postgres 9.6, so this change does not break current OpenMapTiles supported database version. More details about this topic [here](https://www.postgresql.org/docs/current/parallel-safety.html) and at the reference documentation for [`CREATE FUNCTION`](https://www.postgresql.org/docs/current/sql-createfunction.html).

### Testing procedure

The procedure to test this was:

* Imported `spain.pbf` in a clean environment
* Dumped the OpenMapTiles database from the Postgres Docker image
* Created a clean Postgres 12 database using the default Docker image
* Installed `postgis` 3 from the default Debian package and `osml10n` 2.5.8 from the repository (`make`, etc.)
* Restored the dump
* Lowered the postgres planner parameters for triggering parallel plans:
```sql
set parallel_setup_cost = 5;
set parallel_tuple_cost = 0.005;
```
* Manually added the `PARALLEL SAFE` modifier to each function involved in layer queries (not on updates or inserting functions).
* For each layer, run a testing query to confirm parallel workers were created, something like this:
```sql
explain analyze 
select * from layer_aerodrome_label(tilebbox(8,128,95),10,null)
union all
select * from layer_aerodrome_label(tilebbox(8,128,97),10,null);
```
* After all the layers were processed and confirmed to start parallel executions, a more complete example was run. This example just retrieves the geometries for all the layers from the same tile but without using any MVT related function.

<details><summary>Testing query</summary>

```sql
-- Using the function layer_landuse
explain analyze 
select geometry from layer_water(tilebbox(14,8020,6178),14)
union all
select geometry from layer_waterway(tilebbox(14,8020,6178),14)
union all
select geometry from layer_landcover(tilebbox(14,8020,6178),14)
union all
select geometry from layer_landuse(tilebbox(14,8020,6178),14)
union all
select geometry from layer_mountain_peak(tilebbox(14,8020,6178),14)
union all
select geometry from layer_park(tilebbox(14,8020,6178),14)
union all
select geometry from layer_boundary(tilebbox(14,8020,6178),14)
union all
select geometry from layer_aeroway(tilebbox(14,8020,6178),14)
union all
select geometry from layer_transportation(tilebbox(14,8020,6178),14)
union all
select geometry from layer_building(tilebbox(14,8020,6178),14)
union all
select geometry from layer_water_name(tilebbox(14,8020,6178),14)
union all
select geometry from layer_transportation_name(tilebbox(14,8020,6178),14)
union all
select geometry from layer_place(tilebbox(14,8020,6178),14)
union all
select geometry from layer_housenumber(tilebbox(14,8020,6178),14)
union all
select geometry from layer_poi(tilebbox(14,8020,6178),14)
union all
select geometry from layer_aerodrome_label(tilebbox(14,8020,6178),14);
```
</details>

You can inspect the execution plan and results on [this page](https://explain.dalibo.com/plan/3z). Also [attaching](https://github.com/openmaptiles/openmaptiles/files/3951822/explain-tile-simple.tar.gz) the query and JSON output for future reference. The website gives a ton of details, but you may want to search for nodes mentioning `workers` or `parallel` like in this area referring to `osm_border` or `osm_aeroway_linestring` entities

![image](https://user-images.githubusercontent.com/188264/70647153-9cac9300-1c48-11ea-96ea-ac7a1e2f4a79.png)

### Next steps

Since the execution plan is not showing a parallel append at the top level, meaning it's not running each layer individually, I want to continue experimenting with parameters and queries to see if it's possible to even parallelize more the request.

I will post my finding here, even no change in the code should happen.


cc. @nyurik

Co-authored-by: Yuri Astrakhan <yuriastrakhan@gmail.com>
2020-01-31 19:36:02 -05:00
Yuri Astrakhan 9d6dbfc64f
Use one pass docs image generation (#751)
quicker and cleaner diagram image generation.
Remove etl-graph and mapping-graph targets - redundant

Also, the obsolete "fields" is still in Imposm's code and both names are accepted,
but "fields" is not documented anywhere (PR submitted), and could be removed at any moment.

Our docs were not supporting it until this PR, so renaming it at the same time.

Several images have been updated due to a more inclusive mapping scan
Requires https://github.com/openmaptiles/openmaptiles-tools/pull/147 (merged)
2020-01-22 21:55:22 -05:00
Yuri Astrakhan 1614a4656c Manage field mapping in SQL declaratively
Simplify some of the OSM->OMT field value mappings using declarative syntax.

This approach is not for all cases, but in many it removes
the need of storing the same field in both the .yaml and .sql files.

TODO: support more complex AND/OR cases
2019-12-19 11:25:29 -05:00
Yuri Astrakhan 7426e3a924
Added missing key_field to the aerodrome_label & mountain_peak def (#686)
aerodrome_label & mountain_peak queries return `osm_id`, but they
are not declared in the data source.  I think we should either remove
the `osm_id` from the query result, or declare the data source.
2019-10-28 12:26:03 -04:00
Yuri Astrakhan eca13f9bed
Refreshed all diagrams, fixed automation & 2 broken graphs (#692)
Seems like etl and mapping diagrams have been neglected
for a long time. Now it regenerates the files and places
them in the source dir.

This PR also fixes two broken files:
* layers/aerodrome_label/mapping_diagram.png
* layers/housenumber/mapping_diagram.png

They were generated using the newest tools version with the fix
https://github.com/openmaptiles/openmaptiles-tools/pull/65
2019-10-26 21:28:43 -04:00
jirik 741be6d921 Import additional names from Wikidata 2017-11-16 09:03:41 +01:00
Jiri Kozel 1a324aaf22
Do not load all tags, use later imposm3 (#356)
Fix #266 #267
2017-11-10 15:25:23 +01:00
jirik db5cd682ea Add aeroway_label layer 2017-11-07 18:06:47 +01:00