Skip to content

Commit

Permalink
apply to all spacial queries and update some descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
eveleighoj committed Nov 7, 2023
1 parent 497415f commit 0a37a07
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
8 changes: 4 additions & 4 deletions application/data_access/entity_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,15 @@ def _apply_location_filters(session, query, params):
EntityOrm.geometry.is_not(None),
func.ST_IsValid(EntityOrm.geometry),
func.ST_IsValid(intersecting_entities_query.c.geometry),
func.ST_Intersects(
spatial_function(
EntityOrm.geometry,
intersecting_entities_query.c.geometry,
),
),
and_(
EntityOrm.point.is_not(None),
func.ST_IsValid(intersecting_entities_query.c.geometry),
func.ST_Intersects(
spatial_function(
EntityOrm.point, intersecting_entities_query.c.geometry
),
),
Expand All @@ -231,12 +231,12 @@ def _apply_location_filters(session, query, params):
EntityOrm.geometry.is_not(None),
func.ST_IsValid(EntityOrm.geometry),
func.ST_IsValid(reference_query.c.geometry),
func.ST_Intersects(EntityOrm.geometry, reference_query.c.geometry),
spatial_function(EntityOrm.geometry, reference_query.c.geometry),
),
and_(
EntityOrm.point.is_not(None),
func.ST_IsValid(reference_query.c.geometry),
func.ST_Intersects(EntityOrm.point, reference_query.c.geometry),
spatial_function(EntityOrm.point, reference_query.c.geometry),
),
),
)
Expand Down
18 changes: 11 additions & 7 deletions application/search/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,26 +170,30 @@ class QueryFilters:
geometry: Optional[List[str]] = Query(
None,
description="""
Search for entities with geometries intersecting with one or more geometries provided in WKT format""",
Search for entities with geometries interacting with one or more geometries provided in WKT format.
The type of geometric relation can be set using the geometry relation parameter.""",
)
geometry_entity: Optional[List[int]] = Query(
None,
description="""Search for entities with geometries intersecting with one or more geometries
taken from each of the provided entities""",
description="""Search for entities with geometries interacting with one or more geometries
taken from each of the provided entities. The type of geometric relation can be set using the
geometry relation parameter.""",
ge=1,
)
geometry_reference: Optional[List[str]] = Query(
None,
description="""
Search entities with geometries intersecting with the geometries of
entities with the provided references
Search entities with geometries interacting with the geometries of
entities with the provided references. The type of geometric relation
can be set using the geometry relation parameter.
""",
)
geometry_curie: Optional[List[str]] = Query(
None,
description="""
Search for entities with geometries intersecting with geometries
entities matching provided curies
Search for entities with geometries interacting with geometries
entities matching provided curies. The type of geometric relation
can be set using the geometry relation parameter.
""",
)
geometry_relation: Optional[GeometryRelation] = Query(
Expand Down

0 comments on commit 0a37a07

Please sign in to comment.