Conversation
Member
|
@jkaniuka thanks for this. Can you add a test to this PR? Diff below (works locally): diff --git a/tests/parsers/cql_json/test_parser.py b/tests/parsers/cql_json/test_parser.py
index 5d45142..4e433c7 100644
--- a/tests/parsers/cql_json/test_parser.py
+++ b/tests/parsers/cql_json/test_parser.py
@@ -597,18 +597,17 @@ def test_overlaps_attr_multilinestring():
# # dwithin/beyond
-# def test_dwithin_attr_polygon():
-# result = parse('DWITHIN(geometry, POLYGON((1 1,2 2,0 3,1 1)), 5, feet)')
-# print(get_repr(result))
-# assert result == ast.SpatialDistancePredicateNode(
-# ast.Attribute('geometry'),
-# ast.LiteralExpression(
-# geometry.Polygon([(1, 1), (2, 2), (0, 3), (1, 1)])
-# ),
-# ast.SpatialDistanceOp('DWITHIN'),
-# distance=5,
-# units='feet',
-# )
+def test_dwithin_attr_polygon():
+ result = parse('DWITHIN(geometry, POLYGON((1 1,2 2,0 3,1 1)), 5, feet)')
+ assert result == ast.SpatialDistancePredicateNode(
+ ast.Attribute('geometry'),
+ ast.LiteralExpression(
+ geometry.Polygon([(1, 1), (2, 2), (0, 3), (1, 1)])
+ ),
+ ast.SpatialDistanceOp('DWITHIN'),
+ distance=5,
+ units='feet',
+ )
# def test_beyond_attr_polygon():
|
5 tasks done
Author
|
@tomkralidis Test added but there is some kind of issue with JSON decoder. Did you encounter it locally? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for
s_dwithinpredicate to query GeoJSON records whosefeature.geometryis within a given distance from a specified point.Here ➡️ pygeoapi/pull/2403 is a link to corresponding PR that modifies the Mongo provider in pygeoapi. Our goal is to enable queries like the one below:
{ "filter-lang": "cql2-json", "filter": { "op": "s_dwithin", "args": [ {"property": "feature.geometry"}, { "type": "Point", "coordinates": [13.0, 65.0] }, 250000, "meters" ] } }Thanks to @Jacob7052 for the implementation 😎