This is an automated email from the ASF dual-hosted git repository. bchapuis pushed a commit to branch release-0.7.3 in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git
commit 41547fe28f4b5d3d193eba37e146ef0ce8174db1 Author: Bertil Chapuis <[email protected]> AuthorDate: Tue Apr 9 21:40:14 2024 +0200 Fix the test scripts --- basemap/index.html | 85 ++++++++++++++++++++++++++++++++++++ basemap/style.json | 1 + basemap/tiles.json | 1 + examples/ip-to-location/workflow.js | 5 ++- examples/naturalearth/workflow.json | 3 +- examples/openstreetmap/index.html | 85 ++++++++++++++++++++++++++++++++++++ examples/openstreetmap/style.json | 27 +----------- examples/openstreetmap/tiles.json | 1 + examples/openstreetmap/workflow.json | 6 ++- examples/shadedrelief/workflow.json | 3 +- scripts/test-basemap.sh | 5 ++- scripts/test-examples.sh | 8 +++- 12 files changed, 195 insertions(+), 35 deletions(-) diff --git a/basemap/index.html b/basemap/index.html new file mode 100644 index 00000000..f903e4c5 --- /dev/null +++ b/basemap/index.html @@ -0,0 +1,85 @@ +<!DOCTYPE html> +<!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to you 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. +--> +<html> +<head> + <script src='https://unpkg.com/[email protected]/dist/maplibre-gl.js'></script> + <script src='https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.js'></script> + <script src='https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.js'></script> + <link href='https://unpkg.com/[email protected]/dist/maplibre-gl.css' rel='stylesheet' /> + <link href='https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.css' rel='stylesheet' /> + <link href='https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.css' rel='stylesheet' /> + <link rel="icon" type="image/x-icon" href="https://baremaps.apache.org/assets/favicon/favicon.ico"> + <style> + + body { + margin: 0; + } + + #map { + position: fixed; + width: 100%; + height: 100%; + } + + </style> + <title>Baremaps</title> +</head> +<body> +<div id="map"></div> +<script> + + // Load the right-to-left plugin if necessary. + if (maplibregl.getRTLTextPluginStatus() === 'unavailable') { + maplibregl.setRTLTextPlugin( + 'https://unpkg.com/@mapbox/[email protected]/mapbox-gl-rtl-text.min.js', + null, + true + ); + } + + // Initialize the map + let map = new maplibregl.Map({ + container: 'map', + style: '/style.json', + hash: true + }); + + + // Add the navigation control to the map + map.addControl(new maplibregl.NavigationControl()); + + // Add the inspect control to the map + map.addControl(new MaplibreInspect({ + showMapPopup: true, + showMapPopupOnHover: false, + showInspectMapPopupOnHover: false, + popup: new maplibregl.Popup({ + closeButton: true, + closeOnClick: true, + maxWidth: 'none' + }) + })); + + // Add the tile boundaries control to the map + map.addControl(new MaplibreTileBoundaries({ + showBoundaries: false + })); + +</script> +</body> +</html> diff --git a/basemap/style.json b/basemap/style.json new file mode 100644 index 00000000..948e4f26 --- /dev/null +++ b/basemap/style.json @@ -0,0 +1 @@ +{"version":8,"name":"OpenStreetMapVecto","sources":{"baremaps":{"type":"vector","url":"http://localhost:9000/tiles.json"}},"sprite":"https://baremaps.apache.org/assets/icons/icons","glyphs":"https://baremaps.apache.org/assets/fonts/{fontstack}/{range}.pbf","layers":[{"id":"background","type":"background","source":"baremaps","layout":{"visibility":"visible"},"minzoom":0,"maxzoom":24,"paint":{"background-color":"rgb(242, 239, 233)"}},{"id":"power_plant","type":"fill","filter":["any",["==", [...] \ No newline at end of file diff --git a/basemap/tiles.json b/basemap/tiles.json new file mode 100644 index 00000000..f2886684 --- /dev/null +++ b/basemap/tiles.json @@ -0,0 +1 @@ +{"tilejson":"2.2.0","attribution":"© <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a>","tiles":["http://localhost:9000/tiles/{z}/{x}/{y}.mvt"],"minzoom":0,"maxzoom":14,"bounds":[6.02260949059,45.7769477403,10.4427014502,47.8308275417],"center":[6.6323,46.5197,14.0],"database":"jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps","vector_layers":[{"id":"aerialway","queries":[{"minzoom":13,"maxzoom":20,"sql":"SELECT id, tags, geom FROM osm_ways WHERE tags [...] \ No newline at end of file diff --git a/examples/ip-to-location/workflow.js b/examples/ip-to-location/workflow.js index eaac5c3e..4de60503 100644 --- a/examples/ip-to-location/workflow.js +++ b/examples/ip-to-location/workflow.js @@ -62,7 +62,8 @@ export default {"steps": [ return { type: "DownloadUrl", source: nic.url, - target: `downloads/${nic.filename}.gz` + target: `downloads/${nic.filename}.gz`, + replaceExisting: true } }), ...nics.map(nic => { @@ -77,7 +78,7 @@ export default {"steps": [ type: "DownloadUrl", source: "https://download.geonames.org/export/dump/allCountries.zip", target: "downloads/geonames-allcountries.zip", - force: true + replaceExisting: true }, { type: "DecompressFile", diff --git a/examples/naturalearth/workflow.json b/examples/naturalearth/workflow.json index d3b6ee04..d899e974 100644 --- a/examples/naturalearth/workflow.json +++ b/examples/naturalearth/workflow.json @@ -7,7 +7,8 @@ { "type": "DownloadUrl", "source": "https://naciscdn.org/naturalearth/packages/natural_earth_vector.gpkg.zip", - "target": "natural_earth_vector.gpkg.zip" + "target": "natural_earth_vector.gpkg.zip", + "replaceExisting": true }, { "type": "DecompressFile", diff --git a/examples/openstreetmap/index.html b/examples/openstreetmap/index.html new file mode 100644 index 00000000..f903e4c5 --- /dev/null +++ b/examples/openstreetmap/index.html @@ -0,0 +1,85 @@ +<!DOCTYPE html> +<!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to you 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. +--> +<html> +<head> + <script src='https://unpkg.com/[email protected]/dist/maplibre-gl.js'></script> + <script src='https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.js'></script> + <script src='https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.js'></script> + <link href='https://unpkg.com/[email protected]/dist/maplibre-gl.css' rel='stylesheet' /> + <link href='https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.css' rel='stylesheet' /> + <link href='https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.css' rel='stylesheet' /> + <link rel="icon" type="image/x-icon" href="https://baremaps.apache.org/assets/favicon/favicon.ico"> + <style> + + body { + margin: 0; + } + + #map { + position: fixed; + width: 100%; + height: 100%; + } + + </style> + <title>Baremaps</title> +</head> +<body> +<div id="map"></div> +<script> + + // Load the right-to-left plugin if necessary. + if (maplibregl.getRTLTextPluginStatus() === 'unavailable') { + maplibregl.setRTLTextPlugin( + 'https://unpkg.com/@mapbox/[email protected]/mapbox-gl-rtl-text.min.js', + null, + true + ); + } + + // Initialize the map + let map = new maplibregl.Map({ + container: 'map', + style: '/style.json', + hash: true + }); + + + // Add the navigation control to the map + map.addControl(new maplibregl.NavigationControl()); + + // Add the inspect control to the map + map.addControl(new MaplibreInspect({ + showMapPopup: true, + showMapPopupOnHover: false, + showInspectMapPopupOnHover: false, + popup: new maplibregl.Popup({ + closeButton: true, + closeOnClick: true, + maxWidth: 'none' + }) + })); + + // Add the tile boundaries control to the map + map.addControl(new MaplibreTileBoundaries({ + showBoundaries: false + })); + +</script> +</body> +</html> diff --git a/examples/openstreetmap/style.json b/examples/openstreetmap/style.json index f64b679f..15341d1d 100644 --- a/examples/openstreetmap/style.json +++ b/examples/openstreetmap/style.json @@ -1,26 +1 @@ -{ - "version" : 8, - "sources" : { - "baremaps" : { - "type" : "vector", - "url" : "http://localhost:9000/tiles.json" - } - }, - "layers" : [ { - "id" : "building", - "type" : "fill", - "source" : "baremaps", - "source-layer" : "building", - "layout" : { - "visibility" : "visible" - }, - "paint" : { - "fill-color" : "rgba(255, 0, 0, 1)" - } - } ], - "center" : [ 9.5554, 47.166 ], - "metadata" : { - "maputnik:renderer" : "mbgljs" - }, - "zoom" : 14 -} \ No newline at end of file +{"version":8,"sources":{"baremaps":{"type":"vector","url":"http://localhost:9000/tiles.json"}},"layers":[{"id":"building","type":"fill","source":"baremaps","source-layer":"building","layout":{"visibility":"visible"},"paint":{"fill-color":"rgba(255, 0, 0, 1)"}}],"center":[9.5554,47.166],"metadata":{"maputnik:renderer":"mbgljs"},"zoom":14} \ No newline at end of file diff --git a/examples/openstreetmap/tiles.json b/examples/openstreetmap/tiles.json new file mode 100644 index 00000000..51650f83 --- /dev/null +++ b/examples/openstreetmap/tiles.json @@ -0,0 +1 @@ +{"tilejson":"2.2.0","tiles":["http://localhost:9000/tiles/{z}/{x}/{y}.mvt"],"minzoom":12,"maxzoom":14,"bounds":[9.471078,47.04774,9.636217,47.27128],"center":[9.5554,47.166,14.0],"database":"jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps","vector_layers":[{"id":"aeroway","queries":[{"minzoom":12,"maxzoom":20,"sql":"SELECT id, tags, geom FROM osm_nodes WHERE tags ? 'aeroway'"},{"minzoom":12,"maxzoom":20,"sql":"SELECT id, tags, geom FROM osm_ways WHERE tags ? 'a [...] \ No newline at end of file diff --git a/examples/openstreetmap/workflow.json b/examples/openstreetmap/workflow.json index ca62ac08..3b0f6ef6 100644 --- a/examples/openstreetmap/workflow.json +++ b/examples/openstreetmap/workflow.json @@ -7,7 +7,8 @@ { "type": "DownloadUrl", "source": "https://download.geofabrik.de/europe/liechtenstein-latest.osm.pbf", - "target": "liechtenstein-latest.osm.pbf" + "target": "liechtenstein-latest.osm.pbf", + "replaceExisting": true } ] }, @@ -21,7 +22,8 @@ "type": "ImportOsmPbf", "file": "liechtenstein-latest.osm.pbf", "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps", - "databaseSrid": 3857 + "databaseSrid": 3857, + "replaceExisting": true } ] }, diff --git a/examples/shadedrelief/workflow.json b/examples/shadedrelief/workflow.json index b530fac6..2158afbd 100644 --- a/examples/shadedrelief/workflow.json +++ b/examples/shadedrelief/workflow.json @@ -7,7 +7,8 @@ { "type": "DownloadUrl", "source": "http://www.shadedrelief.com/ne-draft/World-Base-Map-Shapefiles.zip", - "target": "shadedrelief.zip" + "target": "shadedrelief.zip", + "replaceExisting": true }, { "type": "DecompressFile", diff --git a/scripts/test-basemap.sh b/scripts/test-basemap.sh index 46554bcc..6f8b495d 100755 --- a/scripts/test-basemap.sh +++ b/scripts/test-basemap.sh @@ -38,9 +38,10 @@ echo "--------------------------------------------------------------------" echo "" nohup baremaps map dev --tileset 'tileset.js' --style 'style.js' > /dev/null 2>&1 & -sleep 1 baremaps=$! +sleep 10 + echo "Get the status of the root (/):" curl -I http://localhost:9000/ @@ -66,6 +67,7 @@ echo "" baremaps map export \ --tileset 'tileset.js' \ + --style 'style.js' \ --repository 'tiles/' \ --format file @@ -73,6 +75,7 @@ du -h tiles baremaps map export \ --tileset 'tileset.js' \ + --style 'style.js' \ --repository 'tiles.mbtiles' \ --format mbtiles diff --git a/scripts/test-examples.sh b/scripts/test-examples.sh index 101c58bc..19840443 100755 --- a/scripts/test-examples.sh +++ b/scripts/test-examples.sh @@ -35,9 +35,10 @@ echo "--------------------------------------------------------------------" echo "" nohup baremaps map dev --tileset 'tileset.json' --style 'style.json' > /dev/null 2>&1 & -sleep 1 baremaps=$! +sleep 1 + echo "Get the status of the root (/):" curl -I http://localhost:9000/ @@ -63,6 +64,7 @@ echo "" baremaps map export \ --tileset 'tileset.json' \ + --style 'style.json' \ --repository 'tiles/' echo "Display the size of the tiles:" @@ -76,6 +78,7 @@ echo "" baremaps map export \ --tileset 'tileset.json' \ + --style 'style.json' \ --repository 'tiles.mbtiles' \ --format mbtiles @@ -101,8 +104,8 @@ echo "--------------------------------------------------------------------" echo "" nohup baremaps map dev --tileset 'tileset.json' --style 'style.json' > /dev/null 2>&1 & -sleep 1 baremaps=$! +sleep 1 echo "Get the status of the root (/):" curl -I http://localhost:9000/ @@ -129,6 +132,7 @@ echo "" baremaps map export \ --tileset 'tileset.json' \ + --style 'style.json' \ --repository 'tiles/' echo "Display the size of the tiles:"
