[Geocoding] Gazetteer instalation
Michal Palenik
michal.palenik at freemap.sk
Sat Mar 6 23:26:37 GMT 2010
thank you, --slim creates planet_osm_ways/...
after several many more trial and error, the below order of commands
seems to work...
hopefully this helps
michal
On Sat, Mar 06, 2010 at 08:45:00PM +0100, miblon wrote:
> Use osm2pgsql with the --slim flag and these tables will be created.
>
> Kind regards,
>
> Milo van der Linden
>
> Michal Palenik wrote:
> >hello,
> >
> >after compiling osm2pgsql (it was the first time i compiled something
> >under linux, i thought it would be harder), ignoring a lot of error
> >messages (like in _int.sql from pgsql contrib a type is defined later
> >than used), and waiting, i have an almost working copy of gazetteer.
> >when i will have a working and reliabable order of import procedures
> >i'll let you know, so far it is only trial and fail.
> >
> >
> >last messages that occur and (probably) cause troubles are missing tables
> >planet_osm_ways/rels, i don't know how to create them.
> >
> >now i am able to search for streets and cities, however POIs are
> >not findable (in the www frontend).
> >
> >is there anything else i missed ?
> >
> >michal
> >
> >
> >On Wed, Jan 27, 2010 at 03:39:22PM +0200, Ciprian Talaba wrote:
> >>Hi Michal,
> >>
> >>On Wed, Jan 27, 2010 at 3:30 PM, Michal Palenik
> >><michal.palenik at freemap.sk>wrote:
> >>
> >>>hello, i have problems installing/configuring Gazetteer on debian
> >>>testing.
> >>>
> >>>i have osm2pgsql binary from packages, Gazetteer from todays svn
> >>>database creation is ok, osm2pgsql is also ok (after correcting
> >>>duplicate nodes)
> >>>
> >>>i have problems with step:
> >>>cat gazetteer-functions.sql | psql -q gazetteer
> >>>
> >>>ERROR: typy keyvalue[] does not exist
> >>>
> >>>should it be created by ?
> >>>
> >>> CREATE TYPE keyvalue AS (
> >>> key TEXT,
> >>> value TEXT
> >>> );
> >>>
> >>>
> >>>(i could not find it anywhere, neither in
> >>>contrib nor in gazetteer)
> >>>
> >>>
> >>>other missing types are:
> >>>wordscore
> >>>place_boundingbox
> >>>
> >>>also in gazetteer-index.sql
> >>>place and placex have different structure, which causes
> >>>insert into placex select * from place where osm_type = 'N';
> >>>to fail
> >>>
> >>>
> >>>michal
> >>>
> >>>ps:
> >>>postgresql-contrib-8.3 needs to be installed
> >>>
> >>>pg_config is sometimes faulty, so i had to change the makefile to
> >>>PGXS := $(shell /usr/lib/postgresql/8.3/bin/pg_config --pgxs)
> >>>
> >>>notes on role 'twain' are in some sql scripts
> >>>
> >>>
> >>>
> >>>--
> >>>michal palenik
> >>>www.freemap.sk
> >>>http://wiki.freemap.sk
> >>>
> >>>
> >>>
> >>I had the most of these problems when I first tried Nominatim. The
> >>solution(s) is to get the latest osm2pgsql from svn (
> >>http://svn.openstreetmap.org/applications/utils/export/osm2pgsql/) and built
> >>it from source. osm2pgsql is the one that creates the keyvalue type when
> >>importing data using gazetteer option.
> >>
> >>The other missing types will be created at the second run of
> >>gazetter-functions.sql file.
> >>
> >>--Ciprian
> >
--
michal palenik
www.freemap.sk
http://wiki.freemap.sk
-------------- next part --------------
dropdb gazetteer
createdb gazetteer
createlang plpgsql gazetteer
cat /usr/share/postgresql/8.3/contrib/_int.sql | psql -q gazetteer
cat /usr/share/postgresql/8.3/contrib/pg_trgm.sql | psql -q gazetteer
cat /usr/share/postgresql-8.3-postgis/lwpostgis.sql | psql -q gazetteer
cat /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql | psql -q gazetteer
cat gazetteer/gazetteer-tables.sql | psql -q gazetteer
# slim urobi tabulky
./osm2pgsql --slim -lc -O gazetteer -d gazetteer /home/michal/test/freemap/europe/slovakia.osm
cd gazetteer
cat import_worldboundaries.sql | psql -q gazetteer
cat import_country_name.sql | psql -q gazetteer
cat import_gb_postcode.sql | psql -q gazetteer
cat import_gb_postcodearea.sql | psql -q gazetteer
cat import_us_state.sql | psql -q gazetteer
cat import_us_statecounty.sql | psql -q gazetteer
cd ../
# 5) Add gazetteer functions to database
cat gazetteer/gazetteer-functions.sql | psql -q gazetteer
cat gazetteer/gazetteer-tables.sql | psql -q gazetteer
cat gazetteer/gazetteer-functions.sql | psql -q gazetteer
cat gazetteer/gazetteer-loaddata.sql | psql -q gazetteer
# 6) Index the database - this will take a VERY long time!
cat gazetteer/gazetteer-index.sql | psql -q gazetteer
# 7) Various 'special' words for searching - see file for details
cat gazetteer/import_specialwords.sql | psql -q gazetteer
# 8) permissions
echo "select 'grant all on '||schemaname||'.'||tablename||' to \"www-data\";' from pg_tables where schemaname in ('public') order by schemaname, tablename;"| psql --tuples-only gazetteer | psql gazetteer
More information about the Geocoding
mailing list