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

Test all available geometry sources #134

Closed
rafaqz opened this issue May 6, 2024 · 2 comments · Fixed by #135
Closed

Test all available geometry sources #134

rafaqz opened this issue May 6, 2024 · 2 comments · Fixed by #135
Labels
enhancement New feature or request

Comments

@rafaqz
Copy link
Member

rafaqz commented May 6, 2024

We should automate testing across geometry types from:

ArchGDAL.jl
LibGEOS.jl
GeoInterface.jl
GeometryBasics.jl
Meshes.jl

Just using GI.convert in a loop over the modules.

And maybe Shapefile,jl and GeoJSON.jl ? These would need write/read to convert, as there is no GI.convert for them as its not very useful except for testing like this.

This would make use of GeometryOps.jl much more robust, avoiding errors like #133

It would also provide some useful tests on the rest of the ecosystems GeoInterface implementations.

@asinghvi17
Copy link
Member

asinghvi17 commented May 6, 2024

https://github.com/JuliaGeo/GeometryOps.jl/blob/main/benchmarks/geometry_providers.jl was meant to benchmark them but it ended up examining only the performance of Shapefile.jl.

It would work as a good base to run the rest, though.

@rafaqz
Copy link
Member Author

rafaqz commented May 6, 2024

I wrote a macro to wrap all our tests in:

using GeoInterface, ArchGDAL, GeometryBasics, LibGEOS

macro test_all_implementations(args, code)
    args = esc(args)
    quote
        for mod in (GeoInterface, ArchGDAL, GeometryBasics, LibGEOS)
            let ($args = map(g -> GeoInterface.convert(mod, g), $args))
                $code
            end
        end
    end
end

pointa = (1, 2)
pointb = (3, 4)
@test_all_implementations (pointa, pointb) begin 
    # tests here
end

@asinghvi17 asinghvi17 added the enhancement New feature or request label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants