Skip to content

Commit

Permalink
Add tests for extents where bbox does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Jan 14, 2025
1 parent 79e2f59 commit 2301c3d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,14 @@ include("geojson_samples.jl")
end
end

@testset "Extents" begin
# First, test that `Extents.extent` returns nothing for a geometry with no bbox
feature = GeoJSON.read(Samples.b)
@test isnothing(GI.Extents.extent(feature))
# Next, test that `GI.extent` returns the correct extent for a geometry with a bbox
@test GI.extent(feature) == mapreduce(GI.extent, GI.Extents.union, GI.getpoint(feature.geometry))
end

@testset "GeoInterface tests" begin
@test all(GI.testgeometry, GeoJSON.read.(Samples.geometries))
@test all(GI.testfeature, GeoJSON.read.(Samples.features))
Expand Down

0 comments on commit 2301c3d

Please sign in to comment.