[postgis-users] mixed srid geometries

Emily Gouge egouge at refractions.net
Mon Apr 3 16:32:38 PDT 2006


A SRID is stored with the geometries as well as in the geometry columns table.  So you likely need 
to update the SRID associated with the geometry too.  Try the setSRID function.

update table_name set the_Geom = setSRID(the_geom, -1)

To view the SRID associated with the geometries in your tables you could try:
select distinct SRID(the_geom) from table_name;
The geometries in the tables you wish to do a spatial joins on need to have the same SRID.

As well in order to make your query faster you might want to add spacial indexes to the tables and 
use the && operator.


Hope that helps,
Emily


Nelson Guda wrote:
> Hi all,
> 
> Thanks to Aaron for the php code.
> 
> Meanwhile, I have another question.  I am trying to do a query on two 
> tables.  One table (table 1) contains a large number of overlapping 
> geometries that represent animal ranges.  The other table (table 2) are 
> geometries of geographic areas.  I want to know which species of animals 
> live in a given geometry from table 2.  Below is the query I am using, 
> but I keep getting the error  'Operation on mixed srid geometries'.
> 
> So, i went and set all the srid's in the geometry columns table to -1, 
> but I still get the same error.  What am I doing wrong?
> 
> thanks,
> nelsong
> 
> -- -- -- -- -- -- query: -- -- -- -- -- -- --
> select a.sci_name
> from species AS s, lands AS l
> where l.name='name'
> AND touches(s.the_geom,l.the_geom)
> _______________________________________________
> 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