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 Tables for geopackage and shapefile #141

Closed
Sov-trotter opened this issue Sep 15, 2020 · 4 comments
Closed

Test Tables for geopackage and shapefile #141

Sov-trotter opened this issue Sep 15, 2020 · 4 comments

Comments

@Sov-trotter
Copy link
Contributor

It's be nice to add tests for .shp and .gpkg files too. #118 (comment)

@Sov-trotter Sov-trotter changed the title Geopackage and shapefile tests for Tables Test Tables for geopackage and shapefile Sep 15, 2020
@Sov-trotter
Copy link
Contributor Author

@yeesian could you add the goodfirstissue and Hacktoberfest tags?

@mathieu17g
Copy link
Collaborator

@yeesian (cc: @Sov-trotter) this issue may be closed with PR #226 ?

ESRI Shapefile and GeoPackage layers exports to Table are somewhat tested in:

  • @testset "Conversion to table for ESRI Shapefile driver" begin
    ESRI_Shapefile_test_reference_geotable = (
    names = (Symbol(""), :id, :name),
    types = (Union{Missing,ArchGDAL.IGeometry}, Int64, String),
    values = (
    Union{Missing,String}[
    "POLYGON ((0 0,0 1,1 1))",
    "MULTIPOLYGON (((0 0,0 1,1 1)),((0.9 0.9,0.0 0.9,0 0)))",
    missing,
    "POLYGON ((0 0,-1 0,-1 1))",
    ],
    [1, 2, 3, 0],
    ["polygon1", "multipolygon1", "emptygeom", "emptyid"],
    ),
    )
    @test test_layer_to_table(
    "ESRI Shapefile",
    "polygon",
    true,
    true,
    true,
    ESRI_Shapefile_test_reference_geotable,
    )
    ESRI_Shapefile_test_reference_geotable = (
    names = (Symbol(""), :id, :name),
    types = (
    Union{
    Missing,
    ArchGDAL.IGeometry{ArchGDAL.wkbLineString},
    },
    Int64,
    String,
    ),
    values = (
    Union{Missing,String}[
    "LINESTRING (1 2,2 3,3 4)",
    "LINESTRING (3 4,4 5,5 6)",
    missing,
    "LINESTRING (5 6,6 7,7 8)",
    ],
    [1, 2, 3, 0],
    ["line1", "line2", "emptygeom", "emptyid"],
    ),
    )
    @test test_layer_to_table(
    "ESRI Shapefile",
    "line",
    true,
    true,
    false,
    ESRI_Shapefile_test_reference_geotable,
    )
    end
  • @testset "Conversion to table for GPKG driver" begin
    GPKG_test_reference_geotable = (
    names = (:geom, :id, :name),
    types = (Union{Missing,ArchGDAL.IGeometry}, Int64, String),
    values = (
    Union{Missing,String}[
    "LINESTRING (1 2,2 3,3 4)",
    "MULTILINESTRING ((1 2,2 3,3 4,4 5),(6 7,7 8,8 9,9 10))",
    missing,
    "LINESTRING (5 6,6 7,7 8)",
    ],
    [1, 2, 3, 0],
    ["line1", "multiline1", "emptygeom", "emptyid"],
    ),
    )
    @test test_layer_to_table(
    "GPKG",
    "line",
    true,
    true,
    true,
    GPKG_test_reference_geotable,
    )
    end

@yeesian
Copy link
Owner

yeesian commented Sep 3, 2021

Thanks for triaging the issue @mathieu17g :)

@yeesian yeesian closed this as completed Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants