GeoParquet
Adding geospatial data to Parquet. Follows the GeoParquet v0.4 spec.
Usage
Reading geoparquet files can be done with read.
julia> import GeoParquet as GP
julia> url = "https://github.com/opengeospatial/geoparquet/raw/v0.4.0/examples/example.parquet"
julia> fn = download(url)
julia> df = GP.read(fn)
5×6 DataFrame
Row │ pop_est continent name iso_a3 gdp_md_est geometry
│ Int64? String? String? String? Float64? WellKnow…
─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ 920938 Oceania Fiji FJI 8374.0 WellKnownBinary{Geom, Vector{UIn…
2 │ 53950935 Africa Tanzania TZA 150600.0 WellKnownBinary{Geom, Vector{UIn…
3 │ 603253 Africa W. Sahara ESH 906.5 WellKnownBinary{Geom, Vector{UIn…
4 │ 35623680 North America Canada CAN 1.674e6 WellKnownBinary{Geom, Vector{UIn…
5 │ 326625791 North America United States of America USA 1.856e7 WellKnownBinary{Geom, Vector{UIn…Writing requires Table like input with geometry columns that are WellKnownBinary from GeoFormatTypes.jl, or geometries that support GeoInterface.jl.
julia> GeoParquet.write("test.parquet", df; geometrycolumn=:geometry)
test.parquetIndex
API Documentation
GeoParquet.read — Method
read(fn; kwargs...)::DataFrameRead a GeoParquet file as DataFrame. Kwargs are passed to the Parquet2.Dataset constructor.
GeoParquet.write — Method
write(ofn, t; geometrycolumn=GI.geometrycolumns(t), crs::Union{GFT.ProjJSON,Nothing}=nothing, bbox::Union{Nothing,Vector{Float64}}=nothing, kwargs...)Write a table with geometry columns to a Parquet file. Returns ofn on success. geometrycolumn is a Symbol or a Tuple of Symbols, of which the first is the primary geometry column. Other keyword arguments are passed to the Parquet2 writefile method. The geometry columns should be a Vector{GeoFormat.WellKnownBinary} or their elements should support GeoInterface. You can construct one with WellKnownGeometry for geometries that support GeoInterface.