[mapserver-users] OGR data layer type - points and lines

Stephen Woodbridge woodbri at swoodbridge.com
Fri Dec 17 12:58:13 EST 2010


On 12/17/2010 12:24 PM, Fawcett, David (MPCA) wrote:
> I guess I spoke a little too soon...
>
> When I attempted to test this data definition, I got a mapserv.exe
> crash.  I am using a recent version of MSW4.
>
> Also, in looking a little bit at the OGR driver page for sqlite:
> http://www.gdal.org/ogr/drv_sqlite.html, I am guessing that the
> driver can't use spatialite's native binary geometry storage format
> when it is used to build a geom on the fly.  Based on that, I think
> that creating a wkt geom may be the way to go.  Something like this
> (which still crashes mapserv.exe).
>
> DATA "select 'LINESTRING(' || group_concat(X(geometry) || ' ' ||
> Y(geometry), ',') || ')' AS wkt_geometry from turtle_points"
>
> This sample is also very simple in that the line vertices aren't
> being ordered and the assumption is that you want one line from all
> of the points in your dataset.

David,

Are you sure that mapserver wants WKT and not WKB?
Have you tried:

DATA "select geomfromtext('LINESTRING(' || group_concat(X(geometry) || ' 
' || Y(geometry), ',') || ')') AS wkb_geometry from turtle_points"

I'm not sure what the real function name for geomfromtext(), but most 
connections assume a WKB. OGR might be different.

Still mapserver should not crash, so please write that up as a bug if 
you haven't already.

Thanks,
-Steve W


More information about the mapserver-users mailing list