Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Feb 22, 2023
1 parent 6c30aaa commit d034836
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ogr/geometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function to_gdal(geom)
GeoInterface.isgeometry(geom) || _not_a_geom_error()
trait = GeoInterface.geomtrait(geom)
typ = geointerface_geomtype(trait)
GeoInterface.convert(type, trait, geom)
GeoInterface.convert(typ, trait, geom)
end

@noinline _not_a_geom_error() =
Expand Down
14 changes: 14 additions & 0 deletions test/test_geos_operations.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Test
import ArchGDAL as AG
import GeoInterface as GI
using Extents

@testset "test_geos_operations.jl" begin
Expand Down Expand Up @@ -122,6 +123,8 @@ using Extents
@test AG.toWKT(result) == wkt2
end
@test AG.toWKT(f(geom)) == wkt2
wrapped_geom = GI.convert(GI, geom)
@test AG.toWKT(f(wrapped_geom)) == wkt2
end
end

Expand Down Expand Up @@ -164,6 +167,9 @@ using Extents
@test AG.toWKT(result) == wkt3
end
@test AG.toWKT(f(geom1, geom2)) == wkt3
wrapped_geom1 = GI.convert(GI, geom1)
wrapped_geom2 = GI.convert(GI, geom2)
@test AG.toWKT(f(wrapped_geom1, wrapped_geom2)) == wkt3
end
end
end
Expand All @@ -176,13 +182,21 @@ using Extents
AG.fromWKT(wkt1) do geom1
AG.fromWKT(wkt2) do geom2
@test AG.toWKT(f(geom1, geom2)) == wkt3
wrapped_geom1 = GI.convert(GI, geom1)
wrapped_geom2 = GI.convert(GI, geom2)
@test AG.toWKT(f(wrapped_geom1, wrapped_geom2)) == wkt3
end
end
end

function test_predicate(f::Function, wkt1, wkt2, result::Bool)
AG.fromWKT(wkt1) do geom1
AG.fromWKT(wkt2) do geom2
# Test GDAL geoms
@test f(geom1, geom2) == result
# Test GeoInterface geoms
wrapped_geom1 = GI.convert(GI, geom1)
wrapped_geom2 = GI.convert(GI, geom2)
@test f(geom1, geom2) == result
end
end
Expand Down

0 comments on commit d034836

Please sign in to comment.