Web services for generating SVG-Tiny maps on mobile phones

The mainstream approach to online mapping relies on GET_IMAGE, getmap or similar requests against Internet map servers that generate map images to be displayed at a mapping client. Limitations of this approach are well known: (1) it is not suitable for applications that require continuous map updates and/or high level of interactivity at the client; (2) it is bandwidth-intensive and places severe load on the map server, (3) it does not take advantage of increasing processing and graphics capabilities of map clients, and (4) it is not well suited for situations where data are drawn from multiple servers and need to be combined at the client. This last limitation is particularly severe in mobile devices, where maps are composed of fragments that "move with the device", and fragments that remain relatively stable and can be reused. For example, location of cell phone may be shown as a slowly moving dot with position updated by a location-based service, while the underlying street map may be updated only when the point approaches a map edge thus dramatically reducing the number of required map updates. SVG provides an excellent platform for such a client application.

With the growing acceptance of SVG Tiny and SVG Basic profiles, and proliferation of Java-enabled or SVG-enabled mobile devices, SVG viewers and editors (eg reviewed at http://scale-a-vector.de/), the primary issue becomes creating the infrastructure of services for generation of on demand SVG maps accessible from the mobile phones. Ideally, this infrastructure would re-use existing spatial data services created for conventional Internet mapping. In this paper, we focus on SVG Tiny generation from common ArcIMS services, and describe the APIs and functionality of a working SVG generator capable of creating SVG maps for different types of client devices.

The SVG generator service is part of a larger services-based infrastructure for registering, discovering, querying, assembling and visualizing spatial data being developed within GEON (the Geosciences Network) project. The architecture comprises three common tiers. The data tier includes ArcIMS image services (perhaps the most common type of map services found on the web these days, including the services publicly available through the GeographyNetwork), and pure XML sources. Both types of sources are abstracted as "XML coordinate data services" that expose get_capabilities and various get_coordinates requests. ArcIMS source wrappers translate the get_coordinates requests into ArcXML GET_FEATURES requests posted to ArcIMS image sources (provided that GET_FEATURES is not disabled in the ArcIMS map service setup.)

The middle tier includes a collection of web services for distributed query processing and assembling query results into a composite map (the map assembly service). The SVG generator service is a part of the map assembly. It is based on Batik toolkit, and represents the following sequence of service requests:

get_capabilities returns information about the XML coordinate data service, including the service's spatial envelope, and list and rendering information for all layers contained in the service (for ArcIMS sources, is translated into ArcXML GET_SERVICE_INFO requests);
set_map computes an optimal SVG coordinate system (which depends on the client pixel dimensions), sets the map extent (either based on the map service's spatial envelope, or information about the device location received from an LBS or the device's GPS receiver), and generates a sequence of calls against each layer to be included in the SVG map (based on information returned in the previous request)
add_renderer inserts rendering information for each layer into SVG <def> elements, derived from layer styling data (size, width, fill-color, outline-width, outline-color) retrieved by the get_capabilities request.
add_point_layer
add_line_layer
add_polygon_layer
for each requested vector layer, convert coordinate information received from an XML coordinate data service and rendering information added in the add_renderer call, into a sequence of SVG <circle> or <rect> (for point layers), or <path> (for line and polygon layers) elements, and add layer groups to the SVG document. In the case of ArcIMS services, the coordinate information is extracted from ArcIMS responses to GET_FEATURES requests.
add_labels for each ArcIMS layer that contains labels (i.e. includes <SIMPLELABELRENDERER> element), creates a sequence of SVG <texts> elements and adds them to the SVG document.
get_svg return the generated SVG document string specific for the device

The service generates an SVG Tiny-compliant document suitable for rendering on J2ME-enabled cell phones (using TinyLine, in particular). To improve rendering speed, the service converts feature coordinates to a local SVG coordinate space and reduces them to 3-digit integers, also keeping the number of individual rendered paths to a minimum. For a full SVG-compliant renderer (such as Adobe's SVG 3.0 browser plugin, www.adobe.com/svg) the service scales the SVG coordinate space differently, and adds a variety of user interface controls and event handlers to the SVG-Tiny core, to generate an interactive mapping application similar to AxioMap (presented at the first SVGOpen – see http://www.svgopen.org/2002/papers/zaslavsky__axiomap/)