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
I'm trying to decode a list of Elixir numbers representing coordinates into f64, however, sometimes some of the coordinates are actually integers (ie. 0, not 0.0), because they're decoded from a JSON file which doesn't differentiate.
At the moment Rustler returns an error Could not decode field :coordinates on %MultiPolygon{}, but I'd like it to transparently convert the integer to a float, or offer some way of configuring that. Is there a way to make this work without losing all the convenience of NifStruct?
I'm trying to decode a list of Elixir numbers representing coordinates into
f64
, however, sometimes some of the coordinates are actually integers (ie.0
, not0.0
), because they're decoded from a JSON file which doesn't differentiate.At the moment Rustler returns an error
Could not decode field :coordinates on %MultiPolygon{}
, but I'd like it to transparently convert the integer to a float, or offer some way of configuring that. Is there a way to make this work without losing all the convenience ofNifStruct
?If useful, here's the code and failing test: https://github.com/breakroom/h3geo/tree/handle-integer-coordinates
The text was updated successfully, but these errors were encountered: