change code to work with a 64-bit node size osm2pgsql

This breaks the 32-bit node size version.
This commit is contained in:
Sarah Hoffmann
2012-04-16 22:26:44 +02:00
parent b8db117bd0
commit cb01226f29
2 changed files with 6 additions and 6 deletions

View File

@@ -742,7 +742,7 @@ $$
LANGUAGE plpgsql; LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION create_interpolation(wayid INTEGER, interpolationtype TEXT) RETURNS INTEGER CREATE OR REPLACE FUNCTION create_interpolation(wayid BIGINT, interpolationtype TEXT) RETURNS INTEGER
AS $$ AS $$
DECLARE DECLARE
@@ -1323,7 +1323,7 @@ BEGIN
IF NEW.parent_place_id IS NULL AND NEW.osm_type = 'N' THEN IF NEW.parent_place_id IS NULL AND NEW.osm_type = 'N' THEN
-- Is this node part of a relation? -- Is this node part of a relation?
FOR relation IN select * from planet_osm_rels where parts @> ARRAY[NEW.osm_id::integer] and members @> ARRAY['n'||NEW.osm_id] FOR relation IN select * from planet_osm_rels where parts @> ARRAY[NEW.osm_id] and members @> ARRAY['n'||NEW.osm_id]
LOOP LOOP
-- At the moment we only process one type of relation - associatedStreet -- At the moment we only process one type of relation - associatedStreet
IF relation.tags @> ARRAY['associatedStreet'] AND array_upper(relation.members, 1) IS NOT NULL THEN IF relation.tags @> ARRAY['associatedStreet'] AND array_upper(relation.members, 1) IS NOT NULL THEN
@@ -1339,7 +1339,7 @@ BEGIN
--RAISE WARNING 'x1'; --RAISE WARNING 'x1';
-- Is this node part of a way? -- Is this node part of a way?
FOR way IN select id from planet_osm_ways where nodes @> ARRAY[NEW.osm_id::integer] LOOP FOR way IN select id from planet_osm_ways where nodes @> ARRAY[NEW.osm_id] LOOP
--RAISE WARNING '%', way; --RAISE WARNING '%', way;
FOR location IN select * from placex where osm_type = 'W' and osm_id = way.id FOR location IN select * from placex where osm_type = 'W' and osm_id = way.id
LOOP LOOP
@@ -1352,7 +1352,7 @@ BEGIN
-- Is the WAY part of a relation -- Is the WAY part of a relation
IF NEW.parent_place_id IS NULL THEN IF NEW.parent_place_id IS NULL THEN
FOR relation IN select * from planet_osm_rels where parts @> ARRAY[location.osm_id::integer] and members @> ARRAY['w'||location.osm_id] FOR relation IN select * from planet_osm_rels where parts @> ARRAY[location.osm_id] and members @> ARRAY['w'||location.osm_id]
LOOP LOOP
-- At the moment we only process one type of relation - associatedStreet -- At the moment we only process one type of relation - associatedStreet
IF relation.tags @> ARRAY['associatedStreet'] AND array_upper(relation.members, 1) IS NOT NULL THEN IF relation.tags @> ARRAY['associatedStreet'] AND array_upper(relation.members, 1) IS NOT NULL THEN
@@ -1397,7 +1397,7 @@ BEGIN
IF NEW.parent_place_id IS NULL AND NEW.osm_type = 'W' THEN IF NEW.parent_place_id IS NULL AND NEW.osm_type = 'W' THEN
-- Is this way part of a relation? -- Is this way part of a relation?
FOR relation IN select * from planet_osm_rels where parts @> ARRAY[NEW.osm_id::integer] and members @> ARRAY['w'||NEW.osm_id] FOR relation IN select * from planet_osm_rels where parts @> ARRAY[NEW.osm_id] and members @> ARRAY['w'||NEW.osm_id]
LOOP LOOP
-- At the moment we only process one type of relation - associatedStreet -- At the moment we only process one type of relation - associatedStreet
IF relation.tags @> ARRAY['associatedStreet'] AND array_upper(relation.members, 1) IS NOT NULL THEN IF relation.tags @> ARRAY['associatedStreet'] AND array_upper(relation.members, 1) IS NOT NULL THEN

View File

@@ -192,7 +192,7 @@ CREATE TABLE placex (
place_id BIGINT NOT NULL, place_id BIGINT NOT NULL,
partition integer, partition integer,
osm_type char(1), osm_type char(1),
osm_id INTEGER, osm_id BIGINT,
class TEXT NOT NULL, class TEXT NOT NULL,
type TEXT NOT NULL, type TEXT NOT NULL,
name HSTORE, name HSTORE,