OGCMetOceanDWG / WorldWeatherSymbols

A complete set of WMO weather symbols in SVG with full metadata.
https://github.com/OGCMetOceanDWG/WorldWeatherSymbols
Other
84 stars 34 forks source link

script to generate web friendly consolidated svg for specified symbol directory #37

Closed brentlemons closed 3 years ago

brentlemons commented 9 years ago

Automagically generate web friendly svg for specified directory. Can also strip filename to create shorter symbol id.

Could save a few more bytes by minifying. The advantage here is that the combined svg file can be retrieved one time in your html and used multiple times in the same page. Additionally, once retrieved, the browser should cache it and reduce the number of calls in the future.

Using the example usage below, you could then reference ww_11 in html code like so:

<svg xmlns="http://www.w3.org/2000/svg"><use xlink:href="/path/to/file/ww_PresentWeather.svg#ww_11"></use></svg>

Args: symbols directory, basename replacement

Example usage:

$ python gen_web_symbols.py ww_PresentWeather WeatherSymbol_WMOPresentWeather > ww_PresentWeather.svg

chris-little commented 3 years ago

@brentlemons Apologies for not visting here for a long time. We will update for later software.