OpenTopoMap icon indicating copy to clipboard operation
OpenTopoMap copied to clipboard

Water outlines

Open der-stefan opened this issue 7 years ago • 4 comments

Water area outlines should not be drawn between polygons of the same type. Example: https://opentopomap.org/#map=14/51.88499/4.29141

This is not so easy to fix: Water outlines are currently rendered on top of the polygons. If the outlines are rendered below the fill color, they would only be outside of them. In order to have the same line width, the outlines would have to increase, thereby increase the overall polygon size.

The same problem is with forest outlines.

der-stefan avatar Jan 01 '18 12:01 der-stefan

For clarification: outline

der-stefan avatar Jan 02 '18 19:01 der-stefan

First I must complement you on a great project! You have created a very beautiful and useful topographic map!

On my development instance of OTM, I removed the outlines of all water polygons to include the water ways. The result is pretty good.

screen shot 2018-03-25 at 10 15 49 pm

verses original https://www.opentopomap.org/#map=15/53.56720/-351.44485

bbnt avatar Mar 25 '18 20:03 bbnt

That looks fine, but it is not what we want: We want to have water outlines... I have no clue how to solve the problem of neighboring water polygons so far. Issue stays open.

der-stefan avatar Apr 03 '18 18:04 der-stefan

At least for vector tiles you can merge neighbouring geometries with st_union for a specific tile.

SELECT st_union(way) AS geom,
  FROM planet_osm_polygon
 WHERE way && !bbox!
   AND ("natural" = 'water' or landuse in ('reservoir', 'basin') or waterway = 'riverbank')

This merges all water polygons into one for the specific tile thus avoiding merging all water around the globe. I cannot see why this would not work for Mapnik/raster tiles. Two rivers (with separate waterway=riverbank polygon) meet here: paveikslas Downsides:

  • This slows down the query a little bit.
  • Resulting geometry includes ALL water polygons, not only the ones which touch each other.

tomass avatar Nov 18 '18 16:11 tomass