[postgis-users] MakeLine for geography coordinates

Jochen Albrecht jochen.albrecht at gmail.com
Tue Apr 5 13:46:09 PDT 2011


Hmm, the casting worked Sandro. No error message and a column type
geography. Unfortunately, it is not recognized as a valid geometry that can
be displayed in qgis or udig, where the result shows up as a plain table. My
previous version of the same code based on geometry shows fine. I guess I
still haven't grasped the well-discussed logical differences between
geometry and geography data types. Steve Marshall's message today about
geography casting woes makes me wonder though, whether it is just my
ignorance that is at work here.
Basically, if I use ST_MakeLine(geom), I get a proper linestring, while if I
use it casting to result in a geography data type [with everything else in
the code remaining the same], then I only get a plain table. For a while, I
thought I may have to define a SRID but apparently, WGS84 (4326) is the
default for geography.
I have read quite extensively through various listservs as well as Obe/Hsu's
PostGIS in Action but could not find an answer to my problem.
Cheers,
     Jochen

On Mon, Apr 4, 2011 at 8:32 AM, Sandro Santilli <strk at keybit.net> wrote:

> On Mon, Apr 04, 2011 at 08:28:25AM -0400, Jochen Albrecht wrote:
> >
> > Could you please just edit this snippet?
> [..]
> >   ST_MakeLine(loc) AS line
> [..]
> > loc is of type geography.
>
> To get a geometry line:
>
>  ST_MakeLine(loc::geometry) as line
>
> To get a geography line:
>
>  ST_MakeLine(loc::geometry)::geography as line
>
> --strk;
>
>  ()   Free GIS & Flash consultant/developer
>  /\   http://strk.keybit.net/services.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110405/8746d9e7/attachment.html>


More information about the postgis-users mailing list