From 3bde2d68c05c00fff9184dcee7ba72df5d3d6b3f Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sun, 21 Sep 2014 12:40:34 +0200 Subject: [PATCH] Fix geonames_process.awk It missed several big towns because of a wrong condition --- data/geonames/Makefile.am | 8 ++++---- data/geonames/geonames_process.awk | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/geonames/Makefile.am b/data/geonames/Makefile.am index 4afe4b8..2fa641b 100644 --- a/data/geonames/Makefile.am +++ b/data/geonames/Makefile.am @@ -45,16 +45,16 @@ allCountries.zip: fi; \ fi; -cities.txt: allCountries.zip +allCountries.txt: allCountries.zip $(AM_V_GEN) if test -x $(UNZIP); then \ $(UNZIP) allCountries.zip; \ else \ echo "unzip could not be found in your PATH."; \ echo "It is needed to create geodata.xml!"; \ fi; \ - if test -f allCountries.txt; then \ - $(AWK) -f geonames_process.awk allCountries.txt > $@ ; \ - fi + +cities.txt: allCountries.txt + $(AWK) -f geonames_process.awk allCountries.txt > $@ ; \ geodata.xml: countryInfo.txt timeZones.txt cities.txt $(AM_V_GEN) if test -x "$(PERL)"; then \ diff --git a/data/geonames/geonames_process.awk b/data/geonames/geonames_process.awk index c503559..8ebae28 100644 --- a/data/geonames/geonames_process.awk +++ b/data/geonames/geonames_process.awk @@ -2,6 +2,6 @@ BEGIN { FS="\t" } { - if ($7 != "P" || ($8 != "PPL" && $8 != "PPLC") || $15 < 1000) next + if ($7 != "P" || ($8 != "PPL" && $8 != "PPLC" && substr($8, 0, 4) != "PPLA") || $15 < 1000) next print $9 FS $2 FS $5 FS $6 FS $16 FS $18 }