Skip to content

GeoInterface.distance breaks with new return type of GeoInterface.getgeom #419

@henrik-wolf

Description

@henrik-wolf

I have some code which broke when the return type of getgeom changed in #369.

A mwe of the problem would be:

julia> using GeoInterface

julia> using ArchGDAL

julia> my_linestring = ArchGDAL.createlinestring([(0.0, 0.0), (1.0, 1.0)])
Geometry: LINESTRING (0 0,1 1)

julia> GeoInterface.distance(getgeom(my_linestring, 1), my_linestring)
ERROR: MethodError: no method matching distance(::PointTrait, ::LineStringTrait, ::Tuple{Float64, Float64}, ::ArchGDAL.IGeometry{ArchGDAL.wkbLineString})

I guess this could be fixed by adding the relevant dispatches to ArchGDAL in which we convert the tuple to a point which might be fine for this application? (The more general question of "how to handle these functions when combining different GeoInterface enabled packages" feels fairly complicated...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions