Skip to content

Commit

Permalink
make the ends and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
amandasaurus committed Jan 7, 2024
1 parent d4ca1d7 commit a86f8ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
23 changes: 20 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ planet-waterway-missing-wiki.geojsons: planet-waterway.osm.pbf
mv tmp.$@ $@

planet-cycles.geojsons planet-upstreams.geojsons planet-ends.geojsons: planet-waterway.osm.pbf
rm -fv tmp.planet-cycles.geojsons
rm -fv tmp.planet-{cycles,upstreams,ends}.geojsons
./osm-lump-ways-down -i ./planet-waterway.osm.pbf -o tmp.planet-%s.geojsons -f waterway -f waterway∉dam,weir,lock_gate,sluice_gate,security_lock,fairway,dock,boatyard,fuel,riverbank,pond,check_dam,turning_point,water_point,spillway,safe_water,derelict_canal,offshore_field,boat_lift -f waterway∉canal,ditch,drain -f waterway∉put_in,link --openmetrics ./docs/data/waterwaymap.org_loops_metrics.prom --csv-stats-file ./docs/data/waterwaymap.org_loops_stats.csv
mv tmp.planet-cycles.geojsons planet-cycles.geojsons
mv tmp.planet-upstreams.geojsons planet-upstreams.geojsons
mv tmp.planet-ends.geojsons planet-ends.geojsons
mv tmp.planet-upstreams.geojsons planet-upstreams.geojsons || true
mv tmp.planet-ends.geojsons planet-ends.geojsons || true

planet-cycles.pmtiles: planet-cycles.geojsons
rm -fv tmp.$@
Expand Down Expand Up @@ -149,3 +149,20 @@ planet-upstreams.pmtiles: planet-upstreams.geojsons
--no-progress-indicator \
-o tmp.$@ $<
mv tmp.$@ $@

planet-ends.pmtiles: planet-ends.geojsons
rm -fv tmp.$@
timeout 8h tippecanoe \
-n "OSM Waterway Endpoints" \
-N "Generated on $(shell date -I) from OSM data with $(shell osm-lump-ways --version) and argument" \
-A "© OpenStreetMap. Open Data under ODbL. https://osm.org/copyright" \
-zg \
--no-feature-limit \
--simplification=8 \
--cluster-densest-as-needed \
-y from_upstream_m \
-l upstream_m \
--gamma 2 \
--no-progress-indicator \
-o tmp.$@ $<
mv tmp.$@ $@
3 changes: 2 additions & 1 deletion make-planet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ echo "Took $(units ${SECONDS}sec time) (${SECONDS}sec) to convert all geojsons t

SECONDS=0
rm -fv tmp.planet-cycles.geojson
make planet-cycles.pmtiles
make planet-cycles.pmtiles planet-cycles.geojsons
echo "Took $(units ${SECONDS}sec time) (${SECONDS}sec) to calculate cycles"

echo "All data files generated"

mv ./*pmtiles ./docs/data/ || true
mv ./planet-cycles.geojsons ./docs/data/
mv ./*zst* ./docs/data/ 2>/dev/null || true
ln -s ./docs/data/*.pmtiles ./ || true
ln -s ./docs/data/*.geojson ./ || true
Expand Down

0 comments on commit a86f8ad

Please sign in to comment.