geoparsepy is a Python geoparsing library that will extract and disambiguate locations from text. It uses a local OpenStreetMap database which allows very high and unlimited geoparsing throughput, unlike approaches that use a third-party geocoding service (e.g. Google Geocoding API). this repository holds Python examples to use the PyPI library.
Other
54
stars
4
forks
source link
Minor issues getting getting the .sql files to load correctly #5
There are a couple issues with BOM and the username. I was using a docker image to host the postgres, and ran this to pre-process the .sql files and it worked correctly after that.
Replace postgres with your username of choice.
fixed_dir=./data/fixed
mkdir -p $fixed_dir
sed '1s/^\xEF\xBB\xBF//' < ./data/global_cities.sql > ${fixed_dir}/global_cities.sql
sed '1s/^\xEF\xBB\xBF//' < ./data/uk_places.sql > ${fixed_dir}/uk_places.sql
sed '1s/^\xEF\xBB\xBF//' < ./data/north_america_places.sql > ${fixed_dir}/north_america_places.sql
sed '1s/^\xEF\xBB\xBF//' < ./data/europe_places.sql > ${fixed_dir}/europe_places.sql
sed 's/TO sem/TO postgres/' -i ${fixed_dir}/global_cities.sql
sed 's/TO sem/TO postgres/' -i ${fixed_dir}/uk_places.sql
sed 's/TO sem/TO postgres/' -i ${fixed_dir}/north_america_places.sql
sed 's/TO sem/TO postgres/' -i ${fixed_dir}/europe_places.sql
There are a couple issues with BOM and the username. I was using a docker image to host the postgres, and ran this to pre-process the
.sql
files and it worked correctly after that.Replace
postgres
with your username of choice.