[postgis-users] Spatial column from text via a VIEW, Possible?

Bob Basques Bob.Basques at ci.stpaul.mn.us
Tue Mar 6 09:10:52 PST 2012


All, 

made nice progress from Simon's suggestions, but . . . 

Ok, I'm probably trying to push this harder than I need to, but, I'm trying to ST_Transform the data from 4326 to 200068 (Our private projection) in the construction of the view, but I keep hitting permission errors.   

NOTE: we use the 200068 projection for all of our data, have for years.  It's definition in SPATIAL_REF_SYS is correct.   

This works fine: 

select 
           ST_SetSRID(ST_MakePoint(part3::numeric, part4::numeric),4326) as geom, 
           ST_AsText(ST_SetSRID(ST_MakePoint(part3::numeric, part4::numeric),4326)) as geom_text 
      from 
          (select rxtime, 
                  split_part(cmd, ',', 3) as part3, 
                  split_part(cmd, ',', 4) as part4 
             from  
                  cmdstpinfo 
            where cmd  
             like '>Plot:%') AS first_pass; 

But this give me an error, do I have the ST_Transform in the right spot, is 8.4.2 too old of a release? : 

select 
           ST_SetSRID(ST_MakePoint(part3::numeric, part4::numeric),4326) as geom, 
           ST_AsText(ST_SetSRID(ST_MakePoint(part3::numeric, part4::numeric),4326)) as geom_text, 
           ST_AsText(ST_Transform(ST_SetSRID(ST_MakePoint(part3::numeric, part4::numeric),4326)), 200068) as geom_city 
      from 
          (select rxtime, 
                  split_part(cmd, ',', 3) as part3, 
                  split_part(cmd, ',', 4) as part4 
             from  
                  cmdstpinfo 
            where cmd  
             like '>Plot:%') AS first_pass; 

Like: 
ERROR:  function st_transform(geometry) does not exist
LINE 4:            ST_AsText(ST_Transform(ST_SetSRID(ST_MakePoint(pa...
                             ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts. 
  
********** Error ********** 
  
ERROR: function st_transform(geometry) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Character: 212 



Thanks 

bobb 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120306/d25de96d/attachment.html>


More information about the postgis-users mailing list