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

Add verbosity to to_string #216

Closed
7 of 8 tasks
cleder opened this issue Jan 16, 2023 · 6 comments · Fixed by #360
Closed
7 of 8 tasks

Add verbosity to to_string #216

cleder opened this issue Jan 16, 2023 · 6 comments · Fixed by #360

Comments

@cleder
Copy link
Owner

cleder commented Jan 16, 2023

Add verbosity levels:

  • terse = omit elements and attributes which are default
  • default = create elements if they are not None
  • verbose = always create the elements with default value
    ✔️
    Add Default values for
  • features
  • geometry
  • containers
  • gx
  • links
  • overlays
  • styles
  • views
@cleder
Copy link
Owner Author

cleder commented Sep 15, 2024

The terse argument could also remove trailing 0s from the coordinate outputs #345

@cleder
Copy link
Owner Author

cleder commented Sep 15, 2024

This could be implemented by adding an optional default_value to RegistryItem and omit creating an etree element when the value is equal to the default.

When the default is not None and the attribute value is None, the default should be added.
✔️

@cleder
Copy link
Owner Author

cleder commented Sep 15, 2024

Start of implementation: 216-add-output-verbosity

✔️

@cleder
Copy link
Owner Author

cleder commented Sep 17, 2024

develop...216-add-output-verbosity
TODO: identify KML elements that have a default value, add it and tests

Hint: search for default on https://developers.google.com/kml/documentation/kmlreference and have a look at the syntax section.

Each reference entry includes a Syntax section that lists the elements contained in the main element. This Syntax section is an informal listing and uses simple shorthand to summarize the elements.
default values for each element (or ellipses if it is a complex element or if there is no default value

cleder added a commit that referenced this issue Sep 21, 2024
While rereading the documentation implementing the verbose and sparse verbosity parameter
it became clear that these elements are not present on all geometries.
This was fixed here
cleder added a commit that referenced this issue Oct 5, 2024
@cleder cleder linked a pull request Oct 5, 2024 that will close this issue
@cleder cleder modified the milestones: Version 1.1, Version 1.0 Oct 5, 2024
@cleder
Copy link
Owner Author

cleder commented Oct 5, 2024

Add Default values for

  • features
  • geometry
  • containers
  • gx
  • links
  • overlays
  • styles
  • views

Open one PR per file.

@cleder
Copy link
Owner Author

cleder commented Oct 13, 2024

@wesley-murray setting the precision argument in to_string to None (default) will now do a simple str

@cleder cleder closed this as completed Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant