stamen / terrain-classic

World-wide CartoCSS port of Stamen's classic terrain style
ISC License
144 stars 35 forks source link

Shaded Relief Inconsistencies & Artifacts #74

Open geoglrb opened 8 years ago

geoglrb commented 8 years ago

Apologies if this is irrelevant, but...

screen shot 2016-07-11 at 2 04 38 pm
geoglrb commented 8 years ago

Probably a different issue, but notice building-esque artifacts:

screen shot 2016-07-11 at 2 11 31 pm

And that said, maybe it's not just HK...

screen shot 2016-07-11 at 2 12 35 pm
hyperknot commented 8 years ago

If you are talking about the strong grid-like shading of terrains, it is really visible here: http://maps.stamen.com/terrain/beta/#15/47.6879/18.8744

screen shot 2016-07-12 at 00 10 10
geoglrb commented 8 years ago

Yes, true. Thanks!

It strikes me that there could be three different things going on in the images above, of which that is at least one. Not being enough of a mapnik-er/CartoCSS-er, I don't know if this is 0-3 issues (!).

mojodna commented 8 years ago

There are a few things going on here, none of which we have a whole lot of control over:

https://github.com/mapzen/joerd may be a better place to track these issues if we can confirm that they're inherent to the source data.

mojodna commented 8 years ago

Actually, the banding could be the result of the resampling method that Mapzen is using:

http://openterrain.tumblr.com/post/109437899736/the-effects-of-various-resampling-algorithms-on http://openterrain.tumblr.com/post/109435441421/hillshades-generated-from-resampled-srtm-dems http://openterrain.tumblr.com/post/109434986656/resampled-srtm-dems-reprojected-from-wgs84-to-web

Summary (from the first link):

Artifacts aren’t visible when looking at the reprojected DEMs, but notice how the image shifts around slightly when in slideshow mode (all images were taken of the same bounding box at thne same resolution, excepting the zoomed in versions).

The story is quite different when looking at the resulting hillshades. Horizontal and vertical artifacts become quite apparent (along with pixel shift) with methods other than bilinear and cubic. Of these, bilinear has a slight edge (to my eye), as it produces transitions that are less abrupt. You can see the difference in the 2 zoomed images.

mojodna commented 8 years ago

Joerd appears to use nearest neighbor resampling (the default): https://github.com/mapzen/joerd/blob/b590a175fb2f07781ef36bf485117aad6f3e206e/joerd/composite.py#L42-L43

https://github.com/OSGeo/gdal/blob/08b04169ecacc86d1f4c1532e30241cb96c0036d/gdal/swig/python/osgeo/gdal.py#L2589-L2597

hyperknot commented 8 years ago

I can confirm that Mapzen terrain map has the exact same terrain interpolation artefacts: https://tangrams.github.io/walkabout-style-more-labels/#14.84659/47.6803/18.8767

screen shot 2016-07-16 at 17 57 26