[OSM-dev] Nominatim Install Problems
jason.surratt at spadac.com
Thu Dec 10 17:38:10 GMT 2009
I have about 4 million addresses that I need to geocode. These addresses are mostly in the US, but about 200K of them are in Europe and a smattering elsewhere. I already have an approach for geocoding US addresses, but I'd like to try using Nominatim for geocoding the non-US addresses.
Rather than inappropriately slamming the Nominatim server with bulk requests I'm trying to install Nominatim on one of my Linux boxes. However, I'm running into some problems getting it installed.
I installed osm2pgsql using the instructions here: http://wiki.openstreetmap.org/wiki/Osm2pgsql
Then I used this <http://svn.openstreetmap.org/applications/utils/export/osm2pgsql/gazetteer/README.txt> as a template for ingesting the planet-latest.osm data and building the indexes. The exact commands I've run are at the bottom of the email.
The only error messages of consequence that I receive relate to inserting data into placex from place during the gazetteer-index.sql. This appears to be due to an SRID constraint, but that seems appropriate as the tables have different SRIDs. The other ERROR messages relate to missing "IF EXISTS" in drop commands.
After the import completes I can access the search page and the searches complete, however it always returns an empty result set. I'm not sure what I should look at in the database for clues, but when poking around the word table it appears that only data related to the import*.sql files is available.
Any help would be greatly appreciated.
gazetteer/osm2pgsql - SVN revision 19015
Commands used for ingest:
pg_ctl -D /dfs/data1/pgsql-data/ -l /var/log/pgsql stop
rm -rf /dfs/data1/pgsql-data || exit -1
initdb -D /dfs/data1/pgsql-data || exit -1
pg_ctl -D /dfs/data1/pgsql-data/ -l /var/log/pgsql start
createuser -s osm || exit -1
createdb -E UTF8 -O osm gazetteer || exit -1
createlang plpgsql gazetteer || exit -1
psql -d gazetteer -f /usr/share/pgsql/contrib/_int.sql || exit -1
psql -d gazetteer -f /usr/share/pgsql/contrib/pg_trgm.sql || exit -1
# README says "lwpostgis.sql", but I assume "lwpostgis-64.sql" is appropriate for a 64bit machine
psql -d gazetteer -f /usr/share/pgsql/contrib/lwpostgis-64.sql || exit -1
psql -d gazetteer -f /usr/share/pgsql/contrib/spatial_ref_sys.sql || exit -1
psql -d gazetteer -f /usr/share/osm2pgsql/900913.sql || exit -1
echo running osm2pgsql
# I receive the same errors when using the planet-latest.osm. to make tests faster I've been testing w/ the
# cloudmade denmark.osm file acquired here:
/usr/share/osm2pgsql/osm2pgsql -lsc -C 2048 -O gazetteer -U postgres -m -d gazetteer /dfs/data1/osm/denmark.osm.bz2 || exit -1
echo osm2pgsql done
createuser -SDR www-data
createuser -SDR apache
cat import_worldboundaries.sql | sed -e s/twain/osm/g | psql -d gazetteer || exit
# README says to run these after the import*sql files, but I get function missing errors if I do that.
echo loading functions
# The first time through causes errors b/c of dependencies. The second pass errors are the interesting ones.
cat gazetteer-functions.sql | psql -d gazetteer 2> /dev/null > /dev/null || exit -1
echo loading tables
cat gazetteer-tables.sql | psql -d gazetteer || exit -1
echo loading functions again
cat gazetteer-functions.sql | psql -d gazetteer || exit -1
cat import_country_name.sql | sed -e s/twain/osm/g | psql -d gazetteer || exit
cat import_gb_postcodearea.sql | sed -e s/twain/osm/g | psql -d gazetteer || exit
cat import_gb_postcode.sql | sed -e s/twain/osm/g | psql -d gazetteer || exit
cat import_specialwords.sql | sed -e s/twain/osm/g | psql -d gazetteer || exit
cat import_us_statecounty.sql | sed -e s/twain/osm/g | psql -d gazetteer || exit
cat import_state.sql | sed -e s/twain/osm/g | psql -d gazetteer || exit
psql -d gazetteer -f gazetteer-index.sql
echo all done
Jason R. Surratt
email: jason.surratt at spadac.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dev