Web-Based SVG Map System: Design and Implementation
Robert P. Biuk-Aghai Faculty of Science and Technology University of Macau Macau S.A.R., China Email: robertb@umac.mo Abstract Systems providing geospatial information are numerous, but often are complex and difficult to use, preventing the more wide-scale utilization of geospatial information. We have designed and implemented a system that is easy to deploy and use, yet provides sophisticated map views. Our Web-Based SVG Map System, besides having traditional map viewing and navigation functions, provides map printing, map exporting into GML and PNG formats, and a simple map editing function. It was built using open standards and open source components, and is centred on Scalable Vector Graphics (SVG) technology. It consists of a relational database backend storing geospatial information, a map server implemented by us using Java servlet technology, and a web-based frontend implemented by us using SVG and JavaScript technology. Through the innovative use of asynchronous JavaScript, data transfer requirements are minimized and system responsiveness is improved. This system has the potential to make geospatial information significantly more accessible to and usable by general users. 1. Introduction Many organizations world-wide are deploying and using geographic information systems (GIS), providing geospatial information to assist management, planning, and decision making. Utility companies, government departments, and others often possess large amounts of geospatial information in these systems which frequently is vital for their operation. However, geographic information systems are usually complex and require significant amounts of training and expertise to be used effectively. This prevents the wider use of geospatial information within the organization, limiting it to a relatively small group of experts. Managers, planners, and other non-technical end users would have much to gain from greater access to this information. Web-based interfaces to geospatial information have emerged over the past years as an alternative to using the complex interfaces of geographic information systems [6],[9]. However, web-based interfaces usually suffer from several limitations. Firstly, the map displays are typically of inferior quality when compared to those of a desktop GIS. Secondly, the map displays are static, meaning that they cannot provide other information than what they initially display. Any map interaction such as zooming or getting information on map features (i.e. objects on the map) requires a separate request to the GIS web server, resulting in poor responsiveness as the new map view has to be downloaded from the server. Thirdly, web-based interfaces are almost exclusively for viewing only, disallowing editing of geospatial information. Finally, existing web-based interfaces use proprietary technology and data formats that work only with certain proprietary geographic information systems. We have developed the Web-Based SVG Map System to overcome all of these limitations. It uses Scalable Vector Graphics (SVG) as the core technology for producing and interacting with all map views. The resulting maps are of high visual quality. Moreover, given the nature of SVG, some map manipulation operations can be performed within the web browser without having to contact the web server to request a new map view. Given the programmatic capabilities of SVG, map editing can be performed through this interface. Finally, our system is based entirely on open standards and open source components and is independent of any existing proprietary GIS. Details of our Web-Based SVG Map System are introduced in the sections that follow. The remainder of this paper is structured as follows: Section 2 gives a brief overview of SVG technology, the backbone of our system. Section 3 presents our system in more detail, and Section 4 discusses the system’s design and implementation. Finally, conclusions are presented in Section 5. 2. SVG Scalable Vector Graphics (SVG) is a recent technology for producing two-dimensional graphics and graphical applications. The SVG technology consists of two parts: the SVG language for specifying graphics and graphical applications; and an SVG viewer for displaying SVG content. The SVG language is based on (i.e. it is an application of) the eXtensible Markup Language (XML), and is thus both human-readable and machine-processable. It has the status of a W3C (World Wide Web Consortium) Recommendation. The SVG language provides facilities for document structuring, definition of shapes, painting, clipping and masking, compositing, text manipulation, styling, linking, scripting, animation, interactivity, integration of multimedia content, and others [10]. It is thus a very expressive language for creating rich graphics and highly interactive user interfaces for use on the Web. The SVG viewer is software that interprets and renders an SVG document. It typically integrates into a web browser, either as a plug-in or as a built-in component. There are several SVG viewers on the market, including the Adobe SVG viewer [1] which can be installed in a web browser as a plug-in, and a native SVG viewer integrated in the Mozilla Firefox web browser [7]. Development on both of these viewers is still in progress in order to achieve full compliance with the SVG specifications. In scope and capability SVG is similar to Shockwave Flash technology. However, it is different from Flash in being a W3C recommendation, rather than a proprietary technology; in being XML-based, rather than being based on a closed binary format; and in being explicitly designed to work with other W3C standards such as CSS (Cascading Style Sheets), DOM (Document Object Model), and SMIL (Synchronized Multimedia Integration Language). Because of the capability of SVG of producing high-quality graphical displays, the ability to develop interactive user interfaces with it, and the ability to manipulate the contents and structure of an SVG document, it is very well suited for developing interactive web-based map applications. Details of our Web-Based SVG Map system are introduced next. 3. System Overview Our Web-Based SVG Map System is a generic map application for use by untrained end users. It presents a map view and several map manipulation and navigation functions. It relies on data in a standard GIS format such as ESRI shapefiles as its input, which it converts into a relational database storage format. A view of the user interface as it appears in the web browser, including a map of Macau, is shown in Figure 1. ![]() Figure 1 Web-Based SVG Map System user interface with map of Macau The display consists of the following parts:
![]() Figure 2 Multi-point distance measure with distance to points 2 and 3 shown All of the user interface, including the map display itself, the toolbars, the feature type window, the navigation window, and the feature attributes window, are part of a single SVG document which is rendered in the web browser by the SVG viewer software – either an SVG plug-in, or a built-in SVG viewer. The map functions are intuitive and easy to use. The map display is of high quality and visually attractive. Because it is web-based, the system is easily deployed: provided that each client computer already has an SVG viewer installed, the system only needs to be installed on a server computer and can then be immediately accessed and used by all clients. 4. Design and Implementation Our Web-Based SVG Map System was designed and implemented as a three-tier system, consisting of (top-down) a client tier, an application tier, and a database tier. The general system structure is shown in Figure 3. The client tier is responsible for presenting the map user interface (as described in Section 3) to the user. This part of the system consists of SVG code with embedded JavaScript which implements some interactive functions. It runs inside the SVG viewer, which in turn runs inside the web browser. In our system, we are using the Mozilla Firefox web browser with built-in native SVG viewer. ![]() Figure 3 System structure of Web-Based SVG Map System The application tier is responsible for producing map data for the client tier. It receives requests specifying the desired map data, then obtains the required data from the database tier, prepares the data in the required format, and sends it back as a response to the client tier. In our system, we use an Apache Tomcat web server/servlet container, the GeoTools API [4] for some map data transformations, the Batik toolkit [2] for converting map data to export format, the JTS Topology Suite [5] for implementing spatial analysis functions, and the GeoAPI [3] for implementations of the OpenGIS specifications [8]. Finally, the database tier contains the geospatial information that is to be presented to the user. It receives queries from the application tier, performs queries on the database, and sends query results back to the application tier. In our system, we use a PostgreSQL database server with PostGIS extension. System performance is satisfactory. Retrieving and rendering most simple maps is achieved within about 2-3 seconds. When large numbers of features are involved this time increases. For instance, a map with five different feature types and a total of about 3,000 features requires about 10 seconds to retrieve, transmit to the client, and render in the SVG viewer. Each feature type is progressively drawn on the screen, so that the user immediately sees parts of the map appear. Some map navigation operations do not require any separate server access. For example, when zooming into a given map view, the zoom operation is performed on the map data that is already present in the client side, as the data in vector (SVG) format can be arbitrarily magnified and still produce high quality graphical output. Another operation that takes advantage of the presence of client-side data is the select/get info function. Attribute values of map features are present in the SVG data that is already present in the client side, so that when a user clicks on a map feature, the attribute data can be immediately displayed without having to contact the server. When the user requests data which is not present in the client, for example when selecting a currently not displayed feature type, a request for just this data is sent to the server. The server then sends this data back to the client, which inserts it into the SVG document that resides in its memory. Asynchronous JavaScript is used for this client-server communication. The effect is that system responsiveness is greatly increased as compared to the case where the entire map data in the current map view has to be retrieved from the server on each map manipulation. Conclusions This paper has briefly introduced the functions, design and implementation of our Web-Based SVG Map System. It uses scalable vector graphics (SVG) as the core technology of the system. This enables it to have a visually appealing and high quality graphical display. Moreover, it makes it possible to perform certain operations entirely in the client side, resulting in greatly enhanced system responsiveness. We foresee the use of this type of technology to increase in the future as it matures, and for increasingly more GIS systems to be based on it. Finally, the system presented here is of applicability beyond the location in which we have used it and whose map data we have loaded into it (Macau), to other locations around the world. Moreover, the system can become the basis for building other applications that use geographic information and map display on top of it. In this way, it has the potential to empower people throughout the organizations in which it will be deployed by giving them easy access to geospatial information. Acknowledgments The support by the University of Macau toward this work is gratefully acknowledged. Thanks go to Jacky Chan, Marcelo Chong, Johnny Leong, and Martin Loi for their work on implementing the Web-Based SVG Map System. Thanks are also due to Gerald Estadieu and Frederic Petit for their help and support for this project. References
| ||
|
|