diff --git a/pygeoapi/provider/postgresql.py b/pygeoapi/provider/postgresql.py index db1b146..e1032f3 100644 --- a/pygeoapi/provider/postgresql.py +++ b/pygeoapi/provider/postgresql.py @@ -199,7 +199,7 @@ class PostgreSQLProvider(BaseProvider): with DatabaseConnection(self.conn_dic, self.table) as db: cursor = db.conn.cursor(cursor_factory=RealDictCursor) sql_query = SQL("DECLARE \"geo_cursor\" CURSOR FOR \ - SELECT {},ST_AsGeoJSON({}) FROM {} WHERE {} @ \ + SELECT {},ST_AsGeoJSON({}) FROM {} WHERE {} && \ ST_MakeEnvelope({}, {}, {}, {})").\ format(db.columns, Identifier(self.geom), diff --git a/tests/test_postgresql_provider.py b/tests/test_postgresql_provider.py index 83d43c1..a362d4f 100644 --- a/tests/test_postgresql_provider.py +++ b/tests/test_postgresql_provider.py @@ -71,7 +71,7 @@ def test_query_bbox(config): boxed_feature_collection = psp.query( bbox=[29.3373, -3.4099, 29.3761, -3.3924] ) - assert len(boxed_feature_collection['features']) == 3 + assert len(boxed_feature_collection['features']) == 5 def test_get(config):