Expand description
§OxiRS GeoSPARQL
Status: Production Release (v0.2.4) Stability: Public APIs are stable. Production-ready with comprehensive testing.
GeoSPARQL implementation for spatial data and queries in RDF/SPARQL.
This crate provides:
- GeoSPARQL vocabulary and datatypes
- WKT (Well-Known Text) geometry parsing and serialization
- Simple Features topological relations (sfEquals, sfContains, sfIntersects, etc.)
- Geometric operations (buffer, convex hull, intersection, etc.)
- Geometric properties (dimension, SRID, isEmpty, etc.)
- Spatial indexing with R-tree for efficient queries
- SIMD-accelerated distance calculations (2-4x speedup)
- Parallel batch processing for large datasets
§Example
use oxirs_geosparql::geometry::Geometry;
use oxirs_geosparql::functions::simple_features;
// Parse WKT geometries
let point = Geometry::from_wkt("POINT(1.0 2.0)").expect("should succeed");
let polygon = Geometry::from_wkt("POLYGON((0 0, 4 0, 4 4, 0 4, 0 0))").expect("should succeed");
// Test spatial relations
let contains = simple_features::sf_contains(&polygon, &point).expect("should succeed");
assert!(contains);§GeoSPARQL Compliance
This implementation follows the OGC GeoSPARQL 1.0/1.1 specification:
- Core: Geometry classes and properties
- Topology Vocabulary: Simple Features relations
- Geometry Extension: WKT and GML support
- Query Rewrite Extension: Spatial indexing
§Features
wkt-support(default): WKT parsing and serializationgeojson-support: GeoJSON supportgeos-backend: Use GEOS library for geometric operationsproj-support: Coordinate transformation supportparallel: Parallel processing for large datasets
Re-exports§
pub use aggregate::aggregate_bounding_box;pub use aggregate::AggregateBoundingBox;pub use aggregate::BoundingBoxResult;pub use aggregate::GEO_AGG_BOUNDING_BOX;pub use crs::crs_literal::encode_crs_wkt_literal;pub use crs::crs_literal::parse_crs_wkt_literal;pub use crs::crs_literal::CrsGeometryTransformer;pub use crs::crs_literal::CrsLiteral;pub use crs::crs_literal::CRS84_URI;pub use crs::crs_literal::GEO_CRS;pub use crs::crs_literal::GEO_WKT_LITERAL;pub use crs::osgb36::coordinate_to_osgb_grid_ref;pub use crs::osgb36::osgb_grid_ref_to_coordinate;pub use crs::osgb36::OsgbCoordinate;pub use crs::utm::utm_to_wgs84_batch;pub use crs::utm::wgs84_to_utm_batch;pub use crs::utm::UtmCoordinate;pub use crs::utm::WgsCoordinate;pub use crs::CrsKind;pub use crs::CrsTransformer;pub use crs::GeometryWithCrs;pub use error::GeoSparqlError;pub use error::Result;pub use functions::ogc11::area_with_unit;pub use functions::ogc11::area_with_unit_uri;pub use functions::ogc11::concave_hull;pub use functions::ogc11::distance_with_unit;pub use functions::ogc11::distance_with_unit_uri;pub use functions::ogc11::length_with_unit;pub use functions::ogc11::length_with_unit_uri;pub use functions::ogc11::UnitOfMeasure;pub use functions::ogc11::UOM_PREFIX;pub use geometry::geometry3d::BoundingBox3D;pub use geometry::geometry3d::Geometry3DEnum;pub use geometry::geometry3d::LineString3D;pub use geometry::geometry3d::LinearRing3D;pub use geometry::geometry3d::Point3D;pub use geometry::geometry3d::Polygon3D;pub use geometry::Crs;pub use geometry::Geometry;pub use index::SpatialIndex;pub use index::PureRTree;pub use index::RTreeBBox;pub use index::RtreeEntry;pub use index::SpatialRtreeIndex;pub use performance::BatchProcessor;
Modules§
- aggregate
- SPARQL Spatial Aggregate Functions (v0.2.0)
- analysis
- Advanced Spatial Analysis
- area_
calculator - Area calculations for geographic polygons.
- bounding_
box - Bounding box (Envelope) operations for spatial queries.
- clustering
- Spatial clustering algorithms (DBSCAN with Haversine distance). Spatial clustering algorithms.
- convex_
hull - 2D convex hull computation using the Graham scan algorithm (v1.1.0 round 14). 2D convex hull computation using the Graham scan algorithm.
- coordinate_
converter - Coordinate system conversions: WGS84 ↔ Web Mercator, plus Haversine distance (v1.1.0 round 16). Coordinate system conversions for GeoSPARQL.
- coordinate_
transformer - CRS coordinate transformations: WGS84 ↔ UTM ↔ WebMercator. Coordinate Reference System transformations: WGS84 ↔ UTM ↔ WebMercator.
- crs
- Coordinate Reference System (CRS) implementations
- crs_
transform - Coordinate Reference System (CRS) Transformation Pipeline
- distance_
calculator - Geodesic and Euclidean distance calculations for GeoSPARQL.
- error
- Error types for GeoSPARQL operations
- functions
- GeoSPARQL filter and property functions
- geo_
serializer - Geometry serialization to WKT, GeoJSON, and simplified GML 3.
- geometry
- Geometry types and operations
- index
- Spatial indexing for efficient GeoSPARQL queries
- intersection_
detector - Geometric intersection detection: point-in-polygon, line–line, polygon overlap, containment, touches, crosses, segment distance (v1.1.0 round 13) Geometric intersection detection for GeoSPARQL predicates.
- performance
- Performance utilities for large-scale geometric operations
- raster_
sampler - Raster grid sampling with multiple interpolation methods.
- reasoning
- Geospatial Reasoning (v0.2.0)
- simplifier
- Geometry simplification using Douglas-Peucker and radial distance algorithms (v1.1.0 round 15).
- sparql_
integration - SPARQL Function Integration
- spatial_
index - Spatial grid index for fast bounding-box queries. Spatial grid index for fast bounding-box queries.
- topology_
checker - Spatial topology checking implementing a simplified DE-9IM model.
- validation
- Geometry validation and quality checks
- vocabulary
- GeoSPARQL vocabulary and namespace definitions
- wkt_
parser - WKT (Well-Known Text) geometry parser and serializer.
- wkt_
writer - WKT (Well-Known Text) geometry serializer.
Macros§
- profile_
scope - Macro for convenient profiling scope creation
Structs§
- GeoSparql
Registry - GeoSPARQL function registry
Functions§
- init
- Initialize GeoSPARQL support in a SPARQL engine