Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (15 sloc) 716 Bytes
install: uninstall
@echo STATUS=Downloading
mkdir -p src tmp
cd src && wget -q https://biogeo.ucdavis.edu/data/gadm3.6/gadm36_levels_gpkg.zip
@echo STATUS=Importing
unzip -o src/gadm36_levels_gpkg.zip -d tmp
ogr2ogr -f PostgreSQL -overwrite $(POSTGRES_OGR) -lco SCHEMA=gadm tmp/gadm36_levels.gpkg
uninstall:
@echo STATUS=Uninstalling
psql "$(POSTGRES_URI)" -c 'DROP TABLE IF EXISTS gadm.level0'
psql "$(POSTGRES_URI)" -c 'DROP TABLE IF EXISTS gadm.level1'
psql "$(POSTGRES_URI)" -c 'DROP TABLE IF EXISTS gadm.level2'
psql "$(POSTGRES_URI)" -c 'DROP TABLE IF EXISTS gadm.level3'
psql "$(POSTGRES_URI)" -c 'DROP TABLE IF EXISTS gadm.level4'
psql "$(POSTGRES_URI)" -c 'DROP TABLE IF EXISTS gadm.level5'
You can’t perform that action at this time.