[postgis-users] Querying geometries with different srid

Farrukh Najmi farrukh at wellfleetsoftware.com
Thu Jan 6 15:00:15 PST 2011


Hello,

My application needs to support storing of geometry instances with 
different SRID values in the same table and then be able to query it 
using spatial operations and a filter geometry which could be in any SRID.

One possible option (Option #1) is to use ST_TRANSFORM function to 
transform all geometry instances on WRITE to the same internal SRID (say 
4326) and transform the filter geometry used by the query to the same 
SRID used internally (say 4326) before doing the spatial operation.

The other option (Option #2) is to store all geometry instances with 
their original SRID values on WRITE and use ST_TRANSFORM function in the 
query to transform all internal geometry instances to match the same 
SRID as that of the filter geometry used by the query.

It seems option #1 is less accurately preserving the original data but 
is much more efficient on query while option #2 stores original data 
without any change but may have serious performance issues due to the 
transform on query.

What do people advice based upon their experience with postgis for my 
requirement and possible solution.

Thank you for your help.

-- 
Regards,
Farrukh Najmi

Web: http://www.wellfleetsoftware.com




More information about the postgis-users mailing list