Reference

SimpleFeatures.df_to_sfFunction

dftosf(x::DataFrame, crs::GFT.GeoFormat=GFT.EPSG(4326); geom_column=:geom)

Convert a DataFrame containing a column of ArchGDAL geometries to a new SimpleFeature object.

source
SimpleFeatures.sf_to_dfMethod

sftodf(x::SimpleFeature; geom_column=:geom)

Convert a SimpleFeature object to a DataFrame containing a column of ArchGDAL geometries.

source
SimpleFeatures.st_bboxMethod
st_bbox(x::SimpleFeature; geom_column=:geom)

Create a bounding box polygon for the provided SimpleFeature object. Resulting polygon is and AG.wkbPolygon type.

source
SimpleFeatures.st_bufferMethod
st_buffer(x::SimpleFeature, d::Number; geom_column=:geom)
st_buffer(x::SimpleFeature, d::String; geom_column=:geom)

Create a new SimpleFeature object that is buffered by the provided distance d in units of the crs. d can be a number or a string representing the column of the SimpleFeature DataFrame that contains numbers to use for the buffer distance.

source
SimpleFeatures.st_castMethod
st_cast(x::SimpleFeature, to::String; groupid::Union{String,Nothing}=nothing, geom_column=:geom, kwargs...)

Cast features geometries to the requested type (to). See below for the ordered list of to values. Supply a groupid for aggregating geometries by a variable. Any decomposition from a multigeometry type to a single geometry type will add a unique ID of the multigeometry object as a column (e.g., _MultiPolygonID) so the original multigeometry can be re-created later.

Hierarchy of to values:

  • "multipolygon"
  • "polygon"
  • "multilinestring"
  • "linestring"
  • "multipoint"
  • "point"
source
SimpleFeatures.st_centroidMethod
st_centroid(x::SimpleFeature; geom_column=:geom)

Create a SimpleFeature object of point centroids of the input geometries.

source
SimpleFeatures.st_combineMethod
st_combine(x::SimpleFeature; geom_column=:geom)

Create a new SimpleFeature object that has combined all features into the relevant multigeometry type. No attributes of the original object are returned.

source
SimpleFeatures.st_differenceMethod
st_difference(x::SimpleFeature, y::SimpleFeature; geom_column=:geom)

Create a new SimpleFeature object that is the difference of x and y in the geometry type of x.

source
SimpleFeatures.st_disjointMethod
st_disjoint(x::SimpleFeature, y::SimpleFeature; geom_column=:geom, sparse::Bool=true)

Returns a sparse index list of disjoint features.

source
SimpleFeatures.st_distanceMethod
st_distance(x::SimpleFeature, y::SimpleFeature; geom_column=:geom)

Returns a matrix of distances between each x and y geometry in units of the crs.

source
SimpleFeatures.st_intersectionMethod
st_intersection(x::SimpleFeature, y::SimpleFeature; geom_column=:geom)

Create a new SimpleFeature object that is the intersection of x and y in the geometry type of y.

source
SimpleFeatures.st_intersectsMethod
st_intersects(x::SimpleFeature, y::SimpleFeature; geom_column=:geom, sparse::Bool=true)

Returns a sparse index list of intersecting features.

source
SimpleFeatures.st_nearest_pointsMethod
st_nearest_points(x::SimpleFeature, y::SimpleFeature; geom_column=:geom)

Returns a SimpleFeature object of lines between nearest points of each feature in x to y and columns indicating which row of x and y each line refers to.

source
SimpleFeatures.st_rasterizeMethod
st_rasterize(x::SimpleFeature, y::Union{String, AG.AbstractDataset}; filename::String, scale::Number=1, value::Union{String, Number, Nothing}=nothing, touches::Bool = false, dtype::String = "Float64", nodataval::Number = 0, options::Vector{String}=Vector{String}(["COMPRESS=LZW", "BIGTIFF=YES", "TILED=YES"]),temp_dir::Union{String, Nothing}=nothing, geom_column = :geom)

Convert a SimpleFeature object to a raster file.

Parameters

  • x A SimpleFeature object
  • y The raster used as a template for rasterization. Either the path to the raster or an ArchGDAL raster dataset.

Keyword Parameters

  • filename The output raster path. The output raster format is derived from the filename extension.
  • scale Factor to reduce resolution of template raster.
  • value The value written to the output raster. Either a single number or the string name of a column in the SimpleFeature object.
  • touches Should the output raster should include "all pixels touched by lines or polygons, not just those on the line render path, or whose center point is within the polygon" - gdalrasterize (https://gdal.org/programs/gdalrasterize.html)
  • dtype Data type of output raster
  • nodataval Specify the value to be used as NoData in the output raster
  • options Additional options passed to gdal_rasterize. See Creation Options for the desired output raster driver
  • temp_dir Specify an alternative location to create temporary files while performing rasterization. The default locations are the Scratch space for the SF package and /vsimem/ from GDAL.
  • geom_column = :geom
source
SimpleFeatures.st_read_parquetMethod
st_read_parquet(fn::String; crs::Union{Nothing, GFT.GeoFormat}=nothing, geom_type::Union{Nothing, AG.OGRwkbGeometryType}=nothing, kwargs...)

Read a parquet file into a SimpleFeature object. The crs info must be provided, but planned updates to this function will automatically read crs from the file. The geom_type does not need to be provided, and will be guessed from the first unique value of the first 100 features.

source
SimpleFeatures.st_segmentizeMethod
st_segmentize(x::SimpleFeature, max_length::Number; geom_column=:geom)

Create a new SimpleFeature object whose segments have been sliced into segments no larger than the provided max_length in units of the crs. See ArchGDAL.segmentize! for more info

source
SimpleFeatures.st_transformMethod
st_transform(x::SimpleFeature, crs::GFT.GeoFormat; geom_column=:geom, order=:compliant)

Create a new SimpleFeature object that is projected to the provided crs.

source
SimpleFeatures.st_unionMethod
st_union(x::SimpleFeature; geom_column=:geom)

Create a SimpleFeature object that unions all input geometries.

source
SimpleFeatures.st_writeMethod
st_write(fn::AbstractString, x::SimpleFeature; layer_name="data", geom_column=:geometry, crs::Union{GFT.GeoFormat,Nothing}=nothing, driver::Union{Nothing,AbstractString}=nothing, options::Vector{AbstractString}=[], geom_columns::Set{Symbol}=(:geometry))

Write the provided table to fn. The geom_column is expected to hold ArchGDAL geometries.

source
SimpleFeatures.st_write_parquetMethod
st_write_parquet(fn::AbstractString, x::SimpleFeature)

Write a SimpleFeature object to a parquet file. Geometry columns are automatically found, but only the first one is used.

source