The best projection for Portugal?

General discussion of map projections.
Post Reply
mapnerd2022
Posts: 165
Joined: Tue Dec 28, 2021 9:33 pm

The best projection for Portugal?

Post by mapnerd2022 »

Good morning, everyone, I would like to know, just out of curiosity, what projection (or projections) is best for mapping Portugal.
Atarimaster
Posts: 446
Joined: Fri Nov 07, 2014 2:43 am

Re: Best projection for Portugal?

Post by Atarimaster »

The map projection wizard suggests
– Transverse cylindrical equal-area,
– Transverse Mercator, or
– Cassini,
depending on which property (equal-area, conformal, equidistant) you prefer. For a region of this size, the differences are marginal.

The site also links to the EPSG Geodetic Parameter Registry, which apparently listed the “official” projections of various countries. Unfortunately, the link doesn’t work anymore, but probably you’ll find that information somewhere else on the web.

Hope this helps!
Atarimaster
Posts: 446
Joined: Fri Nov 07, 2014 2:43 am

Re: The best projection for Portugal?

Post by Atarimaster »

Another note:
A 1961 atlas that I own doesn’t have a map showing Portugal only, but for various maps of comparable size and orientation, it notes that the used projection is the “abweitungstreue, flächentreue, unecht-konische Entwurf”. I think that is the one that is usually referred to as the Bonne projection, but I’m not sure about that at the moment.
mapnerd2022
Posts: 165
Joined: Tue Dec 28, 2021 9:33 pm

Re: The best projection for Portugal?

Post by mapnerd2022 »

Atarimaster wrote: Wed Nov 30, 2022 3:16 am Another note:
A 1961 atlas that I own doesn’t have a map showing Portugal only, but for various maps of comparable size and orientation, it notes that the used projection is the “abweitungstreue, flächentreue, unecht-konische Entwurf”. I think that is the one that is usually referred to as the Bonne projection, but I’m not sure about that at the moment.
That is indeed the Bonne Projection, also known as modified Flamsteed(since the classic Sinusoidal is the equatorial limiting case of it and was atributed not only to Mercator but also to Nicolas Sanson and John Flamsteed) and as the Depôt de la Guerre projection.
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: The best projection for Portugal?

Post by Milo »

For regions that small (and not too close to the poles), I would recommend using a normal cylindrical projection (equal-area, equirectangular, or Mercator depending on preferred property), as the convenience benefit of having straight meridians and parallels (making the map more intuitive to read, as well as very easy to calculate) outweighs any distortion advantage of using more complicated projections.

If you absolutely must minimize distortion, though, I would recommend using an oblique azimuthal projection centered somewhere inside the region being mapped. This is more advantageous than a transverse/oblique cylindrical projection, since a cylindrical projection (in any aspect) will "waste" a lot of the standard parallel on places lying outside the region, in return for distortion rising more rapidly away from the standard parallel.

Since Portugal is somewhat elongated (about twice as much north-south than east-west extent), it might be possible to improve on this by using an elliptic projection, but (A) such projections aren't as well-researched as azimuthal projections (I have a few musings here, but those projections are explicitly not optimal), and (B) the minor improvement probably won't be worth the effort.

Theoretically, it would be possible to numerically approximate a projection that is optimal for the exact borders of Portugal, analogous to the GS50 projection, but this is very difficult to compute and I am not aware of any publicly-available map-projection software that offers this as a standard feature.

