Open hoche opened 4 years ago
I'm not in favor of having splat produce anything that resembles HTML natively. Have it produce other computer readable formats such as JSOM or XML would be far better. Let a separate tool convert the computer-readable output into front end displayable data.
Having an optional HTML output would be a great feature and improves native usability. It also could serve as a kind of template for new splat web services - all that I knew are offline now. And why not? Yet another option doesn't make splat unusable. @hoche I had exactly this problem today how to include my existing Leaflet based map output in a clean way. All I did today was reading and understanding splat's code, but still there are open questions (#9 , #10 ). My own toolchain is fine with one PNG and a JSON file that includes the four coordinates of two diagonal corners. It can also include additional meta information, e.g. all parameters that were used. Going to push that these days, but propably not finished for release.
Sorry yeah, I misspoke and meant XML where I said HTML. I'll change the issue title. The general problem is the same though.
@der-stefan When I mentioned HTML I was really thinking of the XML that's generated to make nice KML/KMZ files. For website usage, I'm not sure how much SPLAT! should generate, but I'd be more inclined to have it create JSON files that could be used as a data source for some client-side Javascript processing.
Right now there's a bunch of different functions where XML is generated by doing sprintfs. Much is redundant and could be combined together. However, it occurs to me that it might be better to incorporate some sort of template engine for that. I'm not talking about sucking in a full-bore templating engine like Jinja or Jade (wrong language anyway), just creating a simple substitution engine where key tags in the text file get replaced with something out of std::unordered_map.
I'll have to analyze the code some, but I don't think we need much more than that.
If we have complex data it'd get complicated, but even then we could suck in something like https://github.com/pantor/inja.