[mapserver-users] Plotting points as a line from sqlite database
woodbri at swoodbridge.com
Wed Jun 29 23:48:32 EDT 2011
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.
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, ',') ||')'
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.
More information about the mapserver-users