(copied from discord)
what do people think about adding macros in the geojson crate to ease creation?
let feature = geojson::feature! {
geometry: geojson::point![1., 1.],
properties: {
foo: "bar",
},
};
versus
let properties = HashMap::<String, serde_json::JsonValue>::new():
properties.insert("foo".to_string(), "bar".to_string());
let feature = geojson::Feature {
geometry: Some(geojson::Geometry::new(
geojson::Value::Point(vec![1., 1.,]),
)),
properties: Some(properties),
...Default::default(),
};
not the exact syntax necessarily. just think it would be great to have an easier way to construct the structures
it'd be really slick if the body of the macro was identical syntax to geojson
(copied from discord)
what do people think about adding macros in the geojson crate to ease creation?
versus
not the exact syntax necessarily. just think it would be great to have an easier way to construct the structures
it'd be really slick if the body of the macro was identical syntax to geojson