From 28d9ef12c062cdaeb4d68bc5c99c3d3ec1b188ff Mon Sep 17 00:00:00 2001 From: Al Date: Thu, 8 Dec 2016 02:31:10 -0500 Subject: [PATCH] [geoplanet] fixing geoplanet aliases insert warning --- scripts/geodata/geoplanet/create_geoplanet_db.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/geodata/geoplanet/create_geoplanet_db.sh b/scripts/geodata/geoplanet/create_geoplanet_db.sh index ce405484..d069f06a 100755 --- a/scripts/geodata/geoplanet/create_geoplanet_db.sh +++ b/scripts/geodata/geoplanet/create_geoplanet_db.sh @@ -22,10 +22,11 @@ GEOPLANET_ZIP_FILE="geoplanet_data_7.10.0.zip" GEOPLANET_URL="https://archive.org/download/$GEOPLANET_ZIP_FILE/$GEOPLANET_ZIP_FILE" GEOPLANET_ORIGINAL_PLACES_FILE="geoplanet_places_7.10.0.tsv" GEOPLANET_ADMINS_FILE="geoplanet_admins_7.10.0.tsv" -GEOPLANET_ALIASES_FILE="geoplanet_aliases_7.10.0.tsv" +GEOPLANET_ORIGINAL_ALIASES_FILE="geoplanet_aliases_7.10.0.tsv" GEOPLANET_PLACES_FILE="geoplanet_places.tsv" GEOPLANET_POSTAL_CODES_FILE="geoplanet_postal_codes.tsv" +GEOPLANET_ALIASES_FILE="geoplanet_aliases.tsv" GEOPLANET_GEONAMES_CONCORDANCE_FILE="geonames-geoplanet-matches.csv" GEOPLANET_GEONAMES_CONCORDANCE_URL="https://github.com/blackmad/geoplanet-concordance/raw/master/current/$GEOPLANET_GEONAMES_CONCORDANCE_FILE" @@ -57,6 +58,9 @@ awk -F'\t' 'BEGIN{OFS="\t";} {if ($5 == "Zip") print $0;}' $GEOPLANET_ORIGINAL_P echo "Creating GeoPlanet places file" awk -F'\t' 'BEGIN{OFS="\t";} {if ($5 == "Continent" || $5 == "Country" || $5 == "Nationality" || $5 == "State" || $5 == "County" || $5 == "Town" || $5 == "LocalAdmin" || $5 == "Island" || $5 == "Suburb") print $0;}' $GEOPLANET_ORIGINAL_PLACES_FILE > $GEOPLANET_PLACES_FILE +echo "Creating GeoPlanet aliases file" +tail +2 $GEOPLANET_ORIGINAL_ALIASES_FILE > $GEOPLANET_ALIASES_FILE + echo "Fetching GeoNames concordance" download_file $GEOPLANET_GEONAMES_CONCORDANCE_URL $GEOPLANET_GEONAMES_CONCORDANCE_FILE