Expand description
§geo-core
Format-agnostic geospatial domain types, geometry helpers, and transforms for video-analysis.
This crate owns stable internal concepts such as coordinates, bounding boxes, geometry, features, collections, and geometry simplification. It intentionally does not depend on GeoJSON or expose wire-format crate types.
§Install
[dependencies]
geo-core = { package = "moenarch-geo-core", version = "0.1.0" }use geo_core::{Coordinate, Geometry};§Package surface
Primary workflow: geo.distance.
Workflow operations:
geo.bounds: Computes bounds and coordinate counts for an internal geometry document.geo.distance: Computes haversine meters or planar coordinate-unit distance between lon/lat coordinates.
Debug operations:
describe: inspect package metadata and runtime support.
Runtime support: library, CLI, server, and WASM wrappers expose these operations.
Run the primary workflow through the CLI:
cargo run -p moenarch-geo-core-cli -- run \
--operation geo.distance \
--json '{"from":[8.0,49.0],"mode":"haversine","to":[9.0,49.0]}'Successful responses use the shared package-surface shape with operation,
title, message, summary, and result. Default surface calls are
deterministic, local-first, and do not download models, write persistent files,
or execute external tools unless an operation explicitly documents native or
external-tool execution.
Modules§
- surface
- Library-owned runtime surface for
geo-core.
Structs§
- BBox
- Data type for a 2D bounding box.
- Coordinate
- Data type for a 2D geographic coordinate.
- GeoFeature
- GeoJSON-compatible feature data.
- GeoFeature
Collection - GeoJSON-compatible feature collection data.
Enums§
- GeoError
- Error type for geospatial domain validation and local data access.
- Geometry
- GeoJSON-shaped geometry data.
Functions§
- assemble_
multipolygon - Assembles polygon or multipolygon geometry from outer and inner ring segments.
- geometry_
intersects_ bbox - Returns true when a geometry intersects a bbox.
- is_
valid_ closed_ ring - Returns true when a ring has at least four positions and matching first/last points.
- line_
string - Creates linestring geometry from coordinates.
- map_
feature_ coordinates - Applies a coordinate transform to every coordinate in a feature.
- map_
geometry_ coordinates - Applies a coordinate transform to every coordinate in a geometry.
- normalize_
ring_ orientation - Reverses a ring when needed to match the requested orientation.
- point
- Creates point geometry.
- point_
in_ ring - Returns true when a point lies inside a closed ring.
- polygon_
or_ multipolygon - Creates polygon or multipolygon geometry from polygon rings.
- ring_
area - Returns signed planar area for a closed ring.
- simplify_
geometry - Simplifies lines and rings in a geometry using Douglas-Peucker simplification.
- simplify_
line - Simplifies an open line using Douglas-Peucker simplification.
- simplify_
ring - Simplifies a closed ring and preserves ring closure.
- stitch_
rings - Stitches line segments into closed rings.
- translate_
geometry - Translates every coordinate in a geometry by a longitude/x and latitude/y delta.
Type Aliases§
- Position
- Two-dimensional coordinate position in
[longitude, latitude]order. - Properties
- JSON object used for feature properties.
- Result
- Geo crate result type.