pub trait FromGeoJSON {
type Err;
// Required method
fn from_geojson<T: FromSlice + CoordType + ToSFCGALGeom>(
geom: &GeometryValue,
) -> Result<SFCGeometry>;
}
Expand description
Conversion from GeoJson to SFCGAL Geometries.
Required Associated Types§
Required Methods§
fn from_geojson<T: FromSlice + CoordType + ToSFCGALGeom>( geom: &GeometryValue, ) -> Result<SFCGeometry>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl FromGeoJSON for SFCGeometry
Conversion from GeoJson to SFCGAL geometries.
impl FromGeoJSON for SFCGeometry
Conversion from GeoJson to SFCGAL geometries.
Allows to choose if the constructed SFCGAL geometries will be 2d or 3d.
use sfcgal::{SFCGeometry, FromGeoJSON};
type Point2d = (f64, f64);
let geom = geojson::Geometry {
bbox: None,
value: geojson::Value::LineString(vec![vec![101.0, 0.0], vec![102.0, 1.0]]),
foreign_members: None,
};
let line_sfcgal = SFCGeometry::from_geojson::<Point2d>(&geom.value).unwrap();