[mapserver-users] Plotting points as a line from sqlite database

Ian Walberg ian.walberg at airborne.aero
Thu Jul 28 10:41:22 PDT 2011


Gents,

Thanks for these ideas, however I cannot seem to find a MakeLine
function in spatialite 2.4.0.

Where should I be looking?

Thanks

Ian

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Fawcett,
David (MPCA)
Sent: Thursday, June 30, 2011 6:44 AM
To: Stephen Woodbridge; mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] Plotting points as a line from sqlite
database

ST_MAKELINE() does exist in recent versions of Spatialite.  

It doesn't appear to have made it in to the docs, but it can be seen in
this example from the cookbook.
http://www.gaia-gis.it/spatialite-2.4.0-4/spatialite-cookbook/html/pp-ad
jacent.html

Another example is in this thread from the Spatialite list:  

http://groups.google.com/group/spatialite-users/browse_thread/thread/002
0f8e907ae9226

You will likely need recent versions of both Spatialite and OGR to make
it work.

David.



-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Stephen
Woodbridge
Sent: Wednesday, June 29, 2011 10:49 PM
To: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Plotting points as a line from sqlite
database

On 6/29/2011 10:13 PM, Ian Walberg wrote:
> I hope this isn't too stupid a question.
>
> Would like to display a list of positions in an sqlite database as a
> line, to show the flight path of an aircraft. The data is in the db as
> Lat, Long and point (lat, long)
>
> We can display the positions as individual dots but not as a line, I
> fear the problem is that the data is a point.
>
> As the data is being accumulated we would prefer not to create a new
> line in the database each time if possible.
>
> Any suggestions to what options we have would be appreciated.

Hi Ian,

In postgis there is an aggregrate function makeline() that you can feed 
points to. I think there may be an equivalent function in SpatiaLite.

In sqlite, you might be able to use a group_concat() something like:

select 'LINESTRING('|| group_concat(lat||' '||long, ',') ||')'
   from points;

But I think the issue will be that this is not a format that mapserver 
understands. You might be able to access this via GDAL/OGR but I'm not 
sure on that.

-Steve W
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list