Skip to content

Commit

Permalink
Add tasks/**/pmtiles/Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
yuiseki committed Jun 15, 2024
1 parent ee5987b commit 3459250
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 8 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"hinanbasho",
"Maxar",
"naturalearthdata",
"opencellid",
"openstreetmap",
"seamlessphoto",
"shapefile",
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

subdirs = \
lib/ucdp.uu.se/ged231-csv.zip \
lib/download.geofabrik.de/asia/japan/kanto
SUBDIRS = \
./lib/tasks/opencellid_full/pmtiles/Makefile \
./lib/tasks/ucdp_ged_23_1/pmtiles/Makefile

all: $(subdirs)
all: $(SUBDIRS)

clean: $(subdirs)
$(SUBDIRS): FORCE
$(MAKE) -f $@ $(MAKECMDGOALS)

$(subdirs):
$(MAKE) -C $@ $(MAKECMDGOALS)
FORCE:
2 changes: 1 addition & 1 deletion lib/data/ucdp.uu.se/ged231-csv.zip/index.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data_id: ucdp-ged-23_1
data_id: ucdp_ged_23_1
license: CC-BY-4.0
attributions:
- Uppsala Conflict Data Program
Expand Down
29 changes: 29 additions & 0 deletions lib/tasks/opencellid_full/pmtiles/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

.PHONY: all
all: tmp/opencellid.org/cell_towers.pmtiles

tmp/opencellid.org/cell_towers.csv.gz:
mkdir -p tmp/opencellid.org
wget https://opencellid.org/downloads/cell_towers.csv.gz -O tmp/opencellid.org/cell_towers.csv.gz

tmp/opencellid.org/cell_towers.csv: tmp/opencellid.org/cell_towers.csv.gz
gunzip -c tmp/opencellid.org/cell_towers.csv.gz > tmp/opencellid.org/cell_towers.csv

tmp/opencellid.org/cell_towers.geojson: tmp/opencellid.org/cell_towers.csv
ogr2ogr \
-overwrite \
-f GeoJSON \
-oo X_POSSIBLE_NAMES=lon \
-oo Y_POSSIBLE_NAMES=lat \
tmp/opencellid.org/cell_towers.geojson \
tmp/opencellid.org/cell_towers.csv

tmp/opencellid.org/cell_towers.pmtiles: tmp/opencellid.org/cell_towers.geojson
tippecanoe \
-Z1 \
-z18 \
-pf \
-pk \
-P \
-o tmp/opencellid.org/cell_towers.pmtiless \
tmp/opencellid.org/cell_towers.geojson
31 changes: 31 additions & 0 deletions lib/tasks/ucdp_ged_23_1/pmtiles/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

.PHONY: all
all: tmp/ucdp.uu.se/GEDEvent_v23_1.pmtiles

tmp/ucdp.uu.se/ged231-csv.zip:
mkdir -p tmp/ucdp.uu.se
wget https://ucdp.uu.se/downloads/ged/ged231-csv.zip -O tmp/ucdp.uu.se/ged231-csv.zip

tmp/ucdp.uu.se/GEDEvent_v23_1.csv: tmp/ucdp.uu.se/ged231-csv.zip
unzip -f tmp/ucdp.uu.se/ged231-csv.zip -d tmp/ucdp.uu.se

tmp/ucdp.uu.se/GEDEvent_v23_1.geojson: tmp/ucdp.uu.se/GEDEvent_v23_1.csv
ogr2ogr \
-overwrite \
-f GeoJSON \
-oo X_POSSIBLE_NAMES=longitude \
-oo Y_POSSIBLE_NAMES=latitude \
-a_srs EPSG:4326 \
--debug ON \
tmp/ucdp.uu.se/GEDEvent_v23_1.geojson \
tmp/ucdp.uu.se/GEDEvent_v23_1.csv

tmp/ucdp.uu.se/GEDEvent_v23_1.pmtiles: tmp/ucdp.uu.se/GEDEvent_v23_1.geojson
tippecanoe \
-Z1 \
-z18 \
-pf \
-pk \
-P \
-o tmp/ucdp.uu.se/GEDEvent_v23_1.pmtiles \
tmp/ucdp.uu.se/GEDEvent_v23_1.geojson

0 comments on commit 3459250

Please sign in to comment.