API
GeoDataFrames.read Function
read(driver::GeoParquetDriver, fn::AbstractString; kwargs...)Read fn using the GeoParquetDriver driver. Any additional keyword arguments are passed to Parquet2.read.
read(driver::FlatGeobufDriver, fn::AbstractString; kwargs...)Read fn using the FlatGeobufDriver driver.
read(driver::GeoArrowDriver, fn::AbstractString; kwargs...)Read fn using the GeoArrowDriver driver. Any additional keyword arguments are passed to Arrow.read.
read(driver::GeoJSONDriver, fn::AbstractString; kwargs...)Read fn using the GeoJSONDriver driver.
read(fn::AbstractString; kwargs...)Read a file into a DataFrame. Any kwargs are passed to the driver, by default set to ArchGDALDriver.
read(driver::AbstractDriver, fn::AbstractString; kwargs...)Read a file into a DataFrame using the specified driver. Any kwargs are passed to the driver, by default set to ArchGDALDriver.
read(driver::ArchGDALDriver, fn::AbstractString; layer::Union{Integer,AbstractString}, kwargs...)Read a file into a DataFrame using the ArchGDAL driver. By default you only get the first layer, unless you specify either the index (0 based) or name (string) of the layer. Other supported kwargs are passed to the ArchGDAL read method. The options keyword argument can be used to pass GDAL open options.
GeoDataFrames.write Function
write(driver::GeoParquetDriver, fn::AbstractString, table; kwargs...)Write the provided table to fn using the GeoParquetDriver driver. Any additional keyword arguments are passed to Parquet2.write.
write(driver::FlatGeobufDriver, fn::AbstractString, table; kwargs...)Write the provided table to fn using the FlatGeobufDriver driver.
Warning
This backend cannot write files yet; it will fall back to ArchGDAL.
write(driver::GeoArrowDriver, fn::AbstractString, table; kwargs...)Write the provided table to fn using the GeoArrowDriver driver. Any additional keyword arguments are passed to Arrow.write.
write(driver::GeoJSONDriver, fn::AbstractString, table; kwargs...)Write the provided table to fn using the GeoJSONDriver driver.
write(fn::AbstractString, table; kwargs...)Write the provided table to fn. A driver is selected based on the extension of fn.
write(driver::AbstractDriver, fn::AbstractString, table; kwargs...)Write the provided table to fn using the specified driver. Any kwargs are passed to the driver, by default set to ArchGDALDriver.
write(driver::ArchGDALDriver, fn::AbstractString, table; layer_name="data", crs::Union{GFT.GeoFormat,Nothing}=getcrs(table), driver::Union{Nothing,AbstractString}=nothing, options::Dict{String,String}=Dict(), geom_columns::Tuple{Symbol}=getgeometrycolumns(table), kwargs...)Write the provided table to fn using the ArchGDAL driver.
Drivers
The following drivers are provided:
These can be passed to the read and write functions as the first argument, but require the corresponding package to be loaded. You can find the corresponding package to load in the Package extensions section.
Utility functions
GeoDataFrames.setgeometrycolumn! Function
setgeometrycolumn!(df::DataFrame, column::Symbol)
setgeometrycolumn!(df::DataFrame, columns::Tuple{Vararg{Symbol}})Set the geometry column(s) of a GeoDataFrame df. Retrieve them with GeoInterface.geometrycolumns(df).
GeoDataFrames.setcrs! Function
setcrs!(df::DataFrame, crs)Set the coordinate reference system of the geometry column(s) of a GeoDataFrame df. Note that this overrides any existing CRS without transforming the geometries. For transforming geometries, use reproject!(df, target_crs) instead.
crs should be one of GeoFormatTypes wrappers, such as EPSG(code). Retrieve it with GeoInterface.crs(df).
GeometryOps.reproject Function
reproject(df::DataFrame, target_crs; [always_xy=true,])Reproject the geometries in a DataFrame df to a new Coordinate Reference System target_crs, from the current CRS. See also reproject(df, source_crs, target_crs) and the in place version reproject!(df, target_crs). always_xy (true by default) can override the default axis mapping strategy of the CRS. If true, input is assumed to be in the traditional GIS order (longitude, latitude).
reproject(df::DataFrame, source_crs, target_crs; [always_xy=true])Reproject the geometries in a DataFrame df from the crs source_crs to a new crs target_crs. This overrides any current CRS of the Dataframe.
GeoDataFrames.reproject! Function
reproject!(df::DataFrame, target_crs; [always_xy=true])Reproject the geometries in a DataFrame df to a new Coordinate Reference System target_crs, from the current CRS, in place.
reproject!(df::DataFrame, source_crs, target_crs; [always_xy=true])Reproject the geometries in a DataFrame df from the crs source_crs to a new crs target_crs in place. This overrides any current CRS of the Dataframe.
GeometryVector
GeoDataFrames.GeometryVector Type
GeometryVector(A)A vector of geometries, as used in GeoDataFrames.
source