def test_disjoint_linestring_attr(): result = parse('DISJOINT(LINESTRING(1 1,2 2), geometry)') assert result == ast.GeometryDisjoint( values.Geometry( geometry.LineString([(1, 1), (2, 2)]).__geo_interface__, ), ast.Attribute('geometry'), )
def test_disjoint_linestring_attr(): result = parse({ "disjoint": [ { "type": "LineString", "coordinates": [[1, 1], [2, 2]], "bbox": [1.0, 1.0, 2.0, 2.0] }, {"property": "geometry"}, ] }) assert result == ast.GeometryDisjoint( values.Geometry( normalize_geom( geometry.LineString([(1, 1), (2, 2)]).__geo_interface__ ), ), ast.Attribute('geometry'), )
def test_geom_disjoint(): result = parse(''' <fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema-datatypes"> <fes:Disjoint> <fes:ValueReference>attr</fes:ValueReference> <gml:LineString xmlns:gml="http://www.opengis.net/gml"> <gml:posList>1.0 1.0 2.0 2.0</gml:posList> </gml:LineString> </fes:Disjoint> </fes:Filter> ''') assert result == ast.GeometryDisjoint( ast.Attribute('attr'), values.Geometry({ 'type': 'LineString', 'coordinates': [ (1.0, 1.0), (2.0, 2.0), ], }))