[postgis-users] SRID confusion

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Mon Nov 3 07:35:09 PST 2008


pcreso at pcreso.com wrote:
> Hi guys, 
> 
> I'm not sure what is going on here:
> 
> I am working with some strata boundaries for a fisheries survey, mostly depth based strata. SRID=4326
> 
> I also have some polygons of areas of untrawlable seabed & want to generate these cropped by stratum. SRID=4326
> 
> Aas a step in this process I create a new table with a single multipolygon comprising the geomunion of all the hole polygons. SRID=4326
> 
> insert into hole_multi
>                 select 1, geomunion(geom) from holes;
> 
> 
> If I run a query on this table:
> 
> select srid(hole), astext(hole) from hole_multi;
> 
> I get:
> 
>  4326 | MULTIPOLYGON(SRID=0;((55.78 ....
> 
> 
> So the SRID of the column is 4326, but each constituent polygon of the multipolygon, despite coming from a 4326 dataset, seems to be set internally to SRID=0.
> 
> The result is the same with:
>  insert into hole_multi
>                 select 1, setsrid(geomunion(geom),4326) from holes;
> 
> 
> Any ideas?
> 
> 
> Thanks,
> 
>    Brent Wood


Hi Brent,

That is strange - do you have a single .sql file you can attach so that 
we can run a similar command on different versions for comparison?

Also, have you ever upgraded your database from an older PostGIS 
version? If so, I would suggest creating a fresh database, loading in 
PostGIS, and trying your example .sql again. This is just to eliminate 
the chance that something has gone wrong as part of an upgrade at some 
time in the past.


ATB,

Mark.

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063



More information about the postgis-users mailing list