The geospatial component brings GeoTIFF, WCS, WFS, GeoJSON and STAC resources into k.LAB. It exposes HortonMachine 0.11.3 through two k.Actors types and three numeric contextualizers. The component and services use GeoTools 34.4.
The audit records the original findings, the service contracts and the five-stage delivery plan. Geospatial audit
Build against the matching klab-services checkout. Install the component archive on Resources for file and catalogue ingestion and on Runtime for k.Actors adaptation and contextualizers. The remote numeric payload and submission-context changes must be present in their respective services.
<dependency>
<groupId>org.integratedmodelling</groupId>
<artifactId>klab.component.geospatial</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>elevation <- ctx.submit({{geography:Elevation}})
raster <- elevation as hm.raster
stats <- raster.summary()
normalized <- raster.normalize(100)
contours <- raster.contours(100, 1000, 100)
pit <- raster.pitfill()
flow <- pit.flowdirections()
slope <- pit.slope(flow)
origin <- slope.describe()
features <- sites as hm.vector
count <- features.count()
buffered <- features.buffer(100)
Here ctx is a core.context handle. A twin-bound behavior can use context.current(). A session script can use a context it created. Resolution must produce a numeric quality on a regular 2D grid in the hosting Runtime. Raster snapshots assemble committed shards by cell coordinates and preserve missing cells. A detached quality selection must resolve to one durable source. A temporal input must identify one slice.
hm.vector reads the members of a resolved collective of subjects or agents, including a selected collective. Features carry the member ID, URN, observable and metadata. Buffer distances are in metres. Pass a projected CRS as the second argument to select the working projection. A zero-member selection produces an empty vector. When a selection mixes located and unlocated members, only the located members contribute features.
Actor operations return new snapshots. Use close() to release one early. Owner teardown also releases it. Native HM reserves the numeric value -9999. A cast reports a collision if the committed input contains this as a valid sample. The raster snapshot budget defaults to 16,777,216 cells and can be set with klab.hm.maxRasterCells.
Models can bind named observation inputs to hm.geomorphology.pitfill (elevation), hm.geomorphology.flowdirections (pit) and hm.geomorphology.slope (pit and flow). Each function writes to the Runtime-owned output scanner. The model supplies the output semantics. Pit filling preserves the elevation unit. Slope requires an aligned flow grid and projected horizontal coordinates with units compatible with the elevation unit. It returns rise/run. Execution metadata records the upstream module, version, source URNs, storage revisions and output unit. The bridge translates the boundary NoData code emitted by OmsFlowDirections before passing the D8 grid to OmsSlope.
| Adapter | Resource parameters and behavior |
|---|---|
| Raster | Import a GeoTIFF with its sidecars. Resources retains an immutable copy of imported TIFF and GeoJSON files under its data directory. band is zero-based. noData and legacy nodata are equivalent. URN options override resource defaults. Without an override, band metadata supplies the missing values. Continuous TIFF export preserves double precision. Categorical TIFFs contain dictionary codes and an embedded label map. |
| WCS | Set serviceUrl, wcsIdentifier and wcsVersion. Set coverageVersion for an endpoint that needs another GetCoverage version. Capabilities, description and coverage use caller-scoped credentials. |
| WFS | Set serviceUrl and typeName. Discovery negotiates versions, output formats and the geographic CRS. GeoJSON and GML feature sources use the same object writer. pageSize and outputFormat are optional. |
| GeoJSON | Import a Feature or FeatureCollection with WGS 84 longitude/latitude coordinates. Named properties and feature identities travel with each child. |
| STAC | Set collection to an Item, static catalogue, collection or search-enabled catalogue. Omit asset for Item footprints, or name a GeoJSON or TIFF asset. Time and spatial support constrain the search. Raster overlap follows acquisition time and Item ID, with the newest valid sample winning. s3Endpoint selects a compatible gateway. |
The inventory covers 285 executable OMS classes in the two published source archives. For pending modules it lists any declared units, raster input ports, explicit band accesses, grid operations, array or raster allocations and named neighborhood calls found in the class or its parents. Working-set bounds, alignment requirements and halo sizes need scientific review before exposing those modules. The seven reviewed rows give the actual actor contracts. Module inventory · Reviewed bindings
mvn clean installThe regular suite uses synthetic grids, disposable observations and loopback OGC/STAC services. The archive test runs the elevation scripts through k.Actors and the Runtime component loader. The public endpoint suite is opt-in.
./mvnw test
./mvnw package
./mvnw -Dtest=GeospatialComponentIT test
./mvnw -Dtest=PublicAdaptersIT testTo exercise native write-back, run this from the sibling klab-services checkout with the absolute path to the component archive. The test owns a temporary data root, two disposable raster observations and an embedded Neo4j database.
./mvnw -pl klab.services.runtime -am -Dsurefire.failIfNoSpecifiedTests=false -Dtest=GeospatialWritebackIT -Dklab.geospatial.archive=/absolute/path/to/klab.component.geospatial-component-1.0-SNAPSHOT.jar testTo regenerate the module inventory and verb descriptions, supply the matching published source JARs.
java tools/HmInventory.java /path/to/hm-gears-0.11.3-sources.jar /path/to/hm-hmachine-0.11.3-sources.jarThis project is licensed under the GNU Affero General Public License (AGPL) version 3.0. See the license text for details.
- Ferdinando Villa - Lead Developer
- Email: ferdinando.villa@bc3research.org
- Organization: Basque Centre for Climate Change (BC3); IKERBASQUE
- Iñigo Cobian - Lead Developer
- Email: inigo.cobian@bc3research.org
- Organization: Basque Centre for Climate Change (BC3)
Integrated Modelling Partnership
Website: integratedmodelling.org
- Source Code: GitHub Repository
- Issue Tracking: Use GitHub Issues for bug reports and feature requests
For questions, issues, or contributions, please visit the k.LAB community resources or create an issue in the GitHub repository.
This component is part of the k.LAB semantic modeling platform for integrated assessment and environmental modeling.