Sample code that demonstrates how to create a Multi Line Feature

Imports DotSpatial.Data
Imports DotSpatial.Geometries

Private Sub button1_Click(sender As Object, e As EventArgs)
	Dim rnd As New Random()
	Dim f As New Feature()
	Dim fs As New FeatureSet(f.FeatureType)
	Dim ls As LineString() = New LineString(1) {}
	For ii As Integer = 0 To 1
		Dim coord As Coordinate() = New Coordinate(4) {}
		For i As Integer = 0 To 4
			coord(i) = New Coordinate((rnd.NextDouble() * 360) - 180, (rnd.NextDouble() * 180) - 90)
		Next
		ls(ii) = New LineString(coord)
	Next
	Dim mls As New MultiLineString(ls)
	f = New Feature(mls)
	fs.Features.Add(f)
	fs.SaveAs("C:\Temp\test.shp", True)
End Sub

Last edited Jul 13, 2010 at 3:11 PM by AlamoMan, version 2