Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ext/GeometryBasicsGeoInterfaceExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,13 @@ function _collect_with_type(::Type{PT}, geom) where {PT <: Point{2}}
return [PT(GeoInterface.x(p), GeoInterface.y(p)) for p in getgeom(geom)]
end

# coordtype implementation - GeometryBasics encodes coordinate type in eltype
if :coordtype in names(GeoInterface; all = true)
# For types with coordinate type T as a type parameter
GeoInterface.coordtype(::GeoInterface.AbstractGeometryTrait, geom::Point{Dim,T}) where {Dim,T} = T
GeoInterface.coordtype(::GeoInterface.AbstractGeometryTrait, geom::AbstractGeometry{Dim,T}) where {Dim,T} = T
GeoInterface.coordtype(::GeoInterface.AbstractGeometryTrait, geom::Simplex{Dim,T,N}) where {Dim,T,N} = T
GeoInterface.coordtype(::GeoInterface.PolyhedralSurfaceTrait, geom::Mesh{Dim,T,E,V}) where {Dim,T,E,V} = T
end

end
Loading