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

George Silva georger.silva at gmail.com
Tue Mar 6 12:15:06 PST 2012


Bob, can you try something like this?

select
st_astext(st_setsrid(st_geomfromtext('POINT(-48 -19)'),4326)) as "wgs84",
 st_astext(st_transform(st_setsrid(st_geomfromtext('POINT(-48
-19)'),4326),29192)) as "sad69-utm22"

Here are my results:

"POINT(-48 -19)" ; "POINT(815865.331177955 7896471.32478341)"

Looking at your coordinates, I see a -93.1268 as latitude. Perhaps the
input needs a little validating?

On Tue, Mar 6, 2012 at 4:25 PM, Bob Basques <Bob.Basques at ci.stpaul.mn.us>wrote:

>  All,
>
>  I hit this earlier in my testing, so I must have had things in the right
> order at some earlier point in the process.
>
>  This :
>
>  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;
>
>  is producing this (which I did hit early on but thought I had the syntax
> wrong at the time) :
>
>  ERROR:  transform: couldn't project point (44.9677 -93.1268 0): latitude
> or longitude exceeded limits (-14)
>
>
>
> ********** Error **********
>
>
>
> ERROR: transform: couldn't project point (44.9677 -93.1268 0): latitude or
> longitude exceeded limits (-14)
> SQL state: XX000
>
>  This indicates to me that the transform stuff is there , but that it
> failed.  I haven't found many references to this error online.  The numbers
> above are the numbers from the first record in the table.  When I hit this
> earlier, I thought I might be trying to transform against the TEXT (those
> numbers) object vs the GEOM object (which I'm supposed to use, right??).
>  The result of the ST_SetSRID seems to be the correct type of object to
> pass to ST_Transform based on what I found in my searches.  Maybe I'm not
> supposed to try the transform in this manner.
>
>  bobb
>
>
>
>
>
> >>> Mike Toews <mwtoews at gmail.com> wrote:
>
> On 7 March 2012 06:10, Bob Basques <Bob.Basques at ci.stpaul.mn.us> wrote:
> > ...
> >            ST_AsText(ST_Transform(ST_SetSRID(ST_MakePoint(part3::numeric,
> > part4::numeric),4326)), 200068) as geom_city
> > ...
> > ERROR:  function st_transform(geometry) does not exist
> > LINE 4:            ST_AsText(ST_Transform(ST_SetSRID(ST_MakePoint(pa...
>
> It looks like "4326)), 200068)" should be "4326), 200068))"
>
> -Mike
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>


-- 
George R. C. Silva

Desenvolvimento em GIS
http://geoprocessamento.net
http://blog.geoprocessamento.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120306/ac39708b/attachment.html>


More information about the postgis-users mailing list