API Reference
This is the private internal documentation of the AtlansApi API.
Index
Atlans.Model
AtlansApi.GeoTop
AtlansApi.GeoTop
AtlansApi.add_antropogenic
AtlansApi.create_surcharge
AtlansApi.generate_unique_directory_id
AtlansApi.prepare_voxelstack
AtlansApi.rasterize_like
AtlansApi.rasterize_like
AtlansApi.rasterize_like
AtlansApi.read_ahn
AtlansApi.run
AtlansApi.run_model
AtlansApi.run_model
AtlansApi.session
AtlansApi.shift_down
AtlansApi.shift_up
AtlansApi.surcharge_netcdf
Base.write
Specific function
# AtlansApi.rasterize_like
— Function.
rasterize_like(features::GeoJSON.FeatureCollection, geotop::GeoTop; kw...)
Rasterize the “fids” of an incoming geojson with polygons within the 2D raster extent of the modelling area of GeoTop.
rasterize_like(features::GeoJSON.FeatureCollection, geotop::GeoTop, field::Symbol)
Rasterize a field of an incoming geojson with polygons within the 2D raster extent of the modelling area of GeoTop.
Modules
Types
# Atlans.Model
— Method.
Model(geotop::GeoTop, ahn::Raster, thickness::Raster, gw::Number)
Create a model of Atlantis SoilColumns based on the provided geographical and geological data. SoilColumns are created for locations where surcharge thickness is available.
# AtlansApi.GeoTop
— Method.
GeoTop(url::AbstractString, bbox::BoundingBox)
Read GeoTop data directly from the Opendap server for a selected area in a bounding box.
# AtlansApi.GeoTop
— Method.
GeoTop(geotop::Dataset, bbox::BoundingBox)
Select GeoTop data for a selected bounding box from a NCDatasets.Dataset.
Functions
# AtlansApi.add_antropogenic
— Method.
add_antropogenic(
::Vector{Number},
thickness::Vector{Number},
strat::Vector{Number},
litho::Number
difference )
Add a layer of antropogenic material to the voxelstack with the appropriate thickness.
# AtlansApi.create_surcharge
— Method.
create_surcharge(thickness::Raster)
Create an Atlantis Surcharge
based on the Raster dataset with the surcharge thickness to apply. Returns an Atlans.Forcings
object that contains the surcharge and which can be passed to an Atlantis model simulation.
# AtlansApi.generate_unique_directory_id
— Method.
generate_unique_directory_id()
Helper function to generate a unique directory id-hash for different API calls to store model output tifs.
# AtlansApi.prepare_voxelstack
— Method.
prepare_voxelstack(
::Vector{Number},
z::Number,
surface::Vector{Number},
strat::Vector{Number}
litho )
Create an Atlantis VerticalDomain
from a voxelstack of GeoTOP. This checks the depths against the surface level elevation and corrects voxel thicknesses that are above or below the surface level. If the surface level elevation is more than 2 meters higher than the elevation of the highest voxel, a layer of antropogenic material is added with the appropriate thickness.
Arguments:
z
: NAP Depth of each voxel.surface
: Surface level elevation in NAP.strat
: Stratigraphic unit of each voxel.litho
: Lithology of each voxel.
# AtlansApi.rasterize_like
— Method.
rasterize_like(features::GeoJSON.FeatureCollection, geotop::GeoTop, field::Symbol)
Rasterize a field of an incoming geojson with polygons within the 2D raster extent of the modelling area of GeoTop.
# AtlansApi.rasterize_like
— Method.
rasterize_like(features::GeoJSON.FeatureCollection, geotop::GeoTop; kw...)
Rasterize the “fids” of an incoming geojson with polygons within the 2D raster extent of the modelling area of GeoTop.
# AtlansApi.read_ahn
— Method.
read_ahn(path::AbstractString, bbox::BoundingBox)
Read a 100x100 meter resolution tif of AHN data.
# AtlansApi.run
— Method.
run(simulation::Atlans.Simulation)
Run the Atlans.Simulation object and return the subsidence results for “initial” and “remaining” periods.
# AtlansApi.run_model
— Method.
run_model(features::Features, groundwater::Number)
Run a model simulation using the provided features and groundwater level. This builds an Atlantis model directly from GeoTOP data and a local AHN raster. The simulation is run for a time period of 60 years, divided into the first 3 years (“initial”) and the remaining 57 years (“remaining”) and returns a SurchargeResult
object.
# AtlansApi.run_model
— Method.
run_model(req::HTTP.Request)
Process an HTTP request to run an Atlantis model simulation for surcharge calculations based on the provided input data.
Request JSON Structure
gw
: A numerical value representing the groundwater level.geojson
: A GeoJSON object representing the geographical features.
Response JSON Structure
id
: A unique identifier for the generated directory.initial
: The file path to the initial TIFF file.remaining
: The file path to the remaining TIFF file.
Errors
- Returns a 400 HTTP response with an error message if the input is invalid.
# AtlansApi.session
— Method.
session(host::String, port::Int)
Start an HTTP server session to listen for incoming requests to run Atlantis model simulations.
# AtlansApi.shift_down
— Method.
shift_down(
::Vector{Number},
thickness::Vector{Number},
strat::Vector{Number},
litho::Number,
surface::Number
modelbase )
Shift the top level of a voxelstack down to the surface level. This function reduces the thickness of the top voxel or adds the thickness of the top voxel to the voxel below if the thickness is less than 0.1 meters.
# AtlansApi.shift_up
— Method.
shift_up(
::Vector{Number},
thickness::Vector{Number},
strat::Vector{Number},
litho::Number,
surface::Number
modelbase )
Shift the top level of a voxelstack up to the surface level. This function increases the thickness of the top voxel or adds a new voxel with the appropriate thickness.
# AtlansApi.surcharge_netcdf
— Method.
surcharge_netcdf(thickness::Raster)
Create a temporary NetCDF Dataset for the surcharge to apply in Atlantis based on a Raster dataset of the surcharge thickness.
# Base.write
— Method.
write(
::SurchargeResult,
result::AbstractString,
path_initial::AbstractString
path_remaining )
Write the initial and remaining surcharge results to tif files.