1. Introduction
Distortion in map projections is inevitable [
1,
2], and it remains a challenging subject in cartography [
3]. Distortions in map projections should be measured [
4,
5] to evaluate [
6], compare, select [
7,
8], improve, and optimize [
9] existing map projections, as well as to devise new map projections [
3,
9,
10,
11].
Several visual [
12,
13,
14] or numerical [
4,
15,
16,
17,
18,
19,
20] metrics of distortions have been proposed for map projections. Most existing metrics are dependent on forward or inverse equations of map projections, or dependent on differential calculations of forward or inverse equations. Among them, the benefit of the spherical great circle arc (GCA)-based indicators [
19], which are proposed in our previous study, is the independence on differential calculations. However, GCA-based indicators are dependent on the inverse equations of map projections. As an alternative, an improved interpolation-based metric (forward GCA metric or FWD–GCA-based metric) [
20] that is independent on inverse equations has been introduced in our previous study. Rational function-based regression has been adopted in the FWD–GCA-based metric [
20] to predict the maximum angular distortions.
Image-based approaches [
21,
22,
23,
24] are widely used in different domains. Map projections are generally imagery forms to depict natural or social features [
25]. In this study, we exploited the characteristic of image in map projections and the characteristic of differential independence of GCA-based indicators to establish a novel image-based metric and to evaluate the distortions in map projections. Predefined images with known patterns were employed in our image-based approach to represent the relationship between colors and latitude (or longitude) coordinates. Mapping software was adopted in our approach to generate distorted images. The use of mapping software avoids the explicit forward formulae of map projections. As there are large errors in ordinary image-based approaches, surface fitting-based noise reduction was introduced to reduce errors in image-based metrics. Furthermore, some common image filtering approaches (e.g., median filter and Gaussian filter) [
26] were applied to the proposed metric to further improve the visual or numerical results of our method.
The remainder of this paper is organized as follows. The image-based metric and the accompanying surface fitting-based noise reduction method are introduced in
Section 2. The experiments and validation are presented in
Section 3. Finally,
Section 4 presents the results and conclusion of this study.
2. Materials and Methods
2.1. Overview of Methods
Figure 1 provides an overview and comparison of traditional differential-based, our previous GCA-based, previous FWD–GCA-based, and the proposed image-based metrics.
Differential-based metrics (see p. 24 in [
15]) were employed to calculate the maximum angular distortion (see symbol
in
Figure 1) and the area distortion using partial derivatives of forward equations of map projections. GCA-based metrics [
19] (see symbol
in
Figure 1) are differential-independent metrics employed to avoid differential calculations; they have high correlations to the classical differential-based metrics [
19]. Although differential calculations are not required in the GCA-based metrics, inverse transformations (see the blue line in
Figure 1) of map projections are required. To avoid the dependence of inverse transformations, FWD–GCA-based metrics [
20] (see symbol
in
Figure 1) were proposed. These metrics employ an approach based on vector interpolation (see the purple line in
Figure 1). FWD–GCA-based metrics are highly correlated with differential-based metrics [
20].
GCA-based and FWD–GCA-based metrics are explicitly dependent on the forward equations (orange lines in
Figure 1) of map projections for transforming sample points. Additionally, GCA-based metrics are explicitly dependent on inverse equations of map projections for transforming sample points. In this study, we proposed an image-based metric to measure the distortion of map projections. The proposed metric is an improvement method of the previous GCA-based metrics, but it is not explicitly dependent on forward or inverse equations of map projections. The proposed method uses distorted images generated by mapping software as input and calculates distortion metrics based on the distorted images. To improve the accuracy of the image-based method, a surface fitting-based noise reduction was accordingly introduced. There are several mapping software programs [
27], such as NASA’s G.Projector, Mapthematics LLC’s Geocart, and Esri’s ArcGIS. In this study, the NASA G.Projector 3 software was employed to generate images for approximately 200 map projections. These map projections were evaluated by the proposed metrics. Moreover, the accuracy of our proposed metrics was evaluated.
2.2. Great Circle Arcs-Based Metric
GCA-based metrics [
19] are the underlying mathematical principle of the proposed image-based approach.
For a specific map projection, we selected four points located on the corners of a very small square on the projection plane (see
in
Figure 1). The area of the very small square on the projection plane was assumed to be
, where
is a sufficiently small value. As shown in
Figure 1, the four points are converted to a unit sphere
using inverse equations (see the blue line in
Figure 1) of map projections. The three-dimensional coordinates of the four points on
were used to calculate the GCA-based metrics.
We denoted as the Cartesian coordinates of the four three-dimensional points on , . Furthermore, we assumed that the corresponding points (on the projection plane ) of and were located on one diagonal of the very small square, and the corresponding points (on the projection plane ) of and were located on the other diagonal of the square.
GCA-based metrics was obtained as follows.
First, we calculated the three-dimensional vectors
, where
, connecting
, where
and the normalized three-dimensional vectors
, where
. Thereafter, we calculated the arc length
on
, where
.
Next, the length and angle components of the GCA-based metrics were calculated.
Finally, we combined the above two components as a GCA-based shape distortion metric
by arithmetic mean.
The angular distortion
of map projections was calculated from
using a rational function [
20] with one degree for non-cylindrical, nonconic, and non-azimuthal map projections.
where the coefficient
was calculated using rational function-based regression,
. Candidate values for the coefficient
was obtained in a previous study; that is,
and
[
20].
For cylindrical, conic, or azimuthal map projections, the previous study [
20] revealed a simpler equation for calculating angular distortion
.
Additionally, GCA-based area distortion was obtained using
where
is the area of the very small square on the projection plane
.
It was inferred from previous study [
20] that
was a good estimation of the differential-based angular metric
, and
was almost the same metric as the differential-based area metric.
2.3. Image-Based Coordinate Conversion
In the proposed image-based metric, we employed two predefined rectangular color images (see
Figure 2) for latitude and longitude coordinate conversions, respectively. Those predefined images use Plate Carrée projection to establish a known forward and inverse relationship between the colors and latitude (or longitude) coordinates. In
Figure 2, each pixel in the same row in a predefined latitude image has the same color. Similarly, each pixel in the same column in a predefined longitude image has the same color. Pixels in different rows in the latitude image as well as in different columns in the longitude image have distinct colors. Therefore, we assumed the known relationship between colors and latitude (or longitude) in predefined images to obtain the coordinates of points in distorted latitude (or longitude) images.
We denoted W and H as the width and height of the predefined latitude (or longitude) images, respectively, where . The symbols x and y represent the horizontal and vertical pixel coordinates, respectively, where , , and the origin of the pixel coordinates is in the upper-left corner of the images. W and H are sufficiently large to ensure accuracy and reduce errors of coordinate conversion.
Predefined 24-bit true color images have three channels (R, G, and B). Each channel uses 8 bits per pixel to represent 256 different levels of grayscale. For images whose parameters H < W < 256 × 256 = 65,536, only 2 channels (R and G in our approach) are sufficient for the predefined images to guarantee distinct colors used for each row in the latitude image and distinct colors used for each column in the longitude image. For images with widths greater than 65,536, all 3 channels in the predefined images are required.
We assumed that two channels are used in the predefined images in our study, and denoted
as the particular pixel coordinates in the predefined latitude (or longitude) image,
as the color values of the R and G channels for
in the predefined latitude image, and
) as the color values of the R and G channels for
, in the predefined longitude image, respectively. Considering the Plate Carrée projection used in the predefined images, the conversion relationship from the pixel coordinates
in predefined images to color values
and
are presented as
where
is the floor function,
is the modulo operation,
P is an integer, and
P < 256.
The above formulae generated two predefined (
) images with consecutive integer color values
and
for consecutive integer pixel coordinates
. The predefined images were used as the input images of mapping software to create distorted output images using specific map projections with sufficient output resolution to ensure the accuracy of subsequent calculations. An example of distorted output images for the Bonne projection is shown in
Figure 3.
Next, we derived the inverse conversions of Equations (
10)–(
13), which established the conversion relationship (see Equations (
14) and
15) from color values in distorted images to latitude and longitude coordinates.
Considering
and
, the color values of the R and G channels for a particular point
in the distorted output latitude and longitude images (see
Figure 3) created by the mapping software, latitude and longitude coordinates
can be obtained by
where
and
are calculated by
2.4. Surface Fitting–Based Noise Reduction
Considering
, that is, the coordinates of a point in the distorted output images that are generated by mapping software, the corresponding latitude and longitude coordinates
of point
can be directly calculated by substituting color values
and
of point
into Equations (
14)–(
17).
Similar to the GCA-based metrics, which use four points located on the corners of a very small square on the projection plane , we selected four points that meet the same condition of the square’s corners. These were on the plane of the distorted output images, and we used these four points to calculate a metric in the sense of GCA-based metrics.
However, owing to the discreteness of integers used in (
14)–(
17), and the limited representation resolution of predefined input and distorted output images of mapping software, the latitude and longitude coordinates calculated by image-based coordinate conversion may suffer fairly large errors. These errors may be applied to image-based metrics in terms of GCA-based metrics.
Here, we introduce an approach of surface fitting-based noise reduction to reduce the errors and improve the calculation accuracy of image-based coordinate conversion and the derived image-based metrics.
Bivariate polynomial functions were employed for the surface fitting on the image plane (see
Figure 3). We denoted
d as the half size of the window for the surface fitting. Considering point
and a window of size
, points inside the window centered at point
were used in the process of surface fitting.
Two bivariate polynomial functions were required to establish the process of polynomial fitting for latitude and longitude conversion, respectively. We described the process of polynomial fitting by second-degree bivariate polynomial functions.
We assumed two bivariate polynomial functions with twelve unknown coefficients, as follows:
for latitude and longitude conversions, respectively.
Thereafter, we calculated latitude and longitude coordinates
for each point
, which was inside the window centered at point
, using image-based coordinate conversion according to Equations (
14)–(
17), where
, and
.
Next, we substituted the coordinates of the two series of
points, where
and
, into the above two polynomial functions, and then obtained two systems of linear equations:
where
Matrix
in Equation (
22) represents the coordinates of the series of points inside the window. The right-hand sides of Equations (
20) and (
21) are the latitude and longitude coordinates, which are calculated by image-based coordinate conversion of those series of points.
The above over-determined systems can be solved in the least square sense to obtain latitude coefficients
,
,
,
,
, and
for Equation (
18), and longitude coefficients
,
,
,
,
, and
for Equation (
19).
Thus, we employed Equations (
18) and (
19) to calculate latitude and longitude coordinates for specific points (e.g., point
or its neighboring points) on a projection plane (i.e., the image plane), respectively.
In the previous GCA-based metrics, four points located at the corners of a square on the projection plane
were used. Hence, we selected four points as
,
,
,
,
,
, and
,
, which were obtained by Equations (
18) and (
19), on the image plane of distorted images, and then substituted them into Equations (
1) and (
9) to calculate the image-based distortion metrics in the sense of the GCA-based metric for map projections.
2.5. Post-Processing and Contour Calculation
Several map projections are symmetrical in shape, e.g., central symmetry for some azimuthal projections, and horizontal and/or vertical symmetry for some pseudocylindric or polyconic projections.
In particular, the above symmetry of shape was determined by the symmetry of the underlying formulae of map projections. The symmetry of formulae of map projections results in the symmetry of the distribution of distortion metrics for specific map projections. Hence, we utilized symmetry of distortion distribution to further improve the quality of metrics. Assuming a map projection with horizontal symmetry, such as the Bonne projection, we horizontally flipped the image of the result of the image-based distortion metric, and then averaged the metrics of flipped and original images. For map projections with the property of both horizontal and vertical symmetry, we horizontally flipped, vertically flipped, and horizontally and vertically flipped the original images. Thereafter, we averaged the metrics of the three flipped images and one original image.
Additionally, all cylindrical projections were rectangular in shape, with straight parallels for normal aspects. For normal aspect cylindrical projections, one can derive that points along the same latitude have the same value of the differential-based angular and area distortion metrics. Thus, we accumulated and averaged image-based metrics along the horizontal direction to improve the accuracy of the image-based metrics for cylindrical projections.
Furthermore, there are many image filtering techniques, such as median filters and Gaussian filters, for noise reduction in image processing. Therefore, we applied existing filtering approaches in the process of calculating image-based metrics.
As image-based metrics calculate distortions for sample points on the image plane, we further determined the contours of distortions on the image plane to represent intuitive visual results of the distortions.
3. Results
3.1. Overview of Implementation and Experiments
NASA G.Projector 3 is a JAVA program and a mapping software that supports several map projections [
27]. Images of more than 200 map projections were generated in our study by NASA G.Projector 3.0.2 on a desktop with 64-bit quad-core of 3.3 GHz CPU, 16 GB DDR3 memory, and 64-bit Windows 7 Ultimate and 64-bit OpenJDK 11.
The above map projections were evaluated by our proposed approach. The main algorithm of image-based coordinate conversion, surface fitting-based noise reduction, and GCA-based metrics calculation was implemented in Julia [
28], a modern, high-level, high-performance, and dynamic programming language, for its speed and flexibility [
28]. However, certain post-processing and contour calculations, analyses, and plots were implemented in Python owing to its simplicity and usability. The versions of Julia and Python used were 1.6.1 and 3.8.10, respectively. Several additional Julia packages, including CSV, DataFrames, Statistics, and Images, were employed in our implementation. A few additional Python packages, such as csv, numpy, scipy, scikit-image, and matplotlib, were also used in our experiments. Contours in our experiment were calculated by matplotlib.
Differential-based metrics were used as the reference of our proposed metric. The results of differential-based metrics for more than 60 map projections were derived from a previous study [
20].
3.2. Parameters and Consumption in Experiments
Parameter was used for the predefined latitude and longitude images. The resolution of the predefined images was W = 20,000 pixels and H = 10,000 pixels. Predefined images were used as the input images for NASA G.Projector 3. NASA G.Projector then renders distorted output images with no borders, no graticules, and no overlays with a white background for map projections. The resolution of output images, which may contain an unnecessary white background, is also selected as 20,000 × 10,000 pixels. The formats of input and output images for NASA G.Projector are Portable Network Graphics. Approximately 11 GB of memory is required for the Java virtual machine to run the NASA G.Projector 3 program to produce the above resolution of images. Time consumption for producing images is dependent on the computation complexity of map projection. Typically, approximately 130 s on average was consumed for generating latitude and longitude images for each map projection using a single core of CPU in our experiment environment. The average size of distorted latitude and longitude images for each map projection was 278 MB.
The distorted 20,000 × 10,000 output images from NASA G.Projector 3 is followed by the proposed algorithm in Julia with multiple threads support enabled. We did not evaluate every pixel among 20,000 × 10,000 samples in the images for efficiency and only used 10 pixels as the interval of pixels along both the vertical and horizontal directions. In particular, the output images representing the proposed image-based metrics is approximately 20,000 × 10,000 pixels for each map projections.
In our experiment, we selected parameter
, and then used
as the size of the window for the second-degree polynomial function-based surface fitting (see Equations (
20) and (
22)). Coefficients in Equation (
7) were selected as the same values in previous study [
20]; that is,
and
. The precision of the floating point used in Julia is 64-bit. Approximately 4 GB memory was required for processing each map projection in Julia. The typical time consumption was approximately 208 s on average for each map projection using the 4 CPU cores with multiple threads supported in Julia in our experiment environment. The time of processing may be further reduced by GPU-based acceleration owing to the simple form of linear algebra, which is used in our metric.
3.3. Quality of Noise Reduction Using Surface Fitting
In this section, we provide an example of a Bonne projection for the comparison of the effect of surface fitting-based noise reduction.
3.3.1. Differential-Based Metric as the Reference Metric
Figure 4 represents the classical distribution of differential-based maximum angular distortion for Bonne projection with the standard parallel
with a scalar bar. We used the same scalar bar in the figures below to represent angular distortions of different map projections. An enlarged view of the distribution of the Bonne projection is also illustrated in
Figure 4. Contours (see black lines) at levels of
,
,
,
,
, and
, are also plotted in
Figure 4. The differential-based maximum angular distortion was used as the reference metric for our proposed image-based metric for different map projections.
3.3.2. Image-Based Angular Distortion without Noise Reduction
Figure 5 illustrates the distributions and contours of the angular metrics of the image-based approach, which only uses four sample points in the image space to calculate the metric of each point. Therefore, there is no surface-fitting-based noise reduction in
Figure 5a. As there is severe noise in
Figure 5a, the error between the differential-based metric and image-based metric without noise reduction is extremely large, and the correlation between them is significantly low.
Figure 5b considers the horizontal symmetry of the Bonne projection and uses a median filter with a disk of radius of 5 pixels. In
Figure 5b, six different colors (red, yellow, green, cyan, blue, and magenta) represent different values (
,
,
,
,
, and
) of contours. As shown in
Figure 5b, the median filter reduces the noise of the metric to some extent, but contours derived from the image-based metric and the median filter still deviate from contours derived from differential-based metric.
We further applied a Gaussian filter with a standard deviation of 3 after the median filter. The results of the median and Gaussian filters are shown in
Figure 5c. The Gaussian filter further reduces the noise and improves the form of contours. However, contours derived from the image-based metrics and median and Gaussian filters still deviate from contours derived from differential-based metrics. In addition, some values are missing at the boundary (see the upper right corner in
Figure 5c) of map projection when a Gaussian filter is applied.
We did not plot color contours for results in
Figure 5a, as contours in different levels are overlapped. In
Figure 6, we used individual plots for six different level of contours by using different colors.
Figure 6 avoids overlapping contours, but the visual effect of results in
Figure 6 is poor.
From the results in
Figure 5 and
Figure 6, the image-based metrics without noise reduction cannot produce good distributions and contours, even if some image filters are applied.
3.3.3. Results of Fitting-Based Noise Reduction
Next, a second-degree polynomial function was applied for surface fitting-based noise reduction. When noise reduction was applied, the results of the distributions and contours of the image-based metric were significantly improved (see
Figure 7).
Figure 7a is the result of image-based metrics with surface fitting-based noise reduction. The surface fitting-based noise reduction employs multiple sample points inside a window to improve the accuracy of calculations of the latitude and longitude coordinates. In particular, we used
pixels in images to calculate coordinates and the image-based metrics (see
Figure 7a).
Furthermore, we considered the symmetry of the Bonne projection, and the results are shown in
Figure 7b. There is a slight improvement of contours when considering symmetry. When a median filter with a disk of radius 5 is further applied, a more visually improved result can be obtained (see
Figure 7c).
Although the form of contours is improved in
Figure 7c, the error increases slightly, and there are some missing pixels in the boundary in
Figure 7c. Therefore, a practical approach is that we can calculate image-based metrics and draw the distribution of metrics using surface fitting-based noise reduction and considering symmetry of map projections. When we determine the contours, an image filter, such as a median filter, can be applied.
3.4. Correlation and Error Analysis of Metrics
By employing Bonne projection as an example to illustrate the effectiveness of the image-based metric with surface fitting-based noise reduction, we evaluated the correlation and error of the proposed metric for more map projections.
We used differential-based metrics as the reference of our proposed metric. Pearson product-moment correlation coefficient (PPMCC) and root-mean-square error (RMSE) were used to evaluate the correlation and error between our proposed metric and the differential-based metric.
In a previous study, differential-based metrics were calculated for more than 80 projections. Among them, 64 map projections employed approximately one million sample points on the projection plane to obtain the differential-based metric. In this section, we compare the results of these 64 map projections.
Note that the proposed image-based metrics use approximately
sample points (may contain unnecessary white background). Meanwhile, results in a previous study [
20] use approximately one million sample points. Therefore, we resized the results of the differential-based metric to the same size as the image-based metric results for visual comparison and statistical analysis.
Table 1 provides the statistical results for 64 map projections. The histogram of errors is shown in
Figure 8. The statistical results employ a Gaussian filter with a standard deviation of 1. From
Table 1 and
Figure 8, we can observe that the worst error is approximately
for Ortelius Oval and Winkel II projections, while in most cases (approximately 89%), the error is less than
.
As contours are intuitive visual indicators of correlation, and PPMCC and RMSE are just statistical indicators of correlation or error, we should plot the distributions and contours for some projections with large errors to verify the error between the differential-based metric and our proposed image-based metric.
Figure 9 illustrates the results of differential-bthe ased and image-based metrics for Ortelius Oval and Winkel II projections and some map projections whose errors are greater than
. We can observe that the contours of the proposed image-based metric is deviated to the contours derived by the differential-based metric to some extent, especially in areas of lower distortions (see red contours for most map projections, and see green contour for the Bacon Globular projection); while the contours of the proposed image-based metric is close to the contours derived from the differential-based metric in areas of higher distortions, which are of significant interest to researchers or mapmakers.
According to the above visual and statistical results, we can use the proposed image-based metric to evaluate more map projections.
Figure 10 illustrates the results of the image-based metric for some Canters’ projections, Maurer’s projections, etc., which are not mentioned in our previous study, as PROJ library [
27,
29], which was used in the previous study [
20], does not support these map projections. As NASA G.Projector supports more than 200 map projections and more map projections than PROJ library, we can use the proposed image-based method to evaluate these available map projections. In addition, G.Projector does not contain all map projections, so we can further use other mapping software, such as Geocart, as a supplement to evaluate more map projections.
4. Discussion and Conclusions
In this study, we proposed a novel image-based metric for evaluating the distortions of map projections, and employed a novel surface fitting-based noise reduction approach to make the image-based metric be feasible for distortion evaluation. The proposed method is practical as it can employ existing mapping software to produce distorted images for map projections, whereas explicit formulae of map projections need not be used to calculate the distortion of map projections. As NASA G.Projector, which is employed as the mapping software, provides many map projections with several adjustable parameters, and there are other mapping software available, we can use the proposed image-based metric to evaluate a sufficient number of existing map projections.
However, existing mapping software cannot contain all map projections, especially some new or recently-devised map projections. Employing mapping software to calculate the proposed image-based metric for these new map projections may encounter difficulties in usability. As an alternative, we can manually generate latitude and longitude images by forward or inverse equations of specific map projections. The generated images can be used for calculating image-based metric. Hence, the proposed image-based metric is a feasible and usable approach for map projection evaluation.
It should also be noted that NASA G.Projector does not contain some existing map projections, e.g., Eckert I, Eckert II, Collignon, and Tobler–Mercator projections. As a supplement, Mapthematics LLC’s Geocart supports these and more map projections; therefore, we can further use Geocart as the mapping software and employ our proposed method to evaluate more map projections.
In addition, for map projections with known formulae, one possible improvement of the proposed metric is using direct calculations based on a group of sample points and the formulae of map projections, while discarding the employment of distorted images. This improvement may reduce the processing time and memory consumption.
Specific patterns are used for latitude and longitude images. We think other patterns, which have one-to-one mapping, can also be used as the pre-defined patterns. Initially, we considered using one pre-defined patterns for both latitude and longitude conversions. However, we found that it is hard to separate latitude and longitude using one pattern. Then, we considered individual patterns for latitude and longitude images. The results in our manuscript implied that the adopted patterns are feasible for establishing the basic mapping relationship, and the inaccuracy in the image-based conversion can be corrected by surface fitting-based noise reduction. That is, there may be more reliable patterns, but the current patterns are sufficient for our proposed metric.
In this study, we employed NASA G.Projector to generate images for more than 200 map projections, and calculated distortions for those map projections. Moreover, we compared our proposed image-based metric with a differential-based metric. The analysis and comparison results revealed that the proposed metric have high correlation and low error with the existing differential-based metric. Another observation about the proposed image-based metric is the noticeable differences between the differential-based metric and the proposed image-based metric in areas of lower distortions. As areas of higher distortions are of significant interest to researchers or mapmakers, some errors existing in areas of lower distortions may be acceptable. In the future, we will consider improving the previous GCA-based metric, the underlying mathematical principle of the proposed image-based metric, to further reduce the error in areas of lower distortions.
Area distortion is also an important metric for map projections. As revealed in a previous study, area metrics are much simpler than angular metrics, and GCA-based and FWD–GCA-based area metrics are almost the same metrics as differential-based area metrics; therefore, we did not discuss the area distortion metric using the image-based method.