Skip to content

Support excluding input geometry ("itself") in nearest STRtree query #400

@jorisvandenbossche

Description

@jorisvandenbossche

Shapely added an exclusive=True/False keyword to the STRTree nearest method to optionally "exclude the input geometry from the results", see shapely/shapely#1166

The implementation in Shapely currently checks for this based on the "equals" spatial predicate, so it is not necessarily strictly excluding the "input geometry", but any geometry that is spatially equal (so can even have different coordinates).
(more in general it's of course not possible to exactly exclude the input geometry, unless we would check for exact object identity (same pointer))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions