Coastline generalization
Coastlines are a peculiar feature in maps – while other elements of nature are occasionally omitted depending on the purpose of the map the distinction of land and water is nearly always displayed. Coastlines are also the feature where the fractal scale independent characteristics of geographic forms has been first observed and analyzed – in Benoît Mandelbrot's well known paper. This makes them a particularly important and at the same time difficult feature to show in maps.
The following images show some examples of coast line renderings in current web map services featuring the Aegean Sea which has a particularly complex and recognizable coastline. What all these maps have in common is that the shape of the coastline is not so well visible. This is partly because it is obscured by labels but mostly because of the way the coastline itself is rendered.
Google maps (terrain mode) | Bing maps | Nokia here.net |
Openstreetmap | Openstreetmap transport map | Geofabrik topo |
What most of these maps have in common (except for the last two) is that the coastline is not rendered as a line but is just the edge between the land and water areas shown in different colors. The last two draw a distinct coastline but it is very thin and therefore hardly visible.
One could assume that this is primarily done to avoid obscuring other map elements considered more important for the purpose of the map with a strongly visible coastline. But there is also another reason.
What these maps do is essentially coloring all pixels on one side of the coastline in the water color and those on the other side in the land color. What you get when you do that is shown in the first image below. This is deliberately rendered with fairly low contrast to be comparable to the web map samples above. A somewhat different result can be obtained when the land water mask is first generated at higher resolution and then scaled down – a technique commonly called supersampling. The second image below is generated using this – edges are a bit less contrasty but overall this results in a cleaner appearance. The contrast can be enhanced by appropriate filtering. Overall these two images are very similar to how the land/water mask is drawn in the web maps.
What happens when you draw a coastline in addition is shown in the third image. Although the coastline is strongly emphasized the overall appearance is not any clearer.
plain land water mask | land water mask supersampled | with coastline based on original data |
The phenomenon that makes all these maps quite unclear and noisy is called aliasing. The low resolution image used to display the map cannot reproduce the fine detail in the coastline data. But instead of simply dropping all this fine detail the drawing method produces various kinds of artefacts from the high frequency components in the data. Supersampling reduced the aliasing so the second image has the least artefacts. This is also more or less the method used in all the web maps.
Aliasing can be a problem with all kinds of map features but coastlines are particularly prone here due to their fractal nature i have mentioned in the introduction. Since all these maps also offer much higher resolution views the coastline data used is very detailed – unlike other map features like roads which tend to be completely smooth beyond a certain magnification.
Scale dependent simplification
But there is a reliable way these aliasing artefacts can be avoided: by eliminating the high frequency components from the data before drawing the map. This is not a new idea, in fact this is a major part of what is called cartographic generalization. The purpose of simplification in map generalization is to eliminate small detail from the map that cannot be properly displayed and thereby improve readability of those features that are shown. This has the side effect of also avoiding aliasing artefacts.
Apart from plain simplification generalization also has another important purpose in the case of coastlines, namely to ensure key features of the coast are properly shown in the map. This actually requires moving the coastline and making it less accurate in some cases. All the web maps shown for example have troubles properly rendering the straits between the Black Sea and the Mediterranean Sea. Google maps and Openstreetmap are worst here by not showing the Bosphorus at all. When an explicit coastline is drawn the straits are visible but for proper display straits would have to be drawn wide enough for both coasts not touching and narrow land bridges on the other hand need to be shown wide enough so the coastlines do not touch on the land.
Below you can see a sequence of coastline renderings at different scales with data generalized according to the requirements described. You can click on the images to show them rendered at twice the size.
Now there are no fixed rules of how to generate such a generalized coastline. There are a lot of subjective decisions involved. Take for example the small islands. If an island is smaller than a certain threshold with respect to the map's target scale it cannot be displayed in the map. One can simply remove all islands below this threshold or one could enlarge the largest of them to be large enough to be shown. Another approach is to coalesce small islands to display them in summary. One could also argue that an island with a high mountain should have a higher priority to be shown than a flat one.
Getting back to the web maps shown as examples above. Most likely most of them do not use explicit generalization of the coastline data. Instead they rely on the implicit simplification of drawing to a low resolution image which results in the aliasing effects discussed. The Bing and here.net map have a better display of the Turkish Straits although this is probably achieved through some filtering in the drawing process rather than generalization of the data. The last two maps which draw a coastline are different since they do use a generalized coastline at these low magnification. Natural Earth offers three different levels of coastline data which have been manually generalized. These maps use the highest resolution version which is slightly more detailed than the map resolution at this scale which does only result in very minor artefacts. This allows for a much better drawing of the coast as a line than based on higher resolution data but the enlargement of narrow features is not enough for this scale. Below you can see renderings of the two coarser levels of generalization of this data set at approximately their target scale.
Natural Earth coastline 50m | Natural Earth coastline 110m |
The reason why most web maps do not show a generalized coastline is not only the work of performing the generalization for each of the viewing scales. Since generalization involves moving the coastline in some cases other map features would need to be moved as well. Especially for Openstreetmap were data is subject to constant modifications this would be much more challenging than it first appears when you just consider the coastline on its own.
Sample data
Here you can download a sample data set for a generalized whole earth coastline based on Openstreetmap data (and NSIDC data for Antarctica) for zoomlevel 6 in a web map with spherical Mercator projection. This is a similar level of detail as the Natural Earth 10m data set. Data for current version 2 is from Jan 09, 2013. The coastlines are represented in the form of land polygons and these are split into 16 tiles.
These files are made available under the Creative Commons Attribution-ShareAlike 3.0 license. Data source is © OpenStreetMap contributors and NSIDC. Some might wonder why these are not licensed under ODBL like the original OSM data - this is because the generalized coastlines are a rendering of the data and it is neither intended nor possible to extract the actual coastline data from it. Therefore it is a produced work in terms of the ODBL.
- coastline_gen6.zip (9 MB) zipped shapefile with land polygons (version 2)
Demonstration map
Based on this data i also produced a demonstration map showing how the generalization changes depending on the scale of the map.
Christoph Hormann, December 2012
Visitor comments:
By submitting your comment you agree to the privacy policy and agree to the information you provide (except for the email address) to be published on this website.