Skip to content
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

Always include the m value of Coordinate3D in JSON #57

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

trasch
Copy link
Contributor

@trasch trasch commented Jul 2, 2024

The m value of Coordinate3D will now always be includeded in the JSON dump of a coordinate. This means that a null value will be added for the altitude if the coordinate's altitude is nil.

let coordinateM = Coordinate3D(latitude: 15.0, longitude: 10.0, altitude: nil, m: 1234)
let coordinateDataM = try JSONEncoder().encode(coordinateM)
print(String(data: coordinateDataM, encoding: .utf8)) // [10,15,null,1234]

@trasch trasch self-assigned this Jul 2, 2024
@trasch trasch merged commit 831a87e into main Jul 2, 2024
1 check passed
@trasch trasch deleted the coordinate_null_altitude_when_m branch July 2, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant