Export dive sites as KML by atdotde · Pull Request #4630 · subsurface/subsurface

Conversation

@atdotde

Offer to export the dive sites as a KML file that can be opened in Google Earth and similar.

This is user request from the google group.

Describe the pull request:

  • Bug fix
  • Functional change
  • New feature
  • Code cleanup
  • Build system change
  • Documentation change
  • Language translation

Pull request long description:

Changes made:

Related issues:

Additional information:

Documentation change:

Mentions:

@github-actions

@github-actions

@github-actions

@github-actions

Offer to export the dive sites as a KML file that can be opened in
Google Earth and similar.

Signed-off-by: Robert C. Helling <helling@atdotde.de>

@github-actions

@github-actions

@github-actions

@github-actions

@github-actions

mikeller

@mikeller

This definitely provides user value.
But the approach to add custom code for each new XML format seems to be not very sustainable - it might be better to implement this with an XSLT transformation.

And this applies even more to the existing 'Subsurface dive sites XML' - this pretty much consists of code copy / pasted from save_dives_buffer(), making the transformation trivial.

@mikeller

And it could probably do with some tests - import / export is very easy to test.

@atdotde

While I agree in principle with what you say I would merge this now and postpone the changes to another day.
For the tests that might be in the near future when I sit down and produce a number of sample exports and wrap them with corresponding test code. For turning all this into xslt, the day would be in the farther future as my understanding of xslt is indistinguishable from 0 short googling of course took me to StackOverflow where I found https://stackoverflow.com/questions/6112874/how-to-replace-a-tag-with-another-tag-in-xml-using-xsl
And yes, I could probably twist this example to transform our sites export to kml but my guess would be that the resulting code ends up to me longer and even less maintainable than what this PR proposes (assuming that reading comprehension of xslt is not exactly wide spread amongst active Subsurface developers). Thinking about it, a sed script would probably be even easier... or some regular expressions.

@github-actions

This pull request has merge conflicts, please resolve them in order to make this pull request ready for review / merge.

Labels

2 participants

@atdotde @mikeller