This project is read-only.
Sample code that demonstrates how to create a new mulitpolygon from randomly generated coordinates

Imports DotSpatial.Geometries
Imports DotSpatial.Topology.Geometries

Private Sub button1_Click(sender As Object, e As EventArgs)
	Dim rnd As New Random()
	Dim pg As Polygon() = New Polygon(49) {}
	For i As Integer = 0 To 49
		Dim center As New Coordinate((rnd.NextDouble() * 360) - 180, (rnd.NextDouble() * 180) - 90)
		Dim coord As Coordinate() = New Coordinate(35) {}
		For ii As Integer = 0 To 35
			coord(ii) = New Coordinate(center.X + Math.Cos((ii * 10) * Math.PI / 10), center.Y + (ii * 10) * Math.PI / 10)
		Next
		coord(35) = New Coordinate(coord(0).X, coord(0).Y)
	        pg(i) = New Polygon(coord)
	Next
	Dim mpg As New MultiPolygon(pg)
End Sub

Last edited Jul 13, 2010 at 3:38 PM by AlamoMan, version 4