I try to create a DB in postgreSQL with all the postal adress data for a specific country.
Actually I have this table full of data:
id integer NOT NULL DEFAULT nextval('plz_id_seq'::regclass),
country_code character varying(20),
postal_code character varying(20),
city_name character varying(180),
state_name character varying(180),
state_code character varying(20),
community_name character varying(180),
community_code character varying(20),
latitude double precision,
longitude double precision,
CONSTRAINT plz_pkey PRIMARY KEY (id)
The next step should be, to create a new table with the streets and housenumbers and link it to the right postal code area. For this I imported the specific OSM data into postgis with osm2pgsql and the hstore option.
Where Im now stuck, is the query to find the OSM postal_code area/polygon that fits to my plz data.
I tried this query, but get nothing back:
SELECT * FROM planet_osm_polygon WHERE boundary='postal_code' AND ST_CONTAINS(way, ST_PointFromText('POINT(48 7.85)', 900913));
Where ist my error?