-
Notifications
You must be signed in to change notification settings - Fork 0
MlsCS
sindizzy edited this page Dec 30, 2020
·
4 revisions
Sample code that demonstrates how to create a multilinestring from randomly generated coordinates.
using DotSpatial.Geometries;
using DotSpatial.Topology.Geometries;
public void samplecode()
{
Random rnd = new Random();
MultiLineString Mls = new MultiLineString();
LineString[]() ls = new LineString[40](40);
for (int ii = 0; ii < 40; ii++)
{
Coordinate[]() coord = new Coordinate[36](36);
for (int i = 0; i < 36; i++)
{
coord[i](i) = new Coordinate((rnd.NextDouble() * 360) - 180, (rnd.NextDouble() * 180) - 90);
}
ls[ii](ii) = new LineString(coord);
}
Mls = new MultiLineString(ls);
}