diff --git a/.vscode/settings.json b/.vscode/settings.json index b795faa..dec257f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,6 +14,7 @@ "hinanbasho", "Maxar", "naturalearthdata", + "opencellid", "openstreetmap", "seamlessphoto", "shapefile", diff --git a/Makefile b/Makefile index 1204dfb..0bfefb8 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/lib/data/ucdp.uu.se/ged231-csv.zip/index.yaml b/lib/data/ucdp.uu.se/ged231-csv.zip/index.yaml index cbfddfd..709ed29 100644 --- a/lib/data/ucdp.uu.se/ged231-csv.zip/index.yaml +++ b/lib/data/ucdp.uu.se/ged231-csv.zip/index.yaml @@ -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 diff --git a/lib/tasks/opencellid_full/pmtiles/Makefile b/lib/tasks/opencellid_full/pmtiles/Makefile new file mode 100644 index 0000000..39b23d5 --- /dev/null +++ b/lib/tasks/opencellid_full/pmtiles/Makefile @@ -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 diff --git a/lib/tasks/ucdp_ged_23_1/pmtiles/Makefile b/lib/tasks/ucdp_ged_23_1/pmtiles/Makefile new file mode 100644 index 0000000..ba3c82a --- /dev/null +++ b/lib/tasks/ucdp_ged_23_1/pmtiles/Makefile @@ -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