Reference
SimpleFeatures.df_to_sf
SimpleFeatures.sf_to_df
SimpleFeatures.st_area
SimpleFeatures.st_bbox
SimpleFeatures.st_buffer
SimpleFeatures.st_cast
SimpleFeatures.st_centroid
SimpleFeatures.st_combine
SimpleFeatures.st_difference
SimpleFeatures.st_disjoint
SimpleFeatures.st_distance
SimpleFeatures.st_intersection
SimpleFeatures.st_intersects
SimpleFeatures.st_length
SimpleFeatures.st_nearest_points
SimpleFeatures.st_rasterize
SimpleFeatures.st_read_parquet
SimpleFeatures.st_segmentize
SimpleFeatures.st_simplify
SimpleFeatures.st_transform
SimpleFeatures.st_union
SimpleFeatures.st_write
SimpleFeatures.st_write_parquet
SimpleFeatures.toProjJSON
SimpleFeatures.toWKT2
SimpleFeatures.df_to_sf
— Functiondftosf(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.
SimpleFeatures.sf_to_df
— Methodsftodf(x::SimpleFeature; geom_column=:geom)
Convert a SimpleFeature object to a DataFrame containing a column of ArchGDAL geometries.
SimpleFeatures.st_area
— Methodst_area(x::SimpleFeature; geom_column=:geom)
Returns a vector of geometry areas in units of the crs.
SimpleFeatures.st_bbox
— Methodst_bbox(x::SimpleFeature; geom_column=:geom)
Create a bounding box polygon for the provided SimpleFeature object. Resulting polygon is and AG.wkbPolygon type.
SimpleFeatures.st_buffer
— Methodst_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.
SimpleFeatures.st_cast
— Methodst_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"
SimpleFeatures.st_centroid
— Methodst_centroid(x::SimpleFeature; geom_column=:geom)
Create a SimpleFeature object of point centroids of the input geometries.
SimpleFeatures.st_combine
— Methodst_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.
SimpleFeatures.st_difference
— Methodst_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
.
SimpleFeatures.st_disjoint
— Methodst_disjoint(x::SimpleFeature, y::SimpleFeature; geom_column=:geom, sparse::Bool=true)
Returns a sparse index list of disjoint features.
SimpleFeatures.st_distance
— Methodst_distance(x::SimpleFeature, y::SimpleFeature; geom_column=:geom)
Returns a matrix of distances between each x and y geometry in units of the crs.
SimpleFeatures.st_intersection
— Methodst_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
.
SimpleFeatures.st_intersects
— Methodst_intersects(x::SimpleFeature, y::SimpleFeature; geom_column=:geom, sparse::Bool=true)
Returns a sparse index list of intersecting features.
SimpleFeatures.st_length
— Methodst_length(x::SimpleFeature; geom_column=:geom)
Returns a vector of geometry lengths in units of the crs.
SimpleFeatures.st_nearest_points
— Methodst_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.
SimpleFeatures.st_rasterize
— Methodst_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 objecty
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 rasternodataval
Specify the value to be used as NoData in the output rasteroptions
Additional options passed to gdal_rasterize. See Creation Options for the desired output raster drivertemp_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
SimpleFeatures.st_read_parquet
— Methodst_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.
SimpleFeatures.st_segmentize
— Methodst_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
SimpleFeatures.st_simplify
— Functionst_simplify(x::SimpleFeature; geom_column=:geom)
Create a SimpleFeature object with simplified input geometries.
SimpleFeatures.st_transform
— Methodst_transform(x::SimpleFeature, crs::GFT.GeoFormat; geom_column=:geom, order=:compliant)
Create a new SimpleFeature object that is projected to the provided crs
.
SimpleFeatures.st_union
— Methodst_union(x::SimpleFeature; geom_column=:geom)
Create a SimpleFeature object that unions all input geometries.
SimpleFeatures.st_write
— Methodst_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.
SimpleFeatures.st_write_parquet
— Methodst_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.
SimpleFeatures.toProjJSON
— MethodtoProjJSON(spref::AbstractSpatialRef)
Convert this SRS into ProjJSON format.
SimpleFeatures.toWKT2
— MethodtoWKT2(spref::AbstractSpatialRef)
Convert this SRS into WKT2 format.