The only times I'd recommend other projections than the above might be if you're mapping something that's stretched thin to the degree of, say, Chile, or if you're mapping something extremely large (I'd say the size of at least half the globe, but you might already want to start considering it for very large countries like Russia). Neither applies to Portugal.
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: The best projection for Portugal?

Post by Milo »

On further consideration, I appear to have underestimated cylindrical projections.

Here's some concrete analysis of cylindrical vs azimuthal projections of regions. For simplicity, I'll be addressing the case of a normal-aspect cylindrical projection of a region lying on the equator, so you'll need to apply a coordinate transformation to use this for a transverse projection of Portugal.

Consider a "rectangular" region that covers longitudes [-length/2,+length/2] and latitudes [-width/2,+width/2].

First, we'll consider the equal-area case:
  • In a normal-aspect equal-area cylindrical projection with a given standard parallel, a given point (longitude,latitude) has angle distortion (ratio of semimajor to semiminor axes of the Tissot indicatrix, because that's the easiest measure to compute) equal to either (cos(standard)/cos(latitude))^2 or the reciprocal thereof, whichever is larger than 1. Maximum distortion of one type is found at latitude=width/2, maximum distortion of the other type is found at latitude=0. Minimax distortion is achieved when distortion at the equator and the edge are equal, which happens when cos(standard)^2=cos(width/2). This minimax distortion is then equal to 1/cos(width/2).
  • In an equatorial-aspect azimuthal equal-area projection projection, a point has an angle distortion of 2/(cos(longitude)*cos(latitude)+1). Distortion is obviously worst at the corners, where it equals 2/(cos(length/2)*cos(width/2)+1).
Therefore, minimax distortion of the cylindrical projection is superior to that of the azimuthal projection when:
cos(width/2) > (cos(length/2)*cos(width/2)+1)/2
(2-cos(length/2)) * cos(width/2) > 1
width/2 < acos(1/(2-cos(length/2)))
Contrary to my expectations, this means that an aspect ratio of length/width>3/2 is enough to make the cylindrical projection superior for any region that fits in a hemisphere. For small regions, it is sufficient that length be very slightly greater than width. On the other hand, when length equals width exactly, the azimuthal projection is still always better.

Next, the conformal case (always normalized to minimum scale 1):
  • In a normal-aspect Mercator projection, the area distortion at a point is 1/cos(latitude)^2. The maximum area distortion is 1/cos(width/2)^2, while the total area distortion (i.e., the overall size of the normalized map) is 2*length*asinh(tan(width/2)).
  • In an equatorial-aspect stereographic projection, the area distortion at a point is 4/(1+cos(longitude)*cos(latitude))^2. The maximum area distortion is 4/(1+cos(length/2)*cos(width/2))^2, while the total area distortion is... hard to calculate.
Therefore, minimax distortion of the cylindrical projection is superior to that of the azimuthal projection when:
cos(width/2)^2 > (1+cos(length/2)*cos(width/2))^2 / 4
width/2 < acos(1/(2-cos(length/2)))
Same as before!

Average distortion of the cylindrical projection compared to that of the azimuthal projection is harder to compute, due to a messy integral. However, through numeric computation, I have determined that this metric is actually more favorable to Mercator than minimax distortion (Mercator is preferable by the average metric in all situations where it is preferable by the minimax metric). I really wasn't expecting this, since intuitively, a cylindrical projection has its worst distortion near the north and south bounds of the rectangle, along the "long" edges, while an azimuthal projection has its worst distortion along the east and west bounds of the rectangle, along the "short" edges, which you'd think would skew the average in favor of the azimuthal. Apparently not.

By the way, that messy integral is:
integrate(8 * (atan((sin(length/2)*sin(latitude))/(cos(length/2)+cos(latitude))) - cos(latitude)*sin(latitude)*sin(length/2)/(cos(latitude)*cos(length/2)+1)) / sin(latitude)^3 * cos(latitude), latitude, -width/2, +width/2);

...Now let's try some actual pictures.
portugal.png
portugal.png (53.08 KiB) Viewed 3068 times
The projection on the left is a normal-aspect equal-area cylindrical projection with standard parallel 39.68°. The projection in the middle is a transverse-aspect equal-area cylindrical projection with central meridian 7.88°W and standard parallel 0.89°. The projection on the right is an oblique-aspect azimuthal equal-area projection with center 7.88°W 39.56°N (this is not quite perfectly-centered, due to Cape St. Vincent, which isn't one of the extreme points considered). All three are normalized to have the same scale (which is part of the motivation for using the equal-area case, since it gives a concept of scale that can actually be normalized).

Unfortunately, this is the largest I can easily make these pictures, due to G.Projector not supporting a regional version of the cylindrical equal-area projection.

The non-rectangular meridians and parallels on the latter two projetions are quite obvious. Despite that, though, the projections look extremely similar, and I would have a hard time to argue for any of them being clearly better. In fact, the transverse and azimuthal projections are almost pixel-for-pixel identical, so the only real merit of one over the other is which you find easier to calculate. The fact that they're so similar indicates that this is probably as low-distortion as you can get. On the other hand, while the normal cylindrical projection looks pretty good to the eyes, its different graticule does show that it has a slight but meaningful amount of distortion.

Here is a drawing of all pixels where the azimuthal and transverse projections differ from each other by even 1/255th of an RGB value:
portugal-diffmap.png
portugal-diffmap.png (1.25 KiB) Viewed 3068 times
mapnerd2022
Posts: 165
Joined: Tue Dec 28, 2021 9:33 pm

Re: The best projection for Portugal?

Post by mapnerd2022 »

Thank you! I love your explanations, they're very easy to understand! I'm also a big fan of the work you have presented here so far!
Atarimaster
Posts: 446
Joined: Fri Nov 07, 2014 2:43 am

Re: The best projection for Portugal?

Post by Atarimaster »

Milo wrote: Fri Dec 02, 2022 11:46 am On further consideration, I appear to have underestimated cylindrical projections. (…)
Thank you for the detailed analysis! :)

Milo wrote: ...Now let's try some actual pictures.
(…)
The projection on the left is a normal-aspect equal-area cylindrical projection with standard parallel 39.68°. The projection in the middle is a transverse-aspect equal-area cylindrical projection with central meridian 7.88°W and standard parallel 0.89°. The projection on the right is an oblique-aspect azimuthal equal-area projection with center 7.88°W 39.56°N
Allow me to add two pictures.
The same projections, in the same order, same aspects, but with isolines of maximum angular distortions.
On the normal-aspect equal-area cylindrical projection, the lines mark values of 1°, 2°, 3° and 4° (green, blue, orange, red, respectively).
On the two other however, I had to set the values to 0.01°, 0.02°, 0.03° and 0.04° in order to get any lines at all.
The lavender-colored line marks the 7.88°W meridian.
portugal-projections-1.png
portugal-projections-1.png (196.72 KiB) Viewed 3057 times


Purely mathematically speaking, the transverse cylindrical beats the azimuthal projection.
But they are indeed “almost pixel-for-pixel identical”, as you pointed out; so it actually doesn’t matter which of them you coose (unless distortion minimazation is the stated goal of the map). That’s why I only used one of them for the second image, which is the transverse cylindrical (green lines) layered over the normal-aspect cylindrical (red):
portugal-projections-2.png
portugal-projections-2.png (68.03 KiB) Viewed 3057 times


Personally, I don’t think that straight meridians and parallels make the map more intuitive to read. Admittedly, I may think that because I’ve been looking at maps in atlases since I was a kid, so slightly converging meridians and softly curved parallels on local maps seem absolutely “normal” to me, and I might even be confused it they are straight. :lol:
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: The best projection for Portugal?

Post by Milo »

In a quick back-of-the-envelope calculation, I've found that an oblique azimuthal projection should produce errors of less than a pixel for even a full-screen map when the region being mapped has a diameter of less than 8° or so. This is an area of approximately 0.122% of the sphere. Coincidentally, the largest real-life country that has an area smaller than this is Ukraine (even when counting the contested territory from the current war...), although because it isn't perfectly circular, it still fails the diameter criterion.

A (possibly-oblique) cylindrical projection achieves the same maximum error when for a region with a width of at most 5.656° or so. This can reach an area of approximately 4.934% of the sphere if you're using the whole great-circle strip, but, of course, you're probably not.

So azimuthal projections at least are good for small regions when you don't want to worry about exactly how to align your main axis. Portugal is nearly vertical (though with a very slight southwest-to-northeast tilt), but other countries would work better with an oblique cylindrical projection than a transverse one...

If you want to stick to normal aspects, you could also try a sinusoidal projection, which, like transverse cylindrical projections, is distortion-free on the central meridian. However, distortion rises faster than the transverse cylindrical away from the central meridian.
portugal-sinusoidal.png
portugal-sinusoidal.png (38.36 KiB) Viewed 3055 times
Distortion is pretty minor, but unlike the azimuthal, it's not completely ignorable. Some things do bend slightly.

Another consideration if you really want to minimize error is that Earth is an ellipsoid, not a sphere. The simplest way to project an ellipsoid in a way that still perfectly preserves areas or angles is to first convert it to a sphere using the appropriate coordinate system, then perform a spherical projection in that coordinate system. This, however, may induce errors that a projection designed to be ellipsoid-aware from the ground up would avoid. Ellipsoid-aware versions of some projections exist, but for many other projections they do not, so choosing a projection that you know the ellipsoidal version of could be useful.

(Geographic coordinates are conventionally given using geodetic latitude, but this is actually the least useful convention for mapmaking, with absolutely no map projection properties, whether conformal, equal-area, compromise, or even orthographic or gnomonic, benefiting from using it. In particular, parametric latitude, which is ideal for orthographic projections, is still less bad than geodetic latitude for any other map type as well, in addition to being easiest to convert to or from three-dimensional Euclidean coordinates. Presumably the reason this convention got started is that geodetic latitude is the easiest to actually measure using traditional celestial navigation techniques.)

As some examples on Wikipedia show, ellipsoid-aware transverse cylindrical projections wouldn't actually be rectangular, not that this matters for a regional projection. Oblique cylindrical projections aren't mentioned, but you could probably derive them using the same techniques. I'm sure ellipsoid-aware azimuthal projections exist as well, it can't be that hard.
Post Reply