[postgis-users] Input versus output geometry

Alex Zepeda zipzippy at sonic.net
Wed Sep 1 13:42:39 PDT 2010


Recently I used pg_dump to export the output of a table with a geometry 
column representing a bounding box.  There's an exclusion constraint on 
that table such that rows with overlapping bounding boxes that contained 
two other overlapping columns would be rejected.  As it turned out I 
could insert the data, export it, but *not* play it back into another 
instance of postgres as the exclusion constraint barfed.

A bit of back and forth with some of the postgres guys revealed that the 
output does not recreate the exact input.

Is this the intended behaviour?  If so, is there any way to extract a 
more precise representation of the geometry column?

This was with Postgres 9.0rc1 and Postgis 1.5.2 SVN r5851.

gisttest2=# select 
ST_expand(setsrid(makepoint(-122.50367,37.74189),4326), 0.00004);
 
                       st_expand 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
0103000020E61000000100000005000000C32ADEC83CA05EC0D044D8F0F4DE4240C32ADEC83CA05EC0ECF5EE8FF7DE424035D252793BA05EC0ECF5EE8FF7DE424035D252793BA05EC0D044D8F0F4DE4240C32ADEC83CA05EC0D044D8F0F4DE4240
(1 row)

gisttest2=# select 
ST_expand(setsrid(makepoint(-122.50376,37.74185),4326), 0.00004);
 
                       st_expand 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
0103000020E6100000010000000500000063EE5A423EA05EC042EC4CA1F3DE424063EE5A423EA05EC05E9D6340F6DE4240D595CFF23CA05EC05E9D6340F6DE4240D595CFF23CA05EC042EC4CA1F3DE424063EE5A423EA05EC042EC4CA1F3DE4240
(1 row)

gisttest2=# select 
ST_expand(setsrid(makepoint(-122.50367,37.74189),4326), 0.00004) && 
ST_expand(setsrid(makepoint(-122.50376,37.74185),4326), 0.00004);
  ?column?
----------
  f
(1 row)

gisttest2=# select 
'0103000020E61000000100000005000000C32ADEC83CA05EC0D044D8F0F4DE4240C32ADEC83CA05EC0ECF5EE8FF7DE424035D252793BA05EC0ECF5EE8FF7DE424035D252793BA05EC0D044D8F0F4DE4240C32ADEC83CA05EC0D044D8F0F4DE4240'::geometry 
&&
gisttest2-# 
'0103000020E6100000010000000500000063EE5A423EA05EC042EC4CA1F3DE424063EE5A423EA05EC05E9D6340F6DE4240D595CFF23CA05EC05E9D6340F6DE4240D595CFF23CA05EC042EC4CA1F3DE424063EE5A423EA05EC042EC4CA1F3DE4240'::geometry;
  ?column?
----------
  t
(1 row)

- alex



More information about the postgis-users mailing list