der-stefan / OpenTopoMap

A topographic map from OpenStreetMap and SRTM data
https://opentopomap.org
Other
471 stars 119 forks source link

adaptive contours distance #35

Open mboeringa opened 8 years ago

mboeringa commented 8 years ago

Hi,

I really like the OpenTopoMap style for OpenStreetMap data. However, I recently came across TopoMapCreator (http://sourceforge.net/p/topomapcreator/wiki/Home/), which uses OpenTopoMap's style as its main style for creating image based topographic maps.

Looking at a few of the examples, and comparing them with the OpenTopoMap map rendering, it strikes me TopoMapCreator has a better balance and overall look of contours and hillshading. The contours are slightly less saturated red / brown, also set a bit less dense, and the hillshading is more subdued, and thus more pleasing. Additionally, the halos of the labels of the contours in OpenTopoMap don't seem to work well on darker hillshaded areas, the text becomes illegible.

Of course, the TopoMapCreator results aren't entirely comparable, as they use a different colouring for e.g. the forests, but it still is very similar.

I know this is a real balancing act, which isn't easy for this type of data and combined contour & hillshading, but overall I think TopoMapCreator's rendering wins out here. Maybe an idea for OpenTopoMap to tune some of these settings?

See the attached images: OpenTopoMap: mont_blanc_opentopomap

TopoMapCreator: mont_blanc_topomapcreator

der-stefan commented 8 years ago

OpenTopoMap is optimized for average mountain areas, not for high mountain areas. An adaptive contour distance would be a good solution for different areas. But as I don't know how to do that, we will leave it as it is.

mboeringa commented 8 years ago

I understand, this is difficult enough. I fully agree a single contour interval can never give satisfactory results across the entire range of flat land up to high mountains. Since your OpenTopoMap originates in Germany, I appreciate the focus on optimal results there.

der-stefan commented 8 years ago

Perhaps someone can help us with this issue. We need a script that deletes all contour lines that are too close to each other. By the way: We need to find a solution quite soon. Right now we have a 1.1 TB SSD with the contours and the OSM database and are FULL now. The contours database must be reduced.

mboeringa commented 8 years ago

Perhaps someone can help us with this issue. We need a script that deletes all contour lines that are too close to each other.

@der-stefan : this is not a direct solution for you, but it may help develop a similar approach for OpenTopoMap. Here at two interesting links:

The first is a description I found on GIS StackExchange using ArcGIS, but the method could well be applied in another GIS like QGIS or one of its sub-packages. It describes a method involving slope calculation on a raster to selectively distinguish steep and low gradient areas, to use as the basis for distinguish areas requiring different contour settings.

The author actually does not use the method to weed out contours in high gradient / steep slope areas, but only uses it to adjust contour line width. The basic method would be the same though if you would like to selectively remove certain contour intervals for high gradient areas.

Of course, these type of solutions will lead to contour discontinuities in the transition zones, but I think that may well be a price worth paying:

http://gis.stackexchange.com/questions/145151/contour-line-density-thinning

The second link is an ESRI PDF regarding contour generation from a DEM:

http://downloads2.esri.com/MappingCenter2007/resources/publications/Frye_ProducingCartographicContoursFromElevationModelsInArcGIS.pdf

It is a much more detailed description of contour generation than most that I have seen that usually stop at saying "Run the Contour command"... At the end, it describes a pretty much similar method as the one posted on GIS StackExchange.

It would definitely be worth to generalize the contours, and to possibly cut them up in small sections, before attempting to do this type of geoprocessing on a global scale. But you probably have that already in your current contour creation workflow...

der-stefan commented 8 years ago

@mboeringa Thank you very much for your long post. My idea of thinning out the contour lines is to define some areas as a polygon, cut all contour lines at the points where they intersect and then throw away contours lines that are within the polygon. The difficult point is, I just don't know how to process that polygons technically. I don't have the knowledge and ability to do that.

der-stefan commented 6 years ago

Contour line labes are now rotated correctly: hoehenlinien

imagico commented 6 years ago

For some version of 'correctly'.

The classic German topographic map did not universally use topographically oriented contour labels (though in many sheets it indeed did). Eduard Imhof is known to have preferred the correct reading orientation and the Swiss tradition is universally using that. Both German and French maps traditionally vary in that regard. Spanish and USGS maps use correct reading orientation while the British tradition tends to prefer topographic orientation.

Most print maps i know of that use topographically oriented contour labels also use an avoidance strategy to preferably label contours in correct reading orientation even with the topographic orientation rule.

Personally i also find it kind of annoying to read labels like '06' '09' or '08' on contours when they are printed in a font that does not communicate the upside down orientation.

So overall a valid design choice but i would not call it correct orientation as opposed to incorrect.

mboeringa commented 6 years ago

@imagico Nice info about the different perspectives and the (historic) approaches of national mapping agencies.