Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscribe to FeatureTrait() for Shapefile.Row #111

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Shapefile"
uuid = "8e980c4a-a4fe-5da2-b3a7-4b4b0353a2f4"
license = "MIT"
version = "0.13.0"
version = "0.13.1"

[deps]
DBFTables = "75c7ada1-017a-5fb6-b8c7-2125ff2d6c93"
Expand Down
1 change: 1 addition & 0 deletions src/table.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ end
Base.propertynames(row::Row) = [:geometry, propertynames(getfield(row, :record))...]

GeoInterface.isfeature(t::Row) = true
GeoInterface.trait(::Row) = GeoInterface.FeatureTrait()
GeoInterface.geometry(t::Row) = getfield(t, :geometry)
GeoInterface.properties(t::Row) = getfield(t, :record)

Expand Down
1 change: 1 addition & 0 deletions test/table.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ wkt = "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",637813
@test size(df_land) == (127, 4)
@test names(df_land) == ["geometry", "featurecla", "scalerank", "min_zoom"]
df_land.featurecla isa Vector{Union{String,Missing}}
@test GeoInterface.trait(GeoInterface.getfeature(ne_land, 1)) isa GeoInterface.FeatureTrait
Copy link
Member Author

@asinghvi17 asinghvi17 Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing because Table doesn't have a featurecollection trait. I guess we could just subset the table.

end

@testset "ne_coastline" begin
Expand Down
Loading