[postgis-users] projection management

Obe, Regina robe.dnd at cityofboston.gov
Tue Mar 27 12:43:07 PDT 2007


asEWKT spits out the SRID with the text representation. 

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Ken
Boss
Sent: Tuesday, March 27, 2007 3:33 PM
To: bitner at gyttja.org; PostGIS Users Discussion
Subject: Re: [postgis-users] projection management

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 
>>
> 
> 

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.




More information about the postgis-users mailing list