From ebf245f29191292ab7e206c2e2b931b3b03062d9 Mon Sep 17 00:00:00 2001 From: ImreSamu Date: Sun, 20 May 2018 11:44:57 +0200 Subject: [PATCH] wikidata: updating "extra themes" : 50m_* ; 110m_* --- .gitignore | 1 + run_all.sh | 36 ++++++++++++++++++++++++++++++++++++ tools/wikidata/update.sh | 33 +++++++++++++++++++++++++++++---- 3 files changed, 66 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b0c392a4..333d7fdf 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ archive/10m_cultural_1.4.0.zip archive/* intermediate/* backup/* +x_tempshape/* \ No newline at end of file diff --git a/run_all.sh b/run_all.sh index 157fe805..c2187158 100755 --- a/run_all.sh +++ b/run_all.sh @@ -1,10 +1,46 @@ #!/bin/bash set -Eeuo pipefail + +STARTDATE=$(date +"%Y-%m-%dT%H:%M%z") + +# clean and recreate x_tempshape directory +rm -rf x_tempshape +mkdir -p x_tempshape +log_file=x_tempshape/run_all.log +##### backup log from here ... +exec &> >(tee -a "$log_file") + +# Don't forget update the VERSION file! +cat VERSION + +# Show some debug info python3 ./tools/wikidata/platform_debug_info.py + +# Fetch latest wikidata labels +# --- output: x_tempshape/*/*.new_names.csv files time ./tools/wikidata/update.sh fetch + +# Write wikidata labels to the shape files +# --- output: x_tempshape/*/*.shp files and some audit logs time ./tools/wikidata/update.sh write + +# show summary cat x_tempshape/update.md + +# list new files +ls -la x_tempshape/*/* + +# Update shape files cp -r x_tempshape/10m_cultural/* 10m_cultural/ cp -r x_tempshape/10m_physical/* 10m_physical/ +cp -r x_tempshape/50m_cultural/* 50m_cultural/ +cp -r x_tempshape/50m_physical/* 50m_physical/ +cp -r x_tempshape/110m_cultural/* 110m_cultural/ +cp -r x_tempshape/110m_physical/* 110m_physical/ + +# Run the final update process make clean all + +echo " ---- end of run_all.sh ------ " +ls -la $log_file \ No newline at end of file diff --git a/tools/wikidata/update.sh b/tools/wikidata/update.sh index aeed9c86..4af54783 100755 --- a/tools/wikidata/update.sh +++ b/tools/wikidata/update.sh @@ -135,8 +135,8 @@ function update_names { logmd=x_tempshape/update.md rm -f $logmd -# lettercase = uppercase variable names [WIKIDATAID, NAME_AR, NAME_BN, NAME_DE, NAME_EN, NAME_ES, ... ] -# lettercase = lowercase variable names [wikidataid, name_ar, name_bn, name_de, name_en, name_es ] +# lettercase = uppercase --> variable names [WIKIDATAID, NAME_AR, NAME_BN, NAME_DE, NAME_EN, NAME_ES, ... ] +# lettercase = lowercase --> variable names [wikidataid, name_ar, name_bn, name_de, name_en, name_es, ... ] # lettercase | input folder | output folder | shape_path | shape filename # ----------------------| ------------ | ------------- | -------------| --------------------------------------- @@ -171,8 +171,33 @@ update_names lowercase . x_tempshape 10m_cultural ne_10m_a -#cp -r x_tempshape/10m_cultural/* 10m_cultural/ -#cp -r x_tempshape/10m_physical/* 10m_physical/ +update_names uppercase . x_tempshape 50m_cultural ne_50m_admin_0_sovereignty.shp +update_names uppercase . x_tempshape 50m_cultural ne_50m_admin_0_countries.shp +update_names uppercase . x_tempshape 50m_cultural ne_50m_admin_0_countries_lakes.shp +update_names uppercase . x_tempshape 50m_cultural ne_50m_admin_0_map_units.shp +update_names uppercase . x_tempshape 50m_cultural ne_50m_admin_0_map_subunits.shp +update_names uppercase . x_tempshape 50m_cultural ne_50m_admin_0_tiny_countries.shp + +# missing / KeyError: 'WIKIDATAID' +#update_names uppercase . x_tempshape 50m_cultural ne_50m_admin_0_breakaway_disputed_areas.shp +#update_names uppercase . x_tempshape 50m_cultural ne_50m_admin_0_breakaway_disputed_areas_scale_rank.shp + +update_names lowercase . x_tempshape 50m_cultural ne_50m_admin_1_states_provinces.shp +update_names lowercase . x_tempshape 50m_cultural ne_50m_admin_1_states_provinces_lakes.shp +update_names lowercase . x_tempshape 50m_physical ne_50m_lakes.shp +update_names lowercase . x_tempshape 50m_physical ne_50m_lakes_historic.shp +update_names lowercase . x_tempshape 50m_physical ne_50m_playas.shp +update_names lowercase . x_tempshape 50m_physical ne_50m_rivers_lake_centerlines.shp +update_names lowercase . x_tempshape 50m_physical ne_50m_rivers_lake_centerlines_scale_rank.shp + +update_names uppercase . x_tempshape 110m_cultural ne_110m_admin_0_sovereignty.shp +update_names uppercase . x_tempshape 110m_cultural ne_110m_admin_0_countries.shp +update_names uppercase . x_tempshape 110m_cultural ne_110m_admin_0_countries_lakes.shp +update_names uppercase . x_tempshape 110m_cultural ne_110m_admin_0_map_units.shp +update_names lowercase . x_tempshape 110m_cultural ne_110m_admin_1_states_provinces.shp +update_names lowercase . x_tempshape 110m_cultural ne_110m_admin_1_states_provinces_lakes.shp +update_names lowercase . x_tempshape 110m_physical ne_110m_lakes.shp +update_names lowercase . x_tempshape 110m_physical ne_110m_rivers_lake_centerlines.shp #known problems: