oxigdal-geojson
Pure Rust GeoJSON (RFC 7946) driver for vector data.
Overview
oxigdal-geojson provides comprehensive support for reading and writing GeoJSON data according to RFC 7946, with extensions for CRS support and large file handling.
Features
- ✅ RFC 7946 compliant GeoJSON parser and writer
- ✅ All geometry types (Point, LineString, Polygon, Multi*, GeometryCollection)
- ✅ Feature and FeatureCollection support
- ✅ Streaming API for large files
- ✅ CRS support (including EPSG codes)
- ✅ Bounding box computation
- ✅ Geometry validation
Installation
[]
= "0.1"
Quick Start
Reading GeoJSON
use GeoJsonReader;
let geojson = r#"{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-122.4, 37.8]
},
"properties": {
"name": "San Francisco"
}
}"#;
let feature = parse_feature?;
println!;
Writing GeoJSON
use GeoJsonWriter;
use ;
let geometry = Point ;
let mut feature = new;
feature.set_property;
let writer = new;
let geojson = writer.write_feature?;
println!;
Streaming Large Files
use GeoJsonStreamReader;
use File;
let file = open?;
let reader = new?;
for feature in reader
Geometry Types
All RFC 7946 geometry types are supported:
- Point - Single coordinate
- LineString - Array of coordinates
- Polygon - Array of linear rings
- MultiPoint - Array of Points
- MultiLineString - Array of LineStrings
- MultiPolygon - Array of Polygons
- GeometryCollection - Mixed geometry types
Features
- Properties - Arbitrary JSON properties
- Bounding boxes - Automatic computation
- CRS - Coordinate reference system metadata
- ID - Feature identifiers
Validation
use GeoJsonValidator;
let validator = new
.check_geometry
.check_crs
.check_bbox;
let result = validator.validate_file?;
if result.is_valid else
Performance
- Zero-copy parsing where possible
- Streaming API for memory efficiency
- Lazy geometry validation
- Parallel feature processing (optional)
COOLJAPAN Policies
- ✅ Pure Rust - No C dependencies
- ✅ No unwrap() - All errors handled
- ✅ RFC compliant - Follows GeoJSON spec
- ✅ Well tested - Comprehensive test suite
License
Licensed under Apache-2.0.
Copyright © 2025 COOLJAPAN OU (Team Kitasan)