Skip to content

Refactor gpf_wfs_get_features #33

Open
5 of 7 issues completed
Open

Description

@esgn

This is the most complex tool and is currently hard to use by a model.

Activity

  1. added theissue type on Apr 8, 2026
  2. self-assigned this
    on Apr 10, 2026
  3. esgn commented on Jun 24, 2026

    @esgn
    MemberAuthor

    @mborne have a look here ;)

    Current status

    Result type refactoring

    result_type refactoring

    • Create a gpf_wfs_count_features (naming to be discussed) to replace the hits option of result_type. This tool will only support the parameters compatible with the hits operation => attribute filter and spatial filter => TODO make an issue
    • http_get_url : We could return a data_url which would be the stateless WFS proxy URL we were discussing in here Linking MCP geocontext and MCP carto : in search of the best solution #154 in each response.
    • http_get_url : The LLM might need to ask just for the URL and not the full response. So what should we do ? Another tool like gpf_wfs_build_get_features_request ?

    Spatial filters

    Question : are they really exclusive ? I tend to think it's easier for now.

    intersects_feature_filter refactoring

    intersects_point_filter refactoring

    • dwithin_point_filter with distance 0 could be a replacement

    Attribute filter refactoring

    • is_not_null should be added to the list
    • We could stick to CQL2 operators (=, >=, etc.)
    • We could support OR instead of only AND but that might prove costly ...

    limit refactoring

    • Is limit really useful for the LLM ? Yes it will be useful for TOP N query for example, for testing on a limited subset the WFS query
    • limit is problematic for mcp-carto => To be dealt within the tool description ?
    • gpf_wfs_get_features will not return more than 5000 features to the LLM. 5000 features is already preposterous
    • Still some brain to be spent here ...
  4. esgn commented on Oct 2, 2026

    @esgn
    MemberAuthor

    Remaining work

    • gpf_wfs_get_features => intersects_feature when typename === intersects_feature_typename #53: intersects_feature_filter on the same typename (the neighbour_of idea). A guard currently rejects it and points to gpf_get_feature_by_id, even when intersection_area is requested, which by-id does not support.
    • Add an is_not_null operator to where (current operators: eq, ne, lt, lte, gt, gte, in, is_null).
    • Decide whether where should use CQL2 operators (=, >=, ...) and support OR in addition to AND.
    • Spatial filters: confirm that they stay mutually exclusive, and decide whether dwithin_point_filter with a distance of 0 replaces intersects_point_filter.
    • limit: no pagination yet (default 100, maximum 5000); decide whether one is needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

refactoringRethink code architecture

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions