[postgis-users] projection management

David William Bitner david.bitner at gmail.com
Tue Mar 27 11:25:47 PDT 2007


Ken,

The update you ran only set the SRID in the individual features themselves.
What you want to do is to run UpdateGeometrySRID([<schema_name>],
<table_name>, <column_name>, <srid>) which will also update the constraints
and the geometry_columns table.

Ideally, there should have been a constraint on your geometry column that
should have disallowed you from updating the individual feature SRIDs.  You
can find the feature SRID by doing a "select srid(the_geom) from
yourtable;".

David

On 3/27/07, Ken Boss <Ken.Boss at dnr.state.mn.us> wrote:
>
> I was trying to get a handle on coincident points in a table:
>
>     select location_geom, count(*) from burn_locations group by
> location_geom
>
> but was getting errors back:
>
>     ERROR: Operation on two GEOMETRIES with different SRIDs
>
> The geometry_columns table lists the SRID for the burn_locations table as
> -1.  I thought maybe PostGIS was just choking on the unspecified projection,
> so I specified it:
>
>     update burn_locations set location_geom=setsrid(location_geom, 26915)
>
> and then I was able to run my original query successfully.  However, when
> I looked again at the geometry_columns table, it still listed -1 as the SRID
> for burn_locations.  Which leaves me wondering:
>
> 1) Where does the SRID get stored when I run an update as above?
> 2) Can I query the SRID for and individual feature?  How?
>
> Thanks for any help,
>
> --Ken Boss
>   Minnesota DNR
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
************************************
David William Bitner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070327/e0f558fd/attachment.html>


More information about the postgis-users mailing list