def test_Location_fromXY(): l1 = Location(*xy) pt = geom.point(*xy, srs=4326) pt.TransformTo(EPSG3035) l2 = Location.fromXY(pt.GetX(), pt.GetY(), srs=EPSG3035) assert l1 == l2
def test_Location_fromXY(): l1 = Location(*xy) pt = point(*xy, srs=4326) pt.TransformTo(EPSG3035) l2 = Location.fromXY(pt.GetX(), pt.GetY(), srs=EPSG3035) if not l1==l2: error("fromXY") print( "Location_fromXY passed")
def test_Location_geom(): l1 = Location(*xy) g = l1.geom assert g.GetSpatialReference().IsSame(EPSG4326) assert np.isclose(g.GetX(), xy[0]) assert np.isclose(g.GetY(), xy[1]) l2 = Location.fromXY(*xy, srs=EPSG3035) assert not g.GetSpatialReference().IsSame(EPSG3035)