You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GeoJSON API could be more intuitive for the common case of wanting to serialize a bunch of geometric data, without wanting to leverage foreign members or other geojson features.
Specifically, I propose the following methods work for all geo_types::Geometry variants:
let a_polygon: = GeoJson::from(geo::Polygon::new(...))
let another_polygon: GeoJson = GeoJson::from(geo::Geometry::Polygon(Polygon::new(...)))
let geometry_collection: GeoJson = GeoJson::from_iter(vec![Polygon::new(...),])
With an implementation something like:
impl<T: geo_types::CoordFloat> FromIterator<geo_types::Polygon<T>> for GeoJson {
fn from_iter<P>(polygons: P) -> Self
where P: IntoIterator<Item = geo_types::Polygon<T>>
{
let gc = geo_types::GeometryCollection::from_iter(polygons);
let fc = FeatureCollection::from(&gc);
GeoJson::from(fc)
}
}
The text was updated successfully, but these errors were encountered:
(Pulled out of the discussion #162 (comment))
The GeoJSON API could be more intuitive for the common case of wanting to serialize a bunch of geometric data, without wanting to leverage foreign members or other geojson features.
Specifically, I propose the following methods work for all geo_types::Geometry variants:
With an implementation something like:
The text was updated successfully, but these errors were encountered: