def testPolygonFromJTS(self): poly = self.gf.createPolygon( self.gf.createLinearRing([ Coordinate(1, 2), Coordinate(3, 4), Coordinate(5, 6), Coordinate(1, 2) ]), []) p = geom.Polygon(poly) self.assertEqual('POLYGON ((1 2, 3 4, 5 6, 1 2))', str(p))
def testWriteGML(self): gml = geom.writeGML(geom.Point(1, 2)) p = geom.readGML(gml) assert 1.0 == p.x and 2.0 == p.y line = geom.LineString([1, 2], [3, 4]) assert str(line) == str(geom.readGML(geom.writeGML(line, ver=3), ver=3)) poly = geom.Polygon([[1, 2], [3, 4], [5, 6], [1, 2]]) assert str(poly) == str( geom.readGML(geom.writeGML(poly, ver=3.2), ver=3.2))
def testPolygon(self): p = geom.Polygon([[1, 2], [3, 4], [5, 6], [1, 2]]) self.assertEqual('POLYGON ((1 2, 3 4, 5 6, 1 2))', str(p))