Trait sfcgal::ToGeoJSON

source ·
pub trait ToGeoJSON {
    type Err;

    // Required method
    fn to_geojson<T: FromSlice + CoordType + ToVec + FromSFCGALGeom>(
        &self,
    ) -> Result<GeometryValue>;
}
Expand description

Conversion from SFCGAL Geometries to GeoJson.

Required Associated Types§

Required Methods§

source

fn to_geojson<T: FromSlice + CoordType + ToVec + FromSFCGALGeom>( &self, ) -> Result<GeometryValue>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl ToGeoJSON for SFCGeometry

Conversion from SFCGAL Geometries to GeoJson.

Allows to choose if coordinates of constructed geojson have to be 2d or 3d.

use sfcgal::{SFCGeometry, ToGeoJSON};
type Point3d = (f64, f64, f64);

let input_wkt = "POINT (0.1 0.9 1.0)";
let pt_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let pt_geojson = pt_sfcgal.to_geojson::<Point3d>().unwrap();
source§

impl<U> ToGeoJSON for CoordSeq<U>
where U: FromSlice + CoordType + ToVec + FromSFCGALGeom,