[postgis-devel] transform() error handling

strk at refractions.net strk at refractions.net
Mon Jan 31 00:56:05 PST 2005


I've made transform(geom, int) handle some common errors:

  =# select asewkt(transform('SRID=30;POINT(0 0)', -1));
  ERROR:  -1 is an invalid target SRID
  
  =# select asewkt(transform('SRID=-1;POINT(0 0)', 4326));
  ERROR:  Input geometry has unknown SRID
  
  =# select asewkt(transform('SRID=30;POINT(0 0)', 4326));
  ERROR:  Cannot find input SRID in spatial_ref_sys
  
  =# select asewkt(transform('SRID=4326;POINT(0 0)', 30));
  ERROR:  Cannot find target SRID in spatial_ref_sys


--strk;



More information about the postgis-devel mailing list