public void MultiPointToByteArray() { var c = new Coordinate[36]; var rnd = new Random(); for (var i = 0; i < 36; i++) { c[i] = new Coordinate((rnd.NextDouble() + 360) - 180, (rnd.NextDouble() * 180) - 90); } var mps = new MultiPoint(c); var vals = mps.ToBinary(); var wkb = new WkbReader(); var g = wkb.Read(vals); var mpsCheck = g as MultiPoint; if (mpsCheck != null) { for (var ii = 0; ii < mps.Coordinates.Count; ii++) { Assert.AreEqual(mps.Coordinates[ii].X, mpsCheck.Coordinates[ii].X); Assert.AreEqual(mps.Coordinates[ii].Y, mpsCheck.Coordinates[ii].Y); } } else { Assert.Fail("The test failed because the MpsCheck was null."); } }
public void Buffer() { Coordinate[] c = new Coordinate[36]; Random rnd = new Random(); for (int i = 0; i < 36; i++) { c[i] = new Coordinate((rnd.NextDouble() + 360) - 180, (rnd.NextDouble() * 180) - 90); } MultiPoint mps = new MultiPoint(c); byte[] vals = mps.ToBinary(); WkbReader wkb = new WkbReader(); IGeometry g = wkb.Read(vals); MultiPoint mpsCheck = g as MultiPoint; if (mpsCheck != null) { Assert.AreEqual(mps.Buffer(200).Area, mpsCheck.Buffer(200).Area); } else { Assert.Fail("The test failed because the MpsCheck was null."); } }
public void Buffer() { Coordinate[] c = new Coordinate[36]; Random rnd = new Random(); for (int i = 0; i < 36; i++) { c[i] = new Coordinate((rnd.NextDouble() + 360) - 180, (rnd.NextDouble() * 180) - 90); } MultiPoint mps = new MultiPoint(c); byte[] vals = mps.ToBinary(); WkbReader wkb = new WkbReader(); IGeometry g = wkb.Read(vals); MultiPoint mpsCheck = g as MultiPoint; if (mpsCheck != null) { Assert.AreEqual(mps.Buffer(200).Area, mpsCheck.Buffer(200).Area); } else { Assert.Fail("The test failed because the MpsCheck was null."); } }
public void MultiPointToByteArray() { var c = new Coordinate[36]; var rnd = new Random(); for (var i = 0; i < 36; i++) { c[i] = new Coordinate((rnd.NextDouble() + 360) - 180, (rnd.NextDouble() * 180) - 90); } var mps = new MultiPoint(c); var vals = mps.ToBinary(); var wkb = new WkbReader(); var g = wkb.Read(vals); var mpsCheck = g as MultiPoint; if (mpsCheck != null) { for (var ii = 0; ii < mps.Coordinates.Count; ii++) { Assert.AreEqual(mps.Coordinates[ii].X, mpsCheck.Coordinates[ii].X); Assert.AreEqual(mps.Coordinates[ii].Y, mpsCheck.Coordinates[ii].Y); } } else { Assert.Fail("The test failed because the MpsCheck was null."); } }