def test_Location_load(): l1 = Location(*xy) if not l1==Location.load(l1): error("load") # From pt pt = point(*xy, srs=4326) pt.TransformTo(EPSG3035) if not l1==Location.load(pt): error("load") # From xy if not l1==Location.load(xy): error("load") # From str if not l1==Location.load(' ( 9.00000,5.00000) ',): error("load") # From xy with srs xy_3035 = pt.GetX(), pt.GetY() if not l1==Location.load(xy_3035, srs=3035): error("load") if not l1==Location.load( list(xy_3035), srs=3035): error("load") if not l1==Location.load( np.array(xy_3035), srs=3035): error("load") print( "Location_load passed")
def test_Location_load(): l1 = Location(*xy) assert l1 == Location.load(l1) # From pt pt = geom.point(*xy, srs=4326) pt.TransformTo(EPSG3035) assert l1 == Location.load(pt) # From xy assert l1 == Location.load(xy) # From str assert l1 == Location.load(' ( 9.00000,5.00000) ',) # From xy with srs xy_3035 = pt.GetX(), pt.GetY() assert l1 == Location.load(xy_3035, srs=3035) assert l1 == Location.load(list(xy_3035), srs=3035) assert l1 == Location.load(np.array(xy_3035), srs=3035)