Line layers from OGR Virtual Spatial Data?

Frank Warmerdam fwarmerdam at GMAIL.COM
Wed Jul 6 08:55:12 PDT 2005


On 7/6/05, Jim Bilsborough <jim at ccsservicesofva.com> wrote:
> Hi List
> I've been attempting to create a Layer via ORG Virtual Spatial Data.
> Currently the source data is an MS Access database, but could be anything
> (might even wind up being a CSV).  I was hoping to create a layer that
> would show specific points AND join those points with a connecting line.  I
> think I've tried every conceivable permutation of OGR GeometryType and
> Mapfile LAYER TYPE, but to no avail.  Finally today I read in the WIKI that
> (as at Sept 2004) only POINT layers are supported.  If this is, indeed, the
> case, what purpose does the OGR GeometryType attribute serve?

Jim,

The GeometryType attribute on the layer changes the type the layer
reports itself as but has no real effect on geometry processing in OGR.
it is also ignored by MapServer which takes the feature geometries 
"as they come". 
 
> Finally, and most importantly, can anyone recommend a solution for
> displaying connected points from a virtual source - ideally, in relatively
> layman's terms!

To read linestrings from a non-spatial database (eg. CSV, ODBC)
using OGR you would need to encode the linestrings in WKT format
and use the <GeometryField  encoding="WKT" field="your_Field">. 
WKT format for a linestring might look like:

  LINESTRING(23.0 45.0, 60.0 30.0)

The above would need to be in a string field in the database of course.

Good luck,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the MapServer-users mailing list