tg-geom 0.0.0

Rust bindings for the `TG` Geometry library.
Documentation
//! Rust bindings for the TG Geometry library.
//!
//! TG is a fast and lightweight geometry library for C that provides spatial
//! operations including point-in-polygon, intersection tests, and more.
//!
//! # Quick Start
//!
//! ```rust,ignore
//! use tg_geom::{Geom, GeomType, Point, init_mimalloc};
//!
//! // Initialize mimalloc allocator (requires `mimalloc` feature)
//! init_mimalloc();
//!
//! // Create a point geometry
//! let point = Geom::new_point(Point::new(1.0, 2.0)).unwrap();
//! assert_eq!(point.geom_type(), GeomType::Point);
//!
//! // Parse from WKT
//! let polygon = Geom::from_wkt("POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))").unwrap();
//!
//! // Spatial predicates
//! let test_point = Geom::new_point(Point::new(5.0, 5.0)).unwrap();
//! assert!(polygon.contains(&test_point));
//!
//! // Export to different formats
//! let geojson = polygon.to_geojson();
//! let wkb = polygon.to_wkb();
//! ```
//!
//! # Features
//!
//! - `mimalloc` - Use mimalloc as the memory allocator (recommended for
//!   performance)

#[cfg(feature = "mimalloc")]
mod allocator;
mod error;
mod geom;
mod geom_type;
mod index;
mod line;
mod parse;
mod point;
mod poly;
mod rect;
mod ring;
mod segment;
mod utils;

#[cfg(feature = "mimalloc")]
pub use allocator::init_mimalloc;
pub use error::{Error, Result};
pub use geom::{Geom, GeomRef};
pub use geom_type::GeomType;
pub use index::{IndexKind, set_default_index, set_default_index_spread, set_print_fixed_floats};
pub use line::{Line, LineRef};
pub use parse::{geobin_fullrect, geobin_point, geobin_rect};
pub use point::Point;
pub use poly::{Poly, PolyRef};
pub use rect::Rect;
pub use ring::{Ring, RingRef};
pub use segment::Segment;