[postgis-users] projection management
Ken Boss
Ken.Boss at dnr.state.mn.us
Tue Mar 27 12:32:45 PDT 2007
Hello David--
Thanks for the reply, that clarifies matters nicely. I think I'm understanding also that setsrid(the_geom, the_srid) rolls that srid right into the binary representation of the geometry. I wonder if it might be desirable/possible in a future version, then, to have astext(the_geom) output the srid along with the text representation of the geometry.
--Ken
>>> On 3/27/2007 at 1:25 PM, in message
<d2f53e190703271125q2cdafdb2k313e7d4c0b669427 at mail.gmail.com>, "David William
Bitner" <david.bitner at gmail.com> wrote:
> 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
>>
>
>
More information about the postgis-users
mailing list