-
Notifications
You must be signed in to change notification settings - Fork 10
parse all numbers as Float64 when reading JSON #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Read a GeoJSON string to a GeoInterface.jl compatible feature or geometry object. | ||
""" | ||
function read(source) | ||
object = JSON3.read(source) | ||
object = JSON3.read(source; numbertype = Float64) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we allow passing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think not using this setting is a real footgun, not sure we should offer that option. I doubt it's ever useful in practice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, makes sense. I just saw the tests had used |
||
if object === nothing | ||
error("JSON string is empty") | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be 1.1? Note that real breaks need v2. But, I'm not sure if this is really breaking, it seems more like fixing a bug to me.
(And I generally find it better not to bump versions in PRs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the JSON3 version, not GeoJSON. I didn't bump the GeoJSON version yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About breaking/not breaking, I agree for coordinates it's definitely bugfix. For integer properties it could be a minor change, I'm also fine with releasing as non-breaking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol I never read toml files correctly in PRs. But yes, bugfix it is.