georust / geojson

Library for serializing the GeoJSON vector GIS file format
https://crates.io/crates/geojson
Apache License 2.0
276 stars 60 forks source link

feat: Generic Precision #234

Open TurtIeSocks opened 1 year ago

TurtIeSocks commented 1 year ago

Following up from my post almost a year ago in #59 , I finally got around to finishing this up!

This adds support for the generic CoordFloat trait to all structs provided by this crate. I've tested this locally in my OSS project and the only inconsistency I noticed was serializing with the json! macro from serde_json always resulted in f64 precision, but I wasn't sure if that is something that can be corrected in this crate. When returning the data and letting Actix serialize it with something like HttpResponse::Ok().json(feature), it respected the intended precision.

Notes for the maintainers to review:

Resolves #59

TurtIeSocks commented 1 year ago

Apologies for the tag @michaelkirk, but any feedback for this PR :) thanks!