This is an automated email from the ASF dual-hosted git repository. bchapuis pushed a commit to branch 745-daylight in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git
commit 37e3e5a386129f542841739429bc8e2437bbf51b Author: Bertil Chapuis <[email protected]> AuthorDate: Wed Aug 30 22:23:59 2023 +0200 Improve the workflow --- basemap/daylight-tileset.js | 65 ++++++ basemap/{daylight.js => daylight-workflow.js} | 272 +++++++++++++------------- basemap/layers/water/tileset.js | 6 +- 3 files changed, 203 insertions(+), 140 deletions(-) diff --git a/basemap/daylight-tileset.js b/basemap/daylight-tileset.js new file mode 100644 index 00000000..3f492f65 --- /dev/null +++ b/basemap/daylight-tileset.js @@ -0,0 +1,65 @@ +/** + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + in compliance with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under the License + is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing permissions and limitations under + the License. + **/ +import config from "./config.js"; + +import aerialway from "./layers/aerialway/tileset.js"; +import aeroway from "./layers/aeroway/tileset.js"; +import amenity from "./layers/amenity/tileset.js"; +import attraction from "./layers/attraction/tileset.js"; +import barrier from "./layers/barrier/tileset.js"; +import boundary from "./layers/boundary/tileset.js"; +import building from "./layers/building/tileset.js"; +import highway from "./layers/highway/tileset.js"; +import natural from "./layers/natural/tileset.js"; +import leisure from "./layers/leisure/tileset.js"; +import landuse from "./layers/landuse/tileset.js"; +import railway from "./layers/railway/tileset.js"; +import route from "./layers/route/tileset.js"; +import man_made from "./layers/man_made/tileset.js"; +import power from "./layers/power/tileset.js"; +import point from "./layers/point/tileset.js"; +import waterway from "./layers/waterway/tileset.js"; +import water from "./layers/water/tileset.js"; + + +export default { + "tilejson": "2.2.0", + "center": [...config.center, config.zoom], + "bounds": [...config.bounds], + "minzoom": 0.0, + "maxzoom": 14.0, + "tiles": [ + `${config.host}/tiles/{z}/{x}/{y}.mvt` + ], + attribution: '© <a href="https://www.openstreetmap.org/">OpenStreetMap</a> © <a href="https://www.geoboundaries.org">geoBoundaries</a>', + database: config.database, + "vector_layers": [ + aerialway, + aeroway, + amenity, + attraction, + barrier, + boundary, + building, + highway, + landuse, + leisure, + man_made, + natural, + water, + point, + power, + railway, + route, + waterway, + ] +} diff --git a/basemap/daylight.js b/basemap/daylight-workflow.js similarity index 63% rename from basemap/daylight.js rename to basemap/daylight-workflow.js index 2c6c5ba2..414b6a60 100644 --- a/basemap/daylight.js +++ b/basemap/daylight-workflow.js @@ -10,118 +10,143 @@ the License. **/ -let config = { - "database": "jdbc:postgresql://localhost:5432/daylight?user=daylight&password=daylight" -}; +import config from "./config.js"; export default { "steps": [ - // { - // "id": "openstreetmap-data", - // "needs": [], - // "tasks": [ - // { - // "type": "DownloadUrl", - // "url": "https://download.geofabrik.de/europe/liechtenstein-latest.osm.pbf", - // "path": "data/data.osm.pbf" - // }, - // { - // "type": "ImportOsmPbf", - // "file": "data/data.osm.pbf", - // "database": config.database, - // "databaseSrid": 3857 - // }, - // ] - // }, - // { - // "id": "openstreetmap-download", - // "needs": ["openstreetmap-data"], - // "tasks": [ - // { - // "type": "DownloadUrl", - // "url": "https://daylight-map-distribution.s3.us-west-1.amazonaws.com/release/v1.29/fb-ml-roads-v1.29.osc.bz2", - // "path": "data/roads.osc.bz2" - // }, - // { - // "type": "DownloadUrl", - // "url": "https://daylight-map-distribution.s3.us-west-1.amazonaws.com/release/v1.29/admin-v1.29.osc.bz2", - // "path": "data/admin.osc.bz2" - // }, - // { - // "type": "DownloadUrl", - // "url": "https://daylight-map-distribution.s3.us-west-1.amazonaws.com/release/v1.29/coastlines-v1.29.tgz", - // "path": "data/coastlines.tgz" - // }, - // { - // "type": "DownloadUrl", - // "url": "https://daylight-map-distribution.s3.us-west-1.amazonaws.com/release/v1.29/preferred-localization-v1.29.tsv", - // "path": "data/preferred-localization.tsv" - // }, - // { - // "type": "DownloadUrl", - // "url": "https://daylight-map-distribution.s3.us-west-1.amazonaws.com/release/v1.29/important-features-v1.29.json", - // "path": "data/important-features.json" - // }, - // ] - // }, - // { - // "id": "openstreetmap-decompress", - // "needs": ["openstreetmap-download"], - // "tasks": [ - // { - // "type": "DecompressFile", - // "compression": "bzip2", - // "source": "data/roads.osc.bz2", - // "target": "data/roads.osc" - // }, - // { - // "type": "DecompressFile", - // "compression": "bzip2", - // "source": "data/admin.osc.bz2", - // "target": "data/admin.osc" - // }, - // { - // "type": "DecompressFile", - // "compression": "targz", - // "source": "data/coastlines.tgz", - // "target": "data/coastlines" - // }, - // ] - // }, - // { - // "id": "openstreetmap-import", - // "needs": [], - // "tasks": [ - // { - // "type": "ImportOsmChange", - // "file": "data/roads.osc", - // "database": config.database, - // "srid": 3857 - // }, - // { - // "type": "ImportOsmChange", - // "file": "data/admin.osc", - // "database": config.database, - // "srid": 3857 - // }, - // ] - // }, - // { - // "id": "openstreetmap-coastlines", - // "needs": [], - // "tasks": [ - // { - // "type": "ImportShapefile", - // "file": "data/coastlines/water_polygons.shp", - // "database": config.database, - // "sourceSRID": 4326, - // "targetSRID": 3857 - // }, - // ] - // } { - "id": "openstreetmap-nodes", + "id": "openstreetmap-pbf", "needs": [], + "tasks": [ + { + "type": "DownloadUrl", + "url": "https://download.geofabrik.de/europe/liechtenstein-latest.osm.pbf", + "path": "data/data.osm.pbf" + }, + { + "type": "ImportOsmPbf", + "file": "data/data.osm.pbf", + "database": config.database, + "databaseSrid": 3857 + }, + ] + }, + { + "id": "openstreetmap-road", + "needs": ["openstreetmap-data"], + "tasks": [ + { + "type": "DownloadUrl", + "url": "https://daylight-map-distribution.s3.us-west-1.amazonaws.com/release/v1.29/fb-ml-roads-v1.29.osc.bz2", + "path": "data/roads.osc.bz2" + }, + { + "type": "DecompressFile", + "compression": "bzip2", + "source": "data/roads.osc.bz2", + "target": "data/roads.osc" + }, + { + "type": "ImportOsmChange", + "file": "data/roads.osc", + "database": config.database, + "srid": 3857 + }, + ] + }, + { + "id": "openstreetmap-admin", + "needs": ["openstreetmap-data"], + "tasks": [ + { + "type": "DownloadUrl", + "url": "https://daylight-map-distribution.s3.us-west-1.amazonaws.com/release/v1.29/admin-v1.29.osc.bz2", + "path": "data/admin.osc.bz2" + }, + { + "type": "DecompressFile", + "compression": "bzip2", + "source": "data/admin.osc.bz2", + "target": "data/admin.osc" + }, + { + "type": "ImportOsmChange", + "file": "data/admin.osc", + "database": config.database, + "srid": 3857 + }, + ] + }, + { + "id": "openstreetmap-coastlines", + "needs": ["openstreetmap-data"], + "tasks": [ + { + "type": "DownloadUrl", + "url": "https://daylight-map-distribution.s3.us-west-1.amazonaws.com/release/v1.29/coastlines-v1.29.tgz", + "path": "data/coastlines.tgz" + }, + { + "type": "DecompressFile", + "compression": "targz", + "source": "data/coastlines.tgz", + "target": "data/coastlines" + }, + { + "type": "ImportShapefile", + "file": "data/coastlines/water_polygons.shp", + "database": config.database, + "sourceSRID": 4326, + "targetSRID": 3857 + }, + { + "type": "ExecuteSql", + "file": "layers/water/clean.sql", + "database": config.database, + }, + { + "type": "ExecuteSql", + "file": "layers/water/prepare.sql", + "database": config.database, + }, + { + "type": "ExecuteSql", + "file": "layers/water/simplify.sql", + "database": config.database, + "parallel": true, + }, + { + "type": "ExecuteSql", + "file": "layers/water/index.sql", + "database": config.database, + }, + ] + }, + { + "id": "openstreetmap-preferred-localization", + "needs": ["openstreetmap-data"], + "tasks": [ + { + "type": "DownloadUrl", + "url": "https://daylight-map-distribution.s3.us-west-1.amazonaws.com/release/v1.29/preferred-localization-v1.29.tsv", + "path": "data/preferred-localization.tsv" + }, + ] + }, + { + "id": "openstreetmap-important-features", + "needs": ["openstreetmap-data"], + "tasks": [ + { + "type": "DownloadUrl", + "url": "https://daylight-map-distribution.s3.us-west-1.amazonaws.com/release/v1.29/important-features-v1.29.json", + "path": "data/important-features.json" + }, + ] + }, + { + "id": "openstreetmap-nodes", + "needs": ["openstreetmap-road","openstreetmap-admin"], "tasks": [ { "type": "ExecuteSql", @@ -133,7 +158,7 @@ export default { }, { "id": "openstreetmap-ways", - "needs": [], + "needs": ["openstreetmap-road","openstreetmap-admin"], "tasks": [ { "type": "ExecuteSql", @@ -145,7 +170,7 @@ export default { }, { "id": "openstreetmap-relations", - "needs": [], + "needs": ["openstreetmap-road","openstreetmap-admin"], "tasks": [ { "type": "ExecuteSql", @@ -157,7 +182,7 @@ export default { }, { "id": "openstreetmap-member", - "needs": [], + "needs": ["openstreetmap-road","openstreetmap-admin"], "tasks": [ { "type": "ExecuteSql", @@ -399,32 +424,5 @@ export default { }, ] }, - { - "id": "openstreetmap-water", - "needs": [], - "tasks": [ - { - "type": "ExecuteSql", - "file": "layers/water/clean.sql", - "database": config.database, - }, - { - "type": "ExecuteSql", - "file": "layers/water/prepare.sql", - "database": config.database, - }, - { - "type": "ExecuteSql", - "file": "layers/water/simplify.sql", - "database": config.database, - "parallel": true, - }, - { - "type": "ExecuteSql", - "file": "layers/water/index.sql", - "database": config.database, - }, - ] - }, ] } diff --git a/basemap/layers/water/tileset.js b/basemap/layers/water/tileset.js index db1675b7..75ac0733 100644 --- a/basemap/layers/water/tileset.js +++ b/basemap/layers/water/tileset.js @@ -14,11 +14,11 @@ export default { "queries": [ { "minzoom": 0, - "maxzoom": 10, - "sql": "SELECT id, tags, geom FROM osm_water_simplified" + "maxzoom": 12, + "sql": "SELECT id, tags, geom FROM osm_water_z$zoom" }, { - "minzoom": 10, + "minzoom": 12, "maxzoom": 20, "sql": "SELECT id, tags, geom FROM osm_water" }
