Skip to main content

Module vector

Module vector 

Source
Expand description

Vector data types and utilities

This module provides types for representing and working with vector geospatial data, including geometries, features, and feature collections.

§Geometry Types

Following the OGC Simple Features specification:

§Features

A feature::Feature combines a geometry with properties (attributes). Features can be organized into feature::FeatureCollections.

§Example

use oxigdal_core::vector::{
    geometry::{Point, Coordinate, Geometry},
    feature::{Feature, PropertyValue},
};

// Create a point geometry
let point = Point::new(10.0, 20.0);

// Create a feature with the geometry
let mut feature = Feature::new(Geometry::Point(point));

// Add properties
feature.set_property("name", PropertyValue::String("My Point".to_string()));
feature.set_property("value", PropertyValue::Integer(42));

Re-exports§

pub use feature::Feature;
pub use feature::FeatureCollection;
pub use feature::FeatureId;
pub use feature::PropertyValue;
pub use geometry::Coordinate;
pub use geometry::Geometry;
pub use geometry::GeometryCollection;
pub use geometry::LineString;
pub use geometry::MultiLineString;
pub use geometry::MultiPoint;
pub use geometry::MultiPolygon;
pub use geometry::Point;
pub use geometry::Polygon;

Modules§

feature
Feature types for vector data
geometry
Geometry types for vector data