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

Default but not mandatory values in spec #4

Open
anowacki opened this issue Aug 4, 2021 · 0 comments
Open

Default but not mandatory values in spec #4

anowacki opened this issue Aug 4, 2021 · 0 comments

Comments

@anowacki
Copy link
Owner

anowacki commented Aug 4, 2021

For attributes which in the spec have a default value but are not mandatory, decide whether or not to instantiate the structs with the default value or use missing. The former would convey what the spec means those values to be; the latter would convey what is actually in the file.

Latitude is an example, where it may optionally have a datum attribute whose value is by default "WGS84". That is, if no value for datum is present, it is assumed that the latitude is on the WGS84 ellipsoid. At present a file may contain

<Latitude>0</Latitude>

and this gets parsed into

Latitude(value=0, plus_error=missing, minus_error=missing, measurement_method=missing, unit="DEGREES", datum="WGS84")

Note that <Latitude datum="WGS84">0</Latitude> would parse to the same thing, so the question is whether this is right.

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

No branches or pull requests

1 participant