Wykres commitów

1310 Commity (master)

Autor SHA1 Wiadomość Data
Adam Laža 5772e61244
Bugfix in osm_landcover_gen_z10. (#1054)
Add missing `NOT` in WHERE condition.
It causes there are duplicated features of subclass `wood` and `forest` and features of other subclasses are missing.
2020-12-14 12:47:45 +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
Dalibor Janák b2b8716840
Update links in readme (#1050)
Updated not existing links to openmaptiles.com.
2020-12-08 16:57:40 +02: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
Adam Laža 77f5d76e37
Refactor schema, one _gen_z view per zoom. (#1045)
* Refactor layer aeroway.

* Refactor layer boundary.

* Refactor layer landcover.

* Refactor layer landuse.

* Refactor layer park.

* Refactor layer transportation.

* Refactor layer water.

* Refactor layer waterway.

* Re-generate water* layers etl_diagrams.

* Regenerate etl_diagrams for waterway.

* Cast NULL to text.
2020-11-26 13:54:00 +01:00
Tomas Pohanka 0c6fe2d9ba
Building aggregation fix (#1044)
This PR solving the speed and memory issue with buildings aggregation on zoom level 13. The problem was to create ST_ClusterDBScan which failed after try to cluster a larger area. Now it will make cluster only in "small" polygon using 'country_osm_grid` which covers the world's lands. 

This PR solving #1022 and #974
2020-11-24 12:27:06 +02:00
Tomas Pohanka 24b9328a5f
Remove unused generalization from waterway (#1043)
During the import-osm step, there are three generalized tables for the waterway that are not used for subsequent processing.
Thanks @lazaa32 for the notice.
2020-11-24 11:30:00 +02:00
Adam Laža da689f9e42
Fix landcover generalization. (#1042)
This PR brings few modification which make it possible to generalize landcover on larger areas. Tested on Europe.

- Use ST_SnapToGrid to avoid ERROR:  GEOSUnaryUnion: TopologyException: found non-noded intersection between LINESTRING.
- Cluster only landcover subclasses: wood and forest.
- Use less generalized tables as a starting point for next step generalization.
2020-11-24 10:33:06 +02:00
Tomas Pohanka 0776cd3eed
README - Rename target for bbox-file by new tool 5.3 (#1040)
Changed in Use 5.3 - new bbox value (#1012)
2020-11-13 14:34:41 +02:00
Tomas Pohanka 3ef364552e
add state name to national borders (#1039)
This PR adds state name to national borders (`admin_level=2`)

From zoom level 3 there is an added `adm0_l` and `adm0_r` attribute for national borders.

There is 3 main steps: 
1) union border lines from OSM and keep separate LineString between intersects
2) create polygons from step 1), create a point in each state polygon, add to this point a state abbreviation from NaturalEarth Data
3) create a short parallel line on the left and right of a small part of the border in 70m distance, and add information about which state overlap this short line.
2020-11-12 12:14:13 +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
Eva Jelinkova 0aa6648bd9
adding brunnel into z<9 (#1038)
Following https://github.com/openmaptiles/openmaptiles/pull/1027, solving https://github.com/openmaptiles/openmaptiles/issues/999.

Adding brunnel attributes to merge tables of `transportation` layer, now it is possible to style/filter tunnels, bridges and fords in all zoom levels. Tested on Switzerland and Europe. Changes in generation speed and filesize minimal.
2020-11-11 15:37:09 +02:00
Tomas Pohanka 4a1b0afa26
reworked landcover layer (#1035)
Instead of using [Douglas-Peucker algorithm](https://postgis.net/docs/ST_SimplifyPreserveTopology.html) which is using for generalized tables [imposm](https://imposm.org/docs/imposm3/latest/mapping.html#generalized-tables) it is used [Visvalingam-Whyatt algorithm](https://postgis.net/docs/ST_SimplifyVW.html).

Solution:
remove imposm generalized tables (during `import-osm`) and create generalization in `import-sql` step for zooms 7-14. Zooms 0-6 are from Natural Earth data.

Upper zoom levels (7 and 8) are ok to merge with no big impact on creation speed. In Canada from z9 it took too long. Between zoom levels 10 - 13 there can be union polygons with less than 300 edge points (empirical number based on a test on Canada forest, can be discussed). Polygons with more than 300 edge points are just simplified. Zoom 14 is from the original dataset `osm_landcover_polygon`.

There is also removed `osm_id` which is never used and not passed into vector tiles.
2020-11-11 15:11:48 +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
Eva Jelinkova a36db48a3e
Revert "#766 remove housenumbers inside polygon and same number (#983)" (#1033)
This reverts commit 1685eaccbd.
2020-11-04 21:53:15 +01:00
Eva Jelinkova 8ba2e18dea
Revert "Housenumbers - diff update, multipolygons (#990)" (#1032)
This reverts commit f7d7a0ced3.
2020-11-04 21:07:09 +01: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
Tomas Pohanka 72af34612a
Add gates to airports (#1029) 2020-10-19 12:24:16 +03:00
zstadler 09b68ed1c2
Allow `BBOX` to be set in `.env` file (#1013)
* Allow setting `BBOX` to be set in `.env` file

Currently, the `BBOX` setting in `.env` is ignored for all areas except `planet`.
On the other hand, the `planet` area is an overkill for any `BBOX` setting other than the default - `-180.0,-85.0511,180.0,85.0511`.

With this PR, `quickstart.sh` would not override a modified `BBOX` value in `.env`. 

Also, this provides a way to avoid the pessimistic `BBOX` computation for `osmfr` extracts, as described in https://github.com/openmaptiles/openmaptiles-tools/pull/297#issuecomment-700792702

#### Currently
- If the user does not do anything, `quickstart.sh` and `make generate-tiles` create an `mbtiles` file for the full extent of the data source. This applies to `planet` and other data sources.
- If a user sets the `BBOX` value in `.env` and a `planet` data source is used, `quickstart.sh` and `make generate-tiles` create an `mbtiles` file for the extent set in the `.env` file.
- If a user sets the `BBOX` value in `.env` and a non-`planet` data source is used, it is ignored - `quickstart.sh` and `make generate-tiles` create an `mbtiles` file for the full extent of the data source.

#### Problem statement
While users of a `planet` data source have a simple way to override the default extend of the tile generation, users of other data sources have no simple way of doing that. In fact, for such users the `BBOX` setting in the `.env` file is ignored and therefore misleading.

#### Proposal
- If the user does not do anything, `quickstart.sh` and `make generate-tiles` create an `mbtiles` file for the full extent of the data source. This applies to `planet` and other data sources.
- If a user sets the `BBOX` value in `.env`, `quickstart.sh` and `make generate-tiles` create an `mbtiles` file for the extent set in the `.env` file. This applies to `planet` and other data sources.
2020-10-15 11:38:11 +03:00
Eva Jelinkova 341c4df171
Brunnel changes in transportation and transportation_name layers (#1027)
https://github.com/openmaptiles/openmaptiles/issues/999

- Point 1 solved only partially - there is `brunnel` value added into zooms 9, 10, 11. For zooms 8 and smaller it would need change in osm_transportation_merge_ tables - I am going to try it but maybe its SQL costs will be to high.

- Point 2 solved.
2020-10-14 15:26:43 +03:00
Tomas Pohanka b7429ce6f5
union ocean regular squares into complex polygon (#1021)
The ocean layer (table osm_ocean_polygon insert by `make import-data`) is made from squares that have a 10m buffer. 

This creates extra geometry in vector tiles as:

Union of full ocean squares should decrease the size of the water layer.

there are 8042 polygons (squares, 5 points, more then 100km<sup>2</sup>), which was reduced to 22 polygons - 1184kB vs 40kB respectively. 

In mbtiles should be the size reduction even more significant, due to the creation of more polygons based on a 10m buffer of each square.
2020-10-14 14:56:04 +03:00
Tomas Pohanka 72165933be
add ST_IsValid where ST_PointOnSurface (#1025)
Same as #1015 for another ST_PointOnSurface
2020-10-13 16:28:20 +03:00
Tomas Pohanka 88c13f713f
Korean and Japanese Latin (#1026)
Korean moved from `ko_rm` to `ko-Latn`. Same as Japanese deprecated `ja_rm` in advance of `ja-Latn`, but still have twice more records. For Japanese add Hiragana form.

fix #537 
listed in #930
2020-10-13 15:52:15 +03:00
Frédéric Rodrigo cfc243e848
Add protocol to postserve --serve paramter (#1007)
The current option of postserve in the docker-compose produce an invalid tilejson.
```json
"tiles": ["localhost:8090/tiles/{z}/{x}/{y}.pbf"]
```
`tiles` should be URL. The protocol is missing.

Not sure about the best way to fix this. Just adding `http://` to the docker-compose.yaml does not allow https usage. But setting protocol in `OMT_HOST` seems weird.

Could add an extra OMT_PROTOCOL with `http` as default.
2020-10-12 16:45:09 +03:00
Eva Jelinkova 7a7e9326b9
adding ST_IsValid to housnumber geometry (#1015)
Adding check of geometry in layers/housenumber/housenumber_centroid.sql.
2020-10-12 15:05:20 +03:00
Eva Jelinkova 3d21523fbe
aerialway class for the transportation layer (#1011)
Co-authored-by: Tomas Pohanka <TomPohys@gmail.com>
2020-10-12 12:44:33 +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
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
Frédéric Rodrigo 883a997dcf
Remove large unused index osm_highway_linestring_highway_idx (#1002)
The index `osm_highway_linestring_highway_idx` is not used. There is also a used partial index `osm_highway_linestring_highway_partial_idx`.

I cross check the usage of the index from postgres query stats and all SQL query code where the table `osm_highway_linestring` is refered.

This index is relatively big.
2020-09-30 11:30:18 +03:00
Frédéric Rodrigo a3ce04fe23
Add landuse=salt_pond as water (#1000)
Add salt pond as water.

Most of salt pond are already tagged with natural=water even if it's not required. So the load added by this tag is very light.
2020-09-29 07:53:35 +03:00
zstadler 424c4ee8a3
Remove workaround for quickstart.sh (#998) 2020-09-28 22:28:34 +03:00
Frédéric Rodrigo c8f919e9d6
Better update of osm_important_waterway_linestring, use frist and last version of osm object (#997)
Current implementation of osm_important_waterway_linestring have two bugs:
* The distinct on is_old keep the oldest version of the old object, and the oldest version of the new object, but need the last version of the new object.
* Delete the old version of the object and rebuild the using the new version of the object. But we need to remove matchings the old and the new version of the object, then rebuild the two.

Then only delete and update using first and last version of the object, intermediate versions are ignored.

Similar implementation of what is done in #996.
2020-09-28 17:07:37 +03:00
Frédéric Rodrigo 8bb77b67a1
Diff update osm transportation name network linestring (#996)
Replacing materialized view by a tables with update from trigger on change only.

Differential update of `osm_transportation_name_linestring`, `osm_transportation_name_linestring` and `osm_transportation_name_linestring_genX`).

At the end of the transaction the dependent rows are updated.

The goal is to update more quickly the content of derivated tables by just updating the changing content. It replaces the update of materialized view because their need a full recompute (with lock issue).

It is the last part of the replacement of materialized view for the transportation layer.

It addresses #814 and a part of #809.
2020-09-28 15:56:10 +03:00
Frédéric Rodrigo 47cdfc2c8b
Move where condition from osm_transportation_name_linestring to materialized view osm_transportation_name_network (fix) (#993)
On PR #991 the differential update was not updated like the main code.

Make similar change to the update code.
2020-09-23 11:10:59 +03:00
zstadler d8b5e8e82d
openmaptiles-tools: consider MIN_ZOOM/MAX_ZOOM env (#992)
Allow MIN_ZOOM, and MAX_ZOOM to be overwritten from shell for `quickstart.sh`, `make generate-dc-config`, and other `docker-compose openmaptiles-tools` uses.

For example,
```
export MAX_ZOOM=14; ./quickstart.sh monaco
```
ignores the `MAX_ZOOM=14` environment variable and uses the `MAX_ZOOM=7` value from `.env` file

This PR will also make this code unecessary
5c640daf4f/.github/workflows/tests.yml (L26-L28)
2020-09-23 10:09:22 +03:00
swiss-knight 0245b21634
NOOP: Minor Makefile clean up (#994)
Minor fix.
2020-09-22 11:27:45 +03:00
Eva Jelinkova f7d7a0ced3
Housenumbers - diff update, multipolygons (#990)
Following https://github.com/openmaptiles/openmaptiles/pull/983 - removing points also on multipolygons and checking only new geometry when updated.
2020-09-21 14:47:55 +03:00
zstadler 45f5b53c9c
Stitch `transportation_name` by all language tags (#989)
When OSM roads in the `transportation_name` layer are stitched together, their grouping does not consider all `name:*` tags.
As a result, roads with different `name:*` tags may be stitched together.

The `waterway` layer performs the grouping properly, for the same purpose:
1685eaccbd/layers/waterway/update_important_waterway.sql (L34)

Co-authored-by: Frédéric Rodrigo <fred.rodrigo@gmail.com>
2020-09-21 12:38:13 +03:00
Frédéric Rodrigo 5c640daf4f
Move where condition from osm_transportation_name_linestring to materialized view osm_transportation_name_network (#991)
Reduce the size of the materialized view osm_transportation_name_network by moving the weare clause.
osm_transportation_name_network is only used for osm_transportation_name_linestring.

Co-authored-by: zstadler <zeev.stadler@gmail.com>
2020-09-21 10:02:20 +03:00
Frédéric Rodrigo 550b1f8f90
Replace materialized view osm_transportation_name_network by a table with diff update (#987)
Replacing materialized view by a tables with update from trigger on change only.

The osm_id of object changing on table osm_route_member and osm_highway_linestring are logged.
At the end of the transaction the dependent row of osm_transportation_name_network are updated.

The goal is to update more quickly the content of derivated tables by just updating the changing content. It replaces the update of materialized view because their need a full recompute (with lock issue).

Note, it is only a part of the materialized view of the transportation layer, I am also working on the other parts, other parts are in #892 (omaterialized view on sm_transportation_name_linestring and osm_transportation_name_linestring_genX).

It addresses #814 and a part of #809.
2020-09-18 16:49:55 +03:00
Taro Matsuzawa aka. btm 1685eaccbd
#766 remove housenumbers inside polygon and same number (#983) 2020-09-16 17:06:48 +02: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 df56b75719
Clean update_route_member.sql (#981)
Clean and do refactoring on `update_route_member.sql` as first step to replace materialized view osm_transportation_name_network by tables with diff update. See #892.
2020-09-14 19:13:32 +03:00
Taro Matsuzawa aka. btm 7b2df3b64f
write how to generate dc-config (#982)
Added document about how to generate dc-config in QUICKSTART.md.
2020-09-14 18:20:24 +03:00
Jorge Sanz bd444c0d1a
Show more state borders at low zoom levels (#979)
* Change NE 50m by NE 10m state provinces dataset

* update documentation

Fixes #977 

This PR implements the change discussed at #977 to replace Natural Earth 10m states and provinces by the 50m version, since the 10m only covers state borders for US, Canada, Brazil, and Australia.

A few remarks:

* This change only affects zooms 1 to 4, not making any change in borders based in the `OSM Borders`  source. 
* The `min_zoom<=7` shows the first level regions (level 4 in OSM) as you can check for example for France, Italy, or Spain.
* I don't think it's necessary to simplify the geometries, it would mean adding a new materialized view, or a slower tile generation process.
* This change does not need any change in the styles, even someone could argue it could be interesting to add the country code in this layer as a new field, allowing style editors to filter features by country, but I would prefer to leave that change for another PR.
2020-09-10 09:41:43 +03:00
Eva Jelinkova 1356d724d4
adding disputed_name to NE sources (#976)
`disputed_name` is filled for disputed lines of NaturalEarth sources - it contains `ogc_fid` as suggested in https://github.com/openmaptiles/openmaptiles/issues/964. This way it is possible to filter disputed lines in style.
2020-09-03 21:09:15 +03:00
zstadler de95843e02
Allow setting TILESET_FILE by shell or Makefile (#975)
Following the 10efc29280 (r41977444) comment
2020-09-02 13:14:55 -04:00
Jorge Sanz 194b2fbb70
Add state labels at low zoom levels (#969)
* Remove state labels zoom, rank, and country conditions from layer function

* Don't add labels for zooms 0 and 1

If we check Bright, Positron, or Dark styles, they all show a huge lack of data about states and regions. At zoom 2, for big countries like Canada, Brazil, China or Australia there are big patches of white space (aka cartographer's *horror vacui* 😅)
2020-09-02 09:02:43 +03:00