EXAMINING MAP PROJECTION DISTORTIONS USING GEOSPATIAL WEB TOOLS

This paper presents a geospatial web application developed recently to support the teaching needs of sophomores at the University of New Brunswick on basic mapping concepts focussing on map projections. The application was built using multiple open source web programming tools and base maps; and it consists of a visualizer and a set of web services.


INTRODUCTION
Map projection (Robinson et al., 1995) is a method (function) of representing the surface of a spherical earth on a plane ( Figure 1a). Map projections are necessary for creating maps. All map projections distort the earth's surface in some fashion ( Figure 1b). Knowledge of the advantages and disadvantages for alternative map projections will definitely help in which projection to choose for a particular project (Porter and McDonnell, 1979). This paper presents a geospatial web application, comprising a visualizer and a set of services, developed to highlight the main properties of common map projections ( Figure 2). The overall objective of this project was to develop an innovative educational tool in teaching map projections using modern geospatial web technologies. The user of the application is able to define (at the client-side) the area of interest, the map projection, and the projection parameters. All these data is sent to the Server for processing. Then, the Server posts back to the Client an extended description of the distribution of distortions throughout the mapping area, expressed in appropriate measures (e.g., scale factor, Tissot's Indicatrix). Web services are applied for the dissemination of the measures in XML format. A thin-client supports the visualization of these measures using appropriate graphics on top of various base maps. In addition, basic lines, such as the geographic grid as well as geodetic lines and loxodromes connecting pairs of points are computed and visualized.
The paper is organized as follows. Section 2 presents the overall architecture and software components used. Sections 3 and 4 summarize the functionality of the visualizer and web services, respectively. Finally, Section 5 concludes the discussion by highlighting the value of this application and the future developments.

ARCHITECTURE
The application consists of two major parts: (a) visualizer, and (b) web service. It has been developed using multiple opensource web programming tools: HTML, PHP, and OpenLayers JavaScript library (Kraak and Brown, 2001;OSGeo, 2014). Figure 3 shows the overall architecture.
At the client side, the projection parameters are defined and posted to the server. This can be done through either HTML forms or unclean URL requests. After receipt, the server processes all those parameters using php scripts. The php scripts generate either HTML/JS scripts (including OpenLayers JavaScripts methods and graphics) to be visualized within the client's web browser ( Figure 2) or an XML file reporting measures about the map projections (e.g., distances, distortions, scale factors, etc.). The client may also need to connect to thirdparty servers (e.g., OSGeo, 2014) to retrieve the base maps (this connection is not depicted in Figure 3).

VISUALIZER
The application visualizer is a thin client that provides visual aid in understanding distribution of distortions on the surface of the Earth in the supported map projections. The visualizer (   The visualizer contains four base layers as map backgrounds. Out of these, two are layers, provided by OSGeo (basemap and satellite; OSGeo, 2014). The other two are images generated using a GIS software in two specific projections (Mercator and Gnomonic). The following paragraphs briefly describe the functionality of the visualizer.
The visualizer can calculate and display the shortest path ( Figure 4) between any two points on the map. Shortest path lies along the great circle passing through these points. The points are selected by a simple click and then by pressing the button "Shortest Path", the shortest path is displayed on top of the map. By default, the application calculates mathematically a sequence of points that are separated by a longitude of 1 degree. Then the algorithm joins the adjacent points through straight lines. As the points are so close, the curve appears smooth to the human eye and is fit for all practical purposes.
The visualizer can plot the shortest loxodrome ( Figure 5) between any two points. Loxodromes are lines of constant azimuth. The end points are selected simply by a click, and then by pressing the button "Loxodrome", it can be displayed. The application calculates points lying on the loxodrome mathematically and then joins those using straight lines. This approximation of loxodrome by line segments is fit for all practical purposes.
By clicking on any point on the map, the scale factors on the point for 5 different projections are reported in the report section of the visualizer (Figure 6). The five different projections are: Gnomonic, Mercator, Conformal Conic, Oblique Stereographic, and Secant Stereographic (Porter and McDonnell, 1979). The scale factor is a measure of distortions. A scale factor of 1 means no distortion, <1 means contraction, and >1 means expansion. The ellipse in reference to Tissot's Indicatrix (Robinson et al., 1995;Anson and Ormeling, 2001) is also drawn on the point (Figure 7). Hence, the distortion at a point in any direction can be visualized.
Scale contours are another technique to visualize distortion distribution on the map (Figure 8). The visualizer provides this option in one projection: the Oblique Stereographic (Porter and McDonnell, 1979). After entering the coordinates of the point of tangency under Oblique Stereographic section, the value of the scale contour must be entered (parameters section). Pressing the button "Scale Contour" the contour for the entered value is drawn.

SERVICES
The visualizer generates the data for internal processing, but does not provide this data for user's access. Its purpose is more of an explanatory and visualizing tool, rather than providing concrete data to the client. To tackle this deficiency in the visualizer, appropriate web services were implemented. The web services accomplish tasks using the same algorithms that have been used in the visualizer. The results are then posted back to the client in XML format.   There are two ways in which the client can query the web service. The first is through a form specifically designed for this purpose (Figure 9). The form consists of six divisions. Four of them are for map projections: Gnomonic, Mercator, Conformal Conic, and Oblique Stereographic. These return the scale factors as output. The other two are: shortest path, and loxodrome. Intermediate point coordinates are reported back in these. The corresponding fields can be filled with the Figure 9. Interface to the web services (currently available at: http://gaia.gge.unb.ca/shikhar/input.php).
The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XL-2, 2014ISPRS Technical Commission II Symposium, 6 -8 October 2014 appropriate values as per the desired output. After the submit button is pressed, the values are posted to the server and a php script generates an unclean URL request to a web service (Figure 10a). By activating the request, the results are reported in XML format (Figure 10b).  Figure 10. Example query to the web services: (a) shortest path request; and (b) output in XML format. Figure 11. Example visualization of an XML file content (shortest path).

CONCLUSION
Special focus has been given on the educational aspect of the application. The application was already used as a teaching tool of map projections. Students were able to better understand both the shape and length of basic lines on the spherical surface and recognize the strengths and weaknesses of some typical map projections. The application supports a limited number of projections, but it was developed in a way that more projections can readily be integrated.
Currently, the application is being redesigned to better meet the teaching requirements of three courses (one core undergraduate, one technical elective, and one graduate) at UNB. All three, interface, content and functionality of the new version will be enhanced and aligned to the course curriculum and tailored to the student needs.
Another future extension includes the development of standardized web services and languages for the dissemination of the graphics and measures, such as GML, WMS and WFS; as well as the introduction of the Ajax paradigm to allow compiled client-side code to load data asynchronously from the web server.