Skip to content

Commit

Permalink
Define FeatureTrait for AbstractFeature (#457)
Browse files Browse the repository at this point in the history
* Update geointerface.jl

* Update test_feature.jl
  • Loading branch information
asinghvi17 authored Jan 8, 2025
1 parent 291a04f commit 369872a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/geointerface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ let pointtypes = (wkbPoint, wkbPoint25D, wkbPointM, wkbPointZM),
end

# Feature
GeoInterface.trait(feat::AbstractFeature) = GeoInterface.FeatureTrait()
GeoInterface.isfeature(feat::AbstractFeature) = true
function GeoInterface.crs(layer::AbstractFeatureLayer)
sr = getspatialref(layer)
Expand Down
1 change: 1 addition & 0 deletions test/test_feature.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ end
(index 1) pointname => point-a
"""
@test GI.isfeature(f2)
@test GI.trait(f2) isa GI.FeatureTrait
@test GI.isgeometry(GI.geometry(f2))
AG.getgeom(f1) do g1
@test sprint(print, g1) == "Geometry: POINT (100 0)"
Expand Down

0 comments on commit 369872a

Please sign in to comment.