Export dive sites as KML by atdotde · Pull Request #4630 · subsurface/subsurface
Conversation
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:
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>
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.
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.
This pull request has merge conflicts, please resolve them in order to make this pull request ready for review / merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters