90 likes | 241 Views
Using SVG in Excel. Esbern Holmes www.geoinformatik.dk holmes@geoinformatik.dk. The goal of the presentation. To present a “pure” (dogmatic) approach to producing SVG based maps in Excel where no additional macros/programs are used except from Adobe’s SVG free viewer.
E N D
Using SVG in Excel Using SVG in Excel Esbern Holmes www.geoinformatik.dk holmes@geoinformatik.dk
Using SVG in Excel The goal of the presentation • To present a “pure” (dogmatic) approach to producing SVG based maps in Excel where no additional macros/programs are used except from Adobe’s SVG free viewer. • Focus on the use of XML based graphics for mapping purposes.
Using SVG in Excel The structure of a SVG map <svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns = "http://www.w3.org/2000/svg" viewBox = "441469.9 6050001.5 451490.1 352445.0" ...."> <script language="javascript" type="text/javascript"> .... </script> <g id="Legend" onclick="EditLegend(evt.target)"> .... </g> <g id="map" transform="scale(1,-1)“ onclick=“func(evt.target)"> <path id="101" class="6" info="København" fill="rgb(255,0,56)" stroke="rgb(0,0,0)" d="M721238.06,6181615.5 L723773.06,6181149.5 … z"/> .... </g> </svg>
Using SVG in Excel Why use SVG in Excel • Because SVG is a XML dialect • SVG data can be stored and manipulated as “native” Excel data. • mapping procedures are easily ported between the many programming environment that support XML. • SVG supports event driven interaction. • SVG documents can be embedded as ActivX or handled as standalone objects • SVG maps produced in Excel can be post processed in most drawing programs.
Using SVG in Excel A generic mapping workflow Thematic data Spatial data (SVG stubs) SVG document Classification/ Symbolisation rules
"<path id="""&D.id&""" info="""&D.info&""" " &D.Display&" d="""&D.Geo&"""/>" LOOKUP(id;DK_kom_geo.xls!ID;DK_kom_geo.xls!Geo) LOOKUP(Book2.xls!data;L.LLimit;L.Display) Using SVG in Excel The workflow in Excel
Using SVG in Excel Event driven • In the script part of the SVG document it is possible to include event handlers for a series of typically user information and layout operations. • As an example I have implemented a tool for changing the colours of the individual classes. • The handler opens a “SVG frame” where the user can select the colour either in RGB or in HSV colour system. It is interesting to note that the same code is used in a web implementation of the mapping procedure
Using SVG in Excel A less dogmatic approach Although macros are not necessary, some scripts are convenient: • Create the mapping workbook • Create a classification table using different standard approaches • Write the SVG data to a file
Using SVG in Excel Conclusions • SVG is easy to move between different implementation environments e.g. the same mapping procedures can be used for mapping from Excel and a web based database. • SVG gives superb graphic capabilities. • SVG is easy to utilise since it is a XML dialect and thus lends itself to manipulation either in a XML environment or simply as clear text. • SVG lends it self to free open source solutions, visit for instance www.carto.net or www.geoinformatik.dk for examples.