From e46aa3402e55c55f2175bfd79b4e13b07d51ee9a Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Sun, 14 Jul 2024 22:06:49 +0530 Subject: [PATCH 1/2] Make the default geometry columns in `GeoParquet.write` be `GI.geometrycolumns` --- src/io.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/io.jl b/src/io.jl index 2f51b80..26bfadb 100644 --- a/src/io.jl +++ b/src/io.jl @@ -5,7 +5,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")) From 9dc02e0d6377cab5ff0e8c548c908fc0ae5cdc4f Mon Sep 17 00:00:00 2001 From: Maarten Pronk Date: Fri, 20 Dec 2024 21:05:27 +0100 Subject: [PATCH 2/2] Fix tests. --- Project.toml | 2 +- test/runtests.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 224b090..03489dc 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.1" +version = "0.3.0" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" diff --git a/test/runtests.jl b/test/runtests.jl index a837776..9bb5907 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -46,14 +46,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