-
-
Notifications
You must be signed in to change notification settings - Fork 177
Description
When a CSW GetRecords request is run against a PostgreSQL backend and uses Dwithin spatial_query, the query that is generated to PostgreSQL is in "degree" units instead of "metres" as requested
Problem Description
When querying the PYCSW with the dwithin spatial_query, for example:
ogc:Filter
ogc:DWithin
ogc:PropertyNameows:BoundingBox</ogc:PropertyName>
<gml:Point srsName="urn:ogc:def:crs:EPSG::4326">
gml:pos23.7342660 37.974720</gml:pos>
</gml:Point>
<ogc:Distance units="meters">50</ogc:Distance>
</ogc:DWithin>
</ogc:Filter>
When pycsw translates the query, it ignores the Distance units="meters"
From:
Line 375 in 9b9afc9
| elif spatial_predicate == 'dwithin': |
We need to change the generated query from:
WHERE st_dwithin(wkb_geometry, st_geomfromtext('POINT(23.7342660 37.974720)',4326), 50.000000) = 'true'
To:
WHERE st_dwithin(wkb_geometry::geography, st_geomfromtext('POINT(23.7342660 37.974720)',4326)::geography, 50.000000) = 'true'