diff --git a/Project.toml b/Project.toml index eca8968..95c5dd3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GeoParquet" uuid = "e99870d8-ce00-4fdd-aeee-e09192881159" authors = ["Maarten Pronk and contributors."] -version = "0.2.2" +version = "0.3.0" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" diff --git a/src/io.jl b/src/io.jl index 0144b5e..062ee29 100644 --- a/src/io.jl +++ b/src/io.jl @@ -9,7 +9,7 @@ Write a dataframe with a geometry column to a Parquet file. Returns `ofn` on suc The geometry column should be a `Vector{GeoFormat.WellKnownBinary}` or its elements should support GeoInterface. You can construct one with WellKnownGeometry for geometries that support GeoInterface. """ -function write(ofn::Union{AbstractString,Parquet2.FilePathsBase.AbstractPath}, df, geocolumns=(:geom,), crs::Union{GFT.ProjJSON,Nothing}=nothing, bbox::Union{Nothing,Vector{Float64}}=nothing; kwargs...) +function write(ofn::Union{AbstractString,Parquet2.FilePathsBase.AbstractPath}, df, geocolumns=GI.geometrycolumns(df), crs::Union{GFT.ProjJSON,Nothing}=nothing, bbox::Union{Nothing,Vector{Float64}}=nothing; kwargs...) # Tables.istable(df) || throw(ArgumentError("`df` must be a table")) diff --git a/test/runtests.jl b/test/runtests.jl index 0cf9ab4..efc76a7 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -73,14 +73,14 @@ end wkb = ArchGDAL.toWKB.(geom) df = DataFrame(test="test", value=rand(2), geometry=wkb) fn = "data/write.parquet" - GeoParquet.write(fn, df, (:geometry,)) + GeoParquet.write(fn, df) df = GeoParquet.read(fn) df.test[1] == "test" # Transparently convert columns to WKB fn = "data/writec.parquet" df = DataFrame(test="test", value=rand(2), geom=geom) - GeoParquet.write(fn, df) + GeoParquet.write(fn, df, (:geom,)) ndf = GeoParquet.read(fn) df.geom != ndf.geom # original is not mutated