Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
6,185 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SELECT * FROM "VOIRIE_AXE" WHERE | ||
("RUE_NOM1" <> '' AND "RUE_NOM1" IS NOT NULL) OR ("RUE_NOM2" <> '' AND "RUE_NOM2" IS NOT NULL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/sh | ||
|
||
# Make script directory working directory | ||
|
||
cd `dirname "$(realpath $0)"` | ||
|
||
# Download Kosovo extract | ||
|
||
if [ ! -f "kosovo-latest.osm.pbf" ]; then | ||
wget https://download.geofabrik.de/europe/kosovo-latest.osm.pbf | ||
fi | ||
|
||
# Convert to GeoJSON | ||
|
||
if [ -f "./kosovo-lines.geojson" ]; then rm "./kosovo-lines.geojson"; fi | ||
if [ -f "./kosovo-polygons.geojson" ]; then rm "./kosovo-polygons.geojson"; fi | ||
|
||
ogr2ogr -f "GeoJSON" -progress \ | ||
-sql "SELECT name, highway FROM lines WHERE highway IS NOT NULL" \ | ||
"./kosovo-lines.geojson" \ | ||
"./kosovo-latest.osm.pbf" | ||
ogr2ogr -f "GeoJSON" -progress \ | ||
-sql "SELECT name, hstore_get_value(other_tags, 'highway') AS highway FROM multipolygons WHERE hstore_get_value(other_tags, 'highway') is not null" \ | ||
"./kosovo-polygons.geojson" \ | ||
"./kosovo-latest.osm.pbf" | ||
|
||
# Generate buffer | ||
|
||
node "../../script/buffer.js" --radius=20 "./kosovo-lines.geojson" "kosovo-lines-buffers.geojson" | ||
node "../../script/buffer.js" --radius=5 "./kosovo-polygons.geojson" "kosovo-polygons-buffers.geojson" | ||
|
||
# Generate vector tiles | ||
|
||
tippecanoe --force --no-feature-limit --no-tile-size-limit \ | ||
--maximum-zoom=14 --minimum-zoom=14 \ | ||
--layer="buffers" \ | ||
--output="./kosovo-buffers.mbtiles" \ | ||
"./kosovo-lines-buffers.geojson" "./kosovo-polygons-buffers.geojson" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/sh | ||
|
||
# MAPROULETTE_CHALLENGE=14646 | ||
|
||
# Make script directory working directory | ||
|
||
cd `dirname "$(realpath $0)"` | ||
|
||
# Download & unzip data | ||
|
||
mkdir -p "./source/" | ||
|
||
# Convert to GeoJSON | ||
|
||
if [ -d "./temp" ]; then rm -r "./temp/"; fi | ||
|
||
mkdir -p "./temp/" | ||
|
||
for file in ./source/RoadSegmentView_*.gpkg ; do | ||
if [ -f $file ]; then | ||
fname=$(basename "$file" ".gpkg") | ||
|
||
ogr2ogr -f "GeoJSON" -progress \ | ||
-dim "XY" \ | ||
-lco COORDINATE_PRECISION=6 \ | ||
"./temp/$fname.geojson" \ | ||
"$file" | ||
fi | ||
done | ||
|
||
for file in ./temp/RoadSegmentView_*.geojson ; do | ||
if [ -f $file ]; then | ||
ogr2ogr -progress -append "./temp/RoadSegmentView.geojson" "$file" | ||
fi | ||
done | ||
|
||
# Convert fields to OpenStreetMap tags | ||
|
||
node "../../script/convert-tags.js" -c "./convert.json" "./temp/RoadSegmentView.geojson" "RoadSegmentViewTagged.geojson" | ||
|
||
# Generate vector tiles | ||
|
||
tippecanoe --force --no-feature-limit --no-tile-size-limit \ | ||
--buffer=0 \ | ||
--maximum-zoom=14 --minimum-zoom=14 \ | ||
--layer="roads" \ | ||
--output="./temp/RoadSegmentViewTagged.mbtiles" \ | ||
"./temp/RoadSegmentViewTagged.geojson" | ||
|
||
# Difference | ||
|
||
if [ -d "./difference" ]; then rm -r "./difference"; fi | ||
|
||
mkdir -p "./difference" | ||
|
||
node "../../script/difference.js" --output-dir="./difference" "./temp/RoadSegmentViewTagged.mbtiles" "kosovo-buffers.mbtiles" |
Submodule scripts
added at
4aa459