File tree Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change @@ -379,6 +379,40 @@ async def test_search_line_string_intersects(
379
379
assert len (resp_json ["features" ]) == 1
380
380
381
381
382
+ async def test_search_geometry_collection_intersects (
383
+ load_test_data , app_client , load_test_collection
384
+ ):
385
+ coll = load_test_collection
386
+ item = load_test_data ("test_item.json" )
387
+ resp = await app_client .post (f"/collections/{ coll .id } /items" , json = item )
388
+ assert resp .status_code == 200
389
+
390
+ point = [150.04 , - 33.14 ]
391
+ line = [[150.04 , - 33.14 ], [150.22 , - 33.89 ]]
392
+ intersects = {
393
+ "type" : "GeometryCollection" ,
394
+ "geometries" : [
395
+ {
396
+ "type" : "Point" ,
397
+ "coordinates" : point
398
+ },
399
+ {
400
+ "type" : "LineString" ,
401
+ "coordinates" : line
402
+ }
403
+ ]
404
+ }
405
+
406
+ params = {
407
+ "intersects" : intersects ,
408
+ "collections" : [item ["collection" ]],
409
+ }
410
+ resp = await app_client .post ("/search" , json = params )
411
+ assert resp .status_code == 200
412
+ resp_json = resp .json ()
413
+ assert len (resp_json ["features" ]) == 1
414
+
415
+
382
416
@pytest .mark .asyncio
383
417
async def test_landing_forwarded_header (
384
418
load_test_data , app_client , load_test_collection
Original file line number Diff line number Diff line change @@ -367,6 +367,40 @@ def test_search_line_string_intersects(
367
367
assert len (resp_json ["features" ]) == 1
368
368
369
369
370
+ def test_search_geometry_collection_intersects (
371
+ load_test_data , app_client , postgres_transactions
372
+ ):
373
+ item = load_test_data ("test_item.json" )
374
+ postgres_transactions .create_item (
375
+ item ["collection" ], item , request = MockStarletteRequest
376
+ )
377
+
378
+ point = [150.04 , - 33.14 ]
379
+ line = [[150.04 , - 33.14 ], [150.22 , - 33.89 ]]
380
+ intersects = {
381
+ "type" : "GeometryCollection" ,
382
+ "geometries" : [
383
+ {
384
+ "type" : "Point" ,
385
+ "coordinates" : point
386
+ },
387
+ {
388
+ "type" : "LineString" ,
389
+ "coordinates" : line
390
+ }
391
+ ]
392
+ }
393
+
394
+ params = {
395
+ "intersects" : intersects ,
396
+ "collections" : [item ["collection" ]],
397
+ }
398
+ resp = app_client .post ("/search" , json = params )
399
+ assert resp .status_code == 200
400
+ resp_json = resp .json ()
401
+ assert len (resp_json ["features" ]) == 1
402
+
403
+
370
404
def test_app_fields_extension_return_all_properties (
371
405
load_test_data , app_client , postgres_transactions
372
406
):
You can’t perform that action at this time.
0 commit comments