def test_coordinate_operation__to_proj4(): operation = CoordinateOperation.from_string( "+proj=pipeline +step +proj=axisswap +order=2,1 +step " "+proj=unitconvert +xy_in=deg +xy_out=rad +step " "+proj=webmerc +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84") proj_string = operation.to_proj4() assert "+proj=pipeline" in proj_string assert "\n" not in proj_string
def test_operations__scope_remarks(): transformer = Transformer.from_crs(28356, 7856) coord_op = CoordinateOperation.from_string(transformer.to_wkt()) assert coord_op.operations == transformer.operations # scope does not transfer for some reason # assert [op.scope for op in transformer.operations] == [ # op.scope for op in coord_op.operations # ] assert [op.remarks for op in transformer.operations ] == [op.remarks for op in coord_op.operations]
def test_operations__scope_remarks(): operation = TransformerGroup(28356, 7856).transformers[0].operations[1] coord_op = CoordinateOperation.from_string(operation.to_wkt()) assert coord_op == operation assert coord_op.remarks == operation.remarks assert coord_op.scope == operation.scope
def test_operations(): transformer = TransformerGroup(28356, 7856).transformers[0] coord_op = CoordinateOperation.from_string(transformer.to_wkt()) assert coord_op.operations == transformer.operations
def test_coordinate_operation__from_string__invalid(invalid_str): with pytest.raises(CRSError, match="Invalid coordinate operation string"): CoordinateOperation.from_string(invalid_str)
def test_coordinate_operation__from_string(input_str): co = CoordinateOperation.from_string(input_str) assert co.name == "RGF93 to WGS 84 (1)"
def test_coordinate_operation__from_string__invalid(): with pytest.raises(CRSError, match="Invalid coordinate operation string"): CoordinateOperation.from_string("3-598y5-98y") with pytest.raises(CRSError, match="Invalid coordinate operation string"): CoordinateOperation.from_string("urn:ogc:def:datum:EPSG::6326")
def test_coordinate_operation__from_string(): co = CoordinateOperation.from_string( "urn:ogc:def:coordinateOperation:EPSG::1671") assert co.name == "RGF93 to WGS 84 (1)"