geonames icon indicating copy to clipboard operation
geonames copied to clipboard

Support multiple countryCodes

Open arnesetzer opened this issue 2 years ago • 3 comments

:wave: I did some awesome work for the Pelias project and would love for everyone to have a look at it and provide feedback.


Here's the reason for this change :rocket:

  • Finished the requested changes on #365
  • Closes #360

Here's what actually got changed :clap:

  • Now the downloader and importer only accept an array.
  • The function lib/countryCodeArrayCreator.js creates the array, if not provided, and validates all iso codes.

Sorry, that this is a new PR, but I didn't figured out how to hang on the old PR

arnesetzer avatar Jan 16 '23 12:01 arnesetzer

In case anybody has the same problem: I made a little workaround shell script, which basically just loops over all CountryCodes, puts them in the pelias.json and runs the downloader & importer. Requires jq and the pelias docker image installed.

#!/bin/bash
for i in DE AT CH CZ;
do
        #echo "$i"
        jq '.imports.geonames.countryCode="'"$i"'"' pelias.json
        pelias download geonames
        pelias import geonames
done

arnesetzer avatar Mar 09 '23 09:03 arnesetzer

Why is this has been blocked ?

Thanks @arnesetzer , in my case (Ubuntu) I had to do :

for i in FR DE NL;
do
    cat <<< $(jq '.imports.geonames.countryCode="'"$i"'"' pelias.json) > pelias.json
    pelias download geonames
    pelias import geonames
done

stouch avatar Jun 23 '23 16:06 stouch

Ah, my bad. Forgot to convert it to a draft. The download works as expected, but if you try to import geonames It throws an expection due to a reuse of the elasticsearch config. I found this issue, but it won't change anything.

arnesetzer avatar Jun 30 '23 09:06 arnesetzer