Adapter between GeoFrame and Geostatex.
Geostatex does not depend on GeoFrame. This module calls GeoFrame's public API (and Explorer's,
which GeoFrame brings) at runtime, and raises an ArgumentError saying so when GeoFrame is not
loaded. Add {:geoframe, ...} to your own dependencies to use it.
The observations are the centroids of the geometries of a GeoFrame.GeoDataFrame (a point is
its own centroid) and the values one of its numeric columns:
variogram/3- aGeostatex.Variogram;kriging/4- aGeostatex.Krigingmodel (:ordinaryor:universal);cross_validate/4-Geostatex.Kriging.cross_validate/4;predict/3- predictions and kriging variances at the centroids of another frame, as columns of that frame;grid/3- predictions on a regular grid, as a frame of points.
Geographic coordinates
Variograms and universal kriging are Euclidean, so they raise ArgumentError on a geographic
CRS unless allow_geographic: true. kriging/4 with :ordinary instead uses great-circle
distances on a geographic frame (coordinates_type: :geographic) unless told otherwise.
Examples
samples = GeoFrame.read_file!("meuse.gpkg")
model = Geostatex.GeoFrame.kriging(samples, "log_zinc", :ordinary, variogram_model: :spherical)
Geostatex.GeoFrame.grid(model, samples, cell: 40.0)
Summary
Functions
Leave-one-out cross-validation (Geostatex.Kriging.cross_validate/4) of column at the frame's
centroids, with the options of kriging/4 (and :n_closest_points).
Predictions on a regular grid of points, as a GeoFrame.GeoDataFrame with the columns "x",
"y", "prediction" and "variance". extent is a frame (its total bounds) or
{min_x, min_y, max_x, max_y}. Options
A kriging model of column at the frame's centroids: kind is :ordinary (default) or
:universal, with the options of Geostatex.Kriging.ordinary/3 or universal/3. A geographic
frame uses great-circle distances for ordinary kriging unless :coordinates_type is given.
The centroid coordinates of a frame's (or series') geometries, as {xs, ys} lists.
Predicts at the centroids of targets (a GeoFrame.GeoDataFrame) and returns it with two new
columns, "prediction" and "variance" (or prefix <> "prediction" with prefix:). Other
options go to Geostatex.Kriging.execute/5 (:n_closest_points, :specified_drift_arrays).
The experimental variogram (Geostatex.Variogram.new/3) of column at the frame's centroids.
Options of Geostatex.Variogram.new/3, plus allow_geographic: true.
Functions
Leave-one-out cross-validation (Geostatex.Kriging.cross_validate/4) of column at the frame's
centroids, with the options of kriging/4 (and :n_closest_points).
@spec grid(Geostatex.Kriging.t(), struct() | tuple(), keyword()) :: struct()
Predictions on a regular grid of points, as a GeoFrame.GeoDataFrame with the columns "x",
"y", "prediction" and "variance". extent is a frame (its total bounds) or
{min_x, min_y, max_x, max_y}. Options:
:cell- the grid spacing, or:nxand:ny, the number of columns and rows (default 50 each);:max_distance- drop the cells farther than this from every observation;:crs- the CRS of the result (default the extent frame's);- other options go to
Geostatex.Kriging.execute/5(:n_closest_points).
@spec kriging(struct(), String.t() | atom(), :ordinary | :universal, keyword()) :: Geostatex.Kriging.t()
A kriging model of column at the frame's centroids: kind is :ordinary (default) or
:universal, with the options of Geostatex.Kriging.ordinary/3 or universal/3. A geographic
frame uses great-circle distances for ordinary kriging unless :coordinates_type is given.
The centroid coordinates of a frame's (or series') geometries, as {xs, ys} lists.
@spec predict(Geostatex.Kriging.t(), struct(), keyword()) :: struct()
Predicts at the centroids of targets (a GeoFrame.GeoDataFrame) and returns it with two new
columns, "prediction" and "variance" (or prefix <> "prediction" with prefix:). Other
options go to Geostatex.Kriging.execute/5 (:n_closest_points, :specified_drift_arrays).
@spec variogram(struct(), String.t() | atom(), keyword()) :: Geostatex.Variogram.t()
The experimental variogram (Geostatex.Variogram.new/3) of column at the frame's centroids.
Options of Geostatex.Variogram.new/3, plus allow_geographic: true.