Skip to content

ENH: Exclude same input geometry from output of nearest_all #324

@brendan-ward

Description

@brendan-ward

In this issue in Shapely, there is a need to find the nearest items in a tree constructed of the same geometries that are being used to query the tree, but return the non-self nearest neighbor(s).

One way to approach this would be to provide a new function that does not take new geometry inputs, but instead uses the underlying tree geometries in such a way that we can compare addresses of a geometry to the results returned within the nearest callback function, so as to avoid a more expensive test for equality. We would then return an arbitrarily large distance for the self-pair, to force the tree to look for the next nearest neighbor.

/cc @liunx7594

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestto-shapelyThis issue needs to be transferred to shapely

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions