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

Bob Basques Bob.Basques at ci.stpaul.mn.us
Mon Mar 5 15:28:55 PST 2012


Ha, success!!! 

Coll, Thanks Simon  (A LOT !!) 

select rxtime, 
       ltrim(split_part(part1, ':', 1), '>') as cmd_type, 
       split_part(part1, ':', 2) as esn, 
       part2 as time_idx, 
       part3 as lat, 
       part4 as lon, 
       ST_SetSRID(ST_MakePoint(part3::numeric, part4::numeric),4326) as geom, 
       part5 as speed, 
       part6 as event, 
       rtrim(part7, ';') as good 
  from 
      (select rxtime, 
              split_part(cmd, ',', 1) as part1,  
              split_part(cmd, ',', 2) as part2, 
              split_part(cmd, ',', 3) as part3, 
              split_part(cmd, ',', 4) as part4, 
              split_part(cmd, ',', 5) as part5, 
              split_part(cmd, ',', 6) as part6, 
              split_part(cmd, ',', 7) as part7 
         from  
              cmdstpinfo 
        where cmd  
         like '>Plot:%') AS first_pass; 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120305/b19c459d/attachment.html>


More information about the postgis-users mailing list