ThinkGeo.com    |     Documentation    |     Premium Support

LINESTRING vs. MULTILINESTRING

Hello all,


I'm confused in GetWellKnownType().


No matter I create a new shape file by LINESTRING or MULTILINESTRING.


why this new shape file GetWellKnownType() always is Multiline?


for example,


if i create a new line shape and add to new shape file.


Dim Lineshape As New LineShape("LINESTRING(120.362772 22.679995,120.362937 22.679651)")

Dim Feature As New Feature(Lineshape)

Dim newPolyLineShapeFile As New ShapeFileFeatureLayer("Polyline.shp", ShapeFileReadWriteMode.ReadWrite)

        newPolyLineShapeFile.Open()

        newPolyLineShapeFile.FeatureSource.BeginTransaction()

        newPolyLineShapeFile.FeatureSource.AddFeature(Feature)

        newPolyLineShapeFile.FeatureSource.CommitTransaction()

        newPolyLineShapeFile.Close()


Now, I get WKT by GetWellKnownText() in Polyline.shp.


it outputs string of "MULTILINESTRING((120.362772 22.679995,120.362937 22.679651))".


 


 



GetWellKnownText always returns MULTILINESTRING because the shapefile format for line is always a polyline that can be made of several lines. See en.wikipedia.org/wiki/Shapefile.

 We allow adding a new feature to a shapefile made of a LineShape but internally in the shapefile structure, it will be converted to a Polyline.