stamen / terrain-classic

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

fade out landcover colors at high zooms #41

Closed almccon closed 8 years ago

almccon commented 8 years ago

After #23 I think the landcover is looking really good at low zooms.

screen shot 2015-10-22 at 5 28 15 pm

But when you reach the city scale, the colors are way too harsh.

screen shot 2015-10-22 at 5 29 07 pm

I'm not exactly sure how I'm going to fix this, but I've got some ideas.

almccon commented 8 years ago

It looks like the landcover in the currently-deployed Terrain starts getting lighter as early as zoom 8!

almccon commented 8 years ago

d507142 helps a lot.

screen shot 2015-10-22 at 6 31 57 pm

Although I'm disappointed to lose so much of the white background in urban areas. Ideally, the map would converge to white in urban areas, and some neutral brown/green color in non-urban areas. Perhaps if I bring in a blurred-out version of Natural Earth urban areas I can achieve that effect...

almccon commented 8 years ago

Here's what ne_10m_urban_areas looks like at 100% opacity, no blur. It's promising raw material to work with:

screen shot 2015-10-22 at 22 oct 8 05 51
almccon commented 8 years ago

On second thought, it kinda sucks:

screen shot 2015-10-22 at 22 oct 8 21 18

Even applying a huge stroke and a huge blur, it doesn't really work.

screen shot 2015-10-22 at 22 oct 8 22 39

Maybe we can find a better dataset for urban areas?

clhenrick commented 8 years ago

The blur and stroke don't look that bad. Also isn't there 2 urban data sets from natural earth? I think one might be more high res.

On Thursday, October 22, 2015, Alan McConchie notifications@github.com wrote:

On second thought, it kinda sucks: [image: screen shot 2015-10-22 at 22 oct 8 21 18] https://cloud.githubusercontent.com/assets/1212178/10683781/8586c600-78fa-11e5-8d29-2f99fb2ddd9b.png

Even applying a huge stroke and a huge blur, it doesn't really work.

[image: screen shot 2015-10-22 at 22 oct 8 22 39] https://cloud.githubusercontent.com/assets/1212178/10683793/ab44c072-78fa-11e5-8dc5-4de17a29934f.png

Maybe we can find a better dataset for urban areas?

— Reply to this email directly or view it on GitHub https://github.com/stamen/terrain-classic/issues/41#issuecomment-150447725 .

-Chris L Henrick

MFA, Design & Technology Parsons, The New School For Design

http://chrishenrick.com Github: @clhenrick https://github.com/clhenrick Twitter: @chrislhenrick https://twitter.com/chrislhenrick

“Whenever I see an adult on a bicycle, I no longer despair for the future of the human race.” — H.G. Wells

clhenrick commented 8 years ago

@almccon what about creating a 4th lc500mMODIS layer that only contains values for urban areas? That way we could keep the opacity cranked up for urban areas at higher zoom levels.

clhenrick commented 8 years ago

This would mean pulling out all pixels = 13 for the new raster.

almccon commented 8 years ago

Interesting idea, @clhenrick. I was thinking something similar, like grabbing the higher-resolution landcover for North America (in use for OG Terrain) and just pulling the urban areas.

Also, I see that Natural Earth has a reference to a higher-resolution landcover that was released more recently... so I'm going down this rabbithole: http://iopscience.iop.org/article/10.1088/1748-9326/4/4/044003/fulltext/;jsessionid=8F3F52D64ACE430A9408B513147AAC35.c3.iopscience.cld.iop.org

Oh, and one more thing I need to add: pull some of the landcover polygons from OSM (like landcover=residential, landcover=industrial, etc...) and color them white, too. Those landcovers aren't mapped everywhere in OSM, but they're pretty good in some parts of the world.

almccon commented 8 years ago

It looks like the higher-resolution landcover referred to in that article is the 500m MODIS we're already using in the raster. So I think your idea of the urban-only raster layer will do the same thing. Trying that now...

clhenrick commented 8 years ago

@almccon cool, seems like gdal_polygonize.py could be used to extract the urban areas from landcover raster, see this gis stackexchange post

almccon commented 8 years ago

I don't really need to polygonize, if I'm already using a raster for the other landcover, I can just use a raster for these urban areas, too.

But here are some experiments with blurring the landuse from OSM: I used red for testing so I can see where I'm getting OSM data vs from the landuse raster:

screen shot 2015-10-23 at 5 45 48 pm

And here it is with a bit of blur: screen shot 2015-10-23 at 5 56 27 pm screen shot 2015-10-23 at 5 56 03 pm

And finally if I make it white:

screen shot 2015-10-23 at 6 00 24 pm

I think that helps get urban landuse under a lot of neighborhoods that need it. I wish we had more landuse tagging in OSM, but this will provide more motivation for that!

almccon commented 8 years ago

Added in dd7ecf294d8057c1b718a487a6e4d5930fc07184.

@clhenrick @mojodna be aware that this adds a new table in imposm, so you have to re-run your database creation in order to get this fix. :(

clhenrick commented 8 years ago

@almccon cool, do you think combining the OSM urban landcover with the NE urban areas might work? I've been trying to pull out just the urban areas from the MODIS data and haven't been successful just yet.

almccon commented 8 years ago

Yeah, right now I'm using both. The more the merrier.

On Oct 23, 2015, at 19:13, Chris Henrick notifications@github.com wrote:

@almccon cool, do you think combining the OSM urban landcover with the NE urban areas might work? I've been trying to pull out just the urban areas from the MODIS data and haven't been successful just yet.

— Reply to this email directly or view it on GitHub.

clhenrick commented 8 years ago

:+1:

clhenrick commented 8 years ago

@almccon I altered the color of the osm urban areas to be 7% K to match the MODIS urban area RGB value. Think we are reserving 0%K / white for snow & ice correct? Feel free to change it back if you think white looks better for urban.

almccon commented 8 years ago

Good idea, I think matching the off-white of the landcover is the right thing to do.

almccon commented 8 years ago

I'm going to leave this open until we test it out in more parts of the world. I'm particularly curious other US cities where there is patchy landuse data in OSM, but also European cities that probably have very good landuse. I was pretty aggressive in https://github.com/stamen/terrain-classic/blob/master/imposm3_mapping.json#L402-L417 grabbing any landuses that seemed remotely urban, but I'm not sure if it would result in too much white in well-mapped areas like Europe.

clhenrick commented 8 years ago

@almccon sounds good, I'll take a look at some European cities too. While working with an extract for Seattle I noticed an odd wavy band happening with the landcover data as well as some tile boundaries showing up, let me know if you are getting these too?

screen shot 2015-10-26 at 1 08 02 pm

screen shot 2015-10-26 at 1 34 24 pm

almccon commented 8 years ago

Whoa, trippy. I'll see if I can replicate.

almccon commented 8 years ago

I can't replicate that wavy band, but I can replicate the seams at tile boundaries. I'll look into what I can do about that.

clhenrick commented 8 years ago

I'm also noticing quite a jump in the way the colors are styled between zooms 8 & 9. Might be a combination of taking both opacity and blur from 0 to 0.7 and 20 respectively. I'll try adjusting it a little more subtler and seeing if it helps.

That's also when I start to notice the tile seams showing up: screen shot 2015-10-26 at 4 04 33 pm screen shot 2015-10-26 at 4 04 41 pm

almccon commented 8 years ago

I think it's zoom 9 where something especially strange is happening with the color. z10 seems to look more like zoom 8 again.

almccon commented 8 years ago

So I removed the blur, and it still looks okay. The raster-scaling:gaussian; line causes a bit of a blur anyway. You can still see the raster grid, but it's not unpleasant in my mind: screen shot 2015-10-27 at 5 54 18 pm

But supposedly we shouldn't be having that problem with the seams: https://www.mapbox.com/blog/tilemill-seamless-blur/

It may depend on the version of mapnik we're using?

almccon commented 8 years ago

Meanwhile, I figured out why zoom 9 started to look bluish. Turns out I wasn't turning on the "land" until zoom 10, so when we slowly added transparency to the landcover raster starting at zoom 8 and 9, we started to see the ocean show through. And then at z10 the yellowish land would appear in the background, causing a sudden hue change.

Now that's fixed... although I still am not totally happy with the gradual yellowing of all the background as we decrease opacity, but I think it's probably just something we have to live with.