Hello,

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.

When I run the optional util.update.php I get the following error:
                Call to undefined method DB_Error::setFetchMode() in 
/var/lib/pgsql/gazetteer/util.update.php on line 45

Any help would be greatly appreciated.

Cheers!

-jason

Version info:
gazetteer/osm2pgsql - SVN revision 19015
CentOS 5.3
PostgreSQL 8.3.8
PHP 5.1.6
PostGIS 1.3.6-1

Commands used for ingest:

pg_ctl -D /dfs/data1/pgsql-data/ -l /var/log/pgsql stop
sleep 3

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
sleep 3

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:
# http://downloads.cloudmade.com/europe/denmark#breadcrumbs
/usr/share/osm2pgsql/osm2pgsql -lsc -C 2048 -O gazetteer -U postgres -m -d 
gazetteer /dfs/data1/osm/denmark.osm.bz2 || exit -1
cd /var/lib/pgsql/gazetteer

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
SPADAC
email: [email protected]<mailto:[email protected]>

_______________________________________________
Geocoding mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/geocoding

Reply via email to