Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Support cql2 filter on the esri provider

Đang mở
#2,433 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@fredmorin đang làm issue này rồi.

Từ ngày 9/10/2026.

  • #2434 của @fredmorin — đang mở

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
22/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
api, backend

Hướng nghiên cứu

Start with the RFC4 process linked in the issue and the ESRIServiceProvider class, then see how the existing provider builds its query parameters. The work is to translate the pygeofilter AST into a where clause plus geometry, geometryType and spatialRel parameters, with the 400 cases the issue lists. Done means the design is agreed in the thread and the provider's tests cover those cases.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

Is your feature request related to a problem? Please describe.

The ESRI Feature Service provider (ESRIServiceProvider) does not support
Common Query Language (CQL2) filtering. While other feature providers (e.g.
PostgreSQL, Elasticsearch, OGR) let users filter collections with the filter
query parameter, ESRI-backed collections can only be filtered through bbox
and simple property equality. This is limiting when exposing ArcGIS
Feature/Map services through OGC API - Features, since ArcGIS natively supports
rich attribute, temporal and spatial querying that is currently unreachable.

Describe the solution you'd like

Add CQL2 filtering support to the ESRI provider by translating CQL2 filter
expressions (pygeofilter AST) into native ESRI query parameters:

  • Attribute and temporal predicates → ESRI where clause: logical operators
    (AND, OR, NOT), comparisons (=, <>, <, <=, >, >=), LIKE,
    IN, BETWEEN, IS NULL, and temporal predicates (T_BEFORE, T_AFTER,
    T_EQUALS, T_DURING) with DATE/TIMESTAMP literals.
  • A single spatial predicate (S_INTERSECTS, S_WITHIN, S_CONTAINS,
    S_CROSSES, S_TOUCHES, S_OVERLAPS, BBOX) → ESRI geometry,
    geometryType and spatialRel parameters, combinable with
    attribute/temporal filters via a top-level AND.

Attribute values/literals should be escaped (single quotes doubled) to prevent
SQL injection, and attribute names validated against the layer fields.
Unsupported constructs should return HTTP 400.

Describe alternatives you've considered

  • Client-side filtering: fetch all features and filter in pygeoapi. Rejected
    — defeats the purpose of pushing queries down to the service and does not
    scale.
  • Mapping only to where (attributes/temporal, no spatial): simpler, but
    leaves native ArcGIS spatial querying unused; combining with bbox is not
    equivalent to arbitrary spatial predicates.
  • Using an existing pygeofilter ESRI backend: none exists upstream, so a
    dedicated translation layer in the provider is the most direct approach.

Additional context

Some ESRI-specific limitations are expected and would be documented/returned as
HTTP 400:

  • S_DISJOINT is not expressible as an ESRI spatial relationship.
  • Only one spatial predicate is supported per filter.
  • A spatial predicate may not be nested under OR/NOT.
  • The bbox query parameter cannot be combined with a CQL2 spatial predicate.
  • S_WITHIN uses the native esriSpatialRelWithin, which does not return point
    features within a polygon; S_INTERSECTS is recommended for point layers.

I have a working implementation with unit tests and documentation ready to
submit as a PR, pending discussion here (per RFC4).

Ngôn ngữ chính
Python
Star
626
Fork
334
Merge trung bình
20 giờ 31 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của geopython/pygeoapi

Tất cả issue của geopython/pygeoapi

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.