public void LineString_Convert() { Coordinate[] coords = Shell1; SqlGeometry sq = CreateSqlLineString(coords); IGeometry g = ConvertToGeometry.SqlGeometryToGeometry(sq); Assert.IsTrue(g is ILineString); Compare(g as ILineString, coords); }
public void Point_Convert() { SqlGeometry sg = CreateSqlPoint(127, 127); IGeometry g = ConvertToGeometry.SqlGeometryToGeometry(sg); Assert.IsTrue(g is IPoint); Assert.AreEqual((g as IPoint).X, sg.STX.Value); Assert.AreEqual((g as IPoint).Y, sg.STY.Value); }
public void Polygon_Convert() { Coordinate[] shell = Shell2, hole1 = Hole1, hole2 = Hole2; SqlGeometry sg = CreatePolygon(shell, hole1, hole2); IGeometry g = ConvertToGeometry.SqlGeometryToGeometry(sg); Assert.IsTrue(g is IPolygon); Compare((g as IPolygon).Shell, shell); Compare((g as IPolygon).Holes[0], hole1); Compare((g as IPolygon).Holes[1], hole2); }
public void MultiPoint_Convert() { Coordinate[] shell = Shell1; SqlGeometry sg = CreateMultiPoint(shell); IGeometry g = ConvertToGeometry.SqlGeometryToGeometry(sg); Assert.IsTrue(g is IMultiPoint); IMultiPoint mp = g as IMultiPoint; for (int i = 0; i < mp.Count; i++) { Assert.AreEqual(mp[i].X, shell[i].X); Assert.AreEqual(mp[i].Y, shell[i].Y); } }