MPExporter also supports the ability to export to SVG (Scalable Vector Graphics). In contrast to the other supported formats, SVG is not a cartographic format. Instead, it is a spatial format intended for 'flat' drawings. In order to correctly map cartographic coordinates (e.g. longitude, latitude) to 'flat' (x,y) coordinates, a map projection and coordinate system have to be provided. MPExporter supports a number of different coordinate systems and projections, including the ability to use coordinate systems defined in external PRJ files. MPExporter can also use geographic coordinates to map longitude,latitude (degree) coordinates directly into x,y (pixel) coordinates.
To aid with this conversion, MPExporter provides a number of options related to SVG coordinates. First there is the Line Thickness in the Shapes box. SVG thicknesses and sizes use the same coordinate system as the actual drawings. This contrasts with KML and the HTML options which define object sizes in pixels whilst positions are in geographic coordinates. Therefore we have to specify line thicknesses in terms of map coordinates. For example, if you are plotting geographic coordinates (degrees), then the line thickness is defined in terms of degrees. Typically in this scenario, you will want to use a line thickness that is a fraction of a degree, perhaps 0.01. The line thickness is also used to define the size of pushpin images (size: 16 pixels) and text. The line thickness is applied before the scale (see below).
Computer screens and SVG typically use an origin in the upper left with y increasing downwards. This contrasts with the vast majority of cartographic coordinate systems which have an origin in the lower left (south west) and have x & y increasing in the east and northerly directions. MPExporter will handle the change of axis direction correctly by wrapping the entire file in a <g> element with the required reflection. It will also automatically handle the 'anomalous' coordinate direction for the Czech Krovak coordinate systems.
Most map coordinate systems result in very large coordinate values — typically 100,000s or even 1,000,000s. Many SVG packages cannot handle such large coordinate systems. Also, many packages (especially web browsers) expect a coordinate system defined in pixels with the origin in the top left corner. MPExporter solves these issues by providing a couple of options to transform the coordinates to a more acceptable range. These are set using the Final Coordinates setting which can be set to Scale Coordinates to a Window or Transform and Scale Coordinates.
Scale Coordinates to a Window is the easiest to use, but it does not automatically preserve the aspect ratio. Simply specify the required window in output coordinates. The Origin defines the upper left corner. The Max X, Max Y values specify the lower right corner. For a web browser application, you would set the origin to 0,0; and then set the Max X and Max Y values to the required width and height in pixels. MPExporter will then stretch/squash the resulting map to fit this window. Note: This option will result in MPExporter running through the data twice. The first time is to determine the extents, the second is to perform the actual export. This could take a long time for a complex map.
The Transform and Scale Coordinates option is guaranteed to preserve the map's aspect ratio but it tends to be more difficult to use. This option applies a scale factor and then follows it with a translation. Set the scale factor using the Scale (in the Coordinate System box). This defines a multiplier that is applied to all post-projection. After applying the scale, MPExporter applies a translation as defined by the origin (Origin (X) and Origin (Y)). This moves (translates) the coordinates into a useful area of the coordinate system.
SVG does not support the concept of 'popup balloons'. Therefore all pushpins and pushpin-like images are exported as icon images or they are drawn as shaded circles. No names or data fields are exported with these pushpins. Shaded circles are, however, shaded correctly (in contrast with the HTML options).
The MapPoint programming interface trims all newline information from the text boxes. Therefore MPExporter will correctly export the text and the surrounding colored box, but all of the text will appear on one line. This is regardless of both automatic line breaks and any explicit newlines.
In common with the KML option, routes are written as a 'polyline' that connects each waypoint with a straight line. This is because SVG (and KML) do not support the concept of routes. Waypoints are written with a 'W' pushpin image.
Most drawing programs will not understand external (i.e. Internet) image references. Therefore if you wish to use these SVG files in a drawing program, you will probably need to clear the Use Online Pushpin Images checkbox.