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 }