The Projection Explorer relys on a rather large amount of JavaScript, a web service that calls the Proj4 library, some configuration files, and a large cache of precomputed projection grid files. The JavaScript includes the web-mapping library CanvasMap. CanvasMap provides the display of the spatial data for both of the maps and interaction with the user and the data. Custom layers have been created to display the geographic bounds and the projected distortion data. The controls within the map are also custom. The web service was created in Python. Python was also used to create a CSV file with the settings for Proj4. This started as a dump of the settings rom the library but a number of settings were missing and we needed to provide the ranges so the CSV was edited and then converted to a JSON file. This file is read by the web site after it loads to provide the content for the Type and Method controls. This file also provides a description of the settings controls based on Proj4s settings and manual edits to the CSV file. A Python script is executed to create the basic JSON grid files for the supported projection methods and default settings. Additional grid files are created and stored by the web service. The JavaScript project class only requests a projection grid when needed and instead shifts the coordinates when the longitude of origin is changed. This allows faster response and the animation of the projection as the longitude of origin changes.
When the user changes the settings, a web service is called with the projection method and parameters. The latitude and longitude minimum and maximum values are also specified and the desired interval between the coordintes values. The web service combines these parameters into a unique file path and checks if the file is already avaialble. If not, a JSON file is created that contains a grid of projected coordinate avlues and other information. The JSON file is then returned to the script code. This triggers a repaint of the projected map which triggers computing the distortion values the user has selected for display. To compute the distortoin values, traditional geographic, or "great arc", calculations are used to compute the true area and distance. These are compared with area and distance calculations from the projected data. The projtected values are divided by the true distances with the result being mulitpled by 100 to convert it to a percent distortion.
It is difficult to measure the distoration of an overall shape so the change in the angles of the intersecting lines in the grid are computed instead. The angles should be at 90 degrees. One approach would be to sum the postive and negative changes in the angles from 90 degrees but at times these would cancel out giving a value of 0 when the angles had been distorted. To avoid this, the angle distoration is reported as the absolute change in shape from 90 degrees. This is why there is no minimum value for the Angle distoration.