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.<div>
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.</div>
<div>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.</div><div>Cheers,</div><div>     Jochen<br>

<br><div class="gmail_quote">On Mon, Apr 4, 2011 at 8:32 AM, Sandro Santilli <span dir="ltr"><<a href="mailto:strk@keybit.net" target="_blank">strk@keybit.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div>On Mon, Apr 04, 2011 at 08:28:25AM -0400, Jochen Albrecht wrote:<br>
><br>
> Could you please just edit this snippet?<br>
</div>[..]<br>
<div>>   ST_MakeLine(loc) AS line<br>
</div>[..]<br>
<div>> loc is of type geography.<br>
<br>
</div>To get a geometry line:<br>
<br>
 ST_MakeLine(loc::geometry) as line<br>
<br>
To get a geography line:<br>
<br>
 ST_MakeLine(loc::geometry)::geography as line<br>
<div><div></div><div><br>
--strk;<br>
<br>
  ()   Free GIS & Flash consultant/developer<br>
  /\   <a href="http://strk.keybit.net/services.html" target="_blank">http://strk.keybit.net/services.html</a><br>
</div></div></blockquote></div><br>
</div>