Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landcover recolour #599

Merged
merged 6 commits into from
Jun 9, 2014
Merged

Conversation

pnorman
Copy link
Collaborator

@pnorman pnorman commented Jun 3, 2014

While working on #565 I realized that the landuse colours are generally without reason. As some examples

  • Lightness is all over the place
  • Of the "base" landuses only landuse=retail has a border, but it's strong-red, only it's got a width of 0.3 so you don't realize it.
  • landuse=retail is more closely related to shop POIs than landuse=commercial, but landuse=commercial has a colour more similar to the shop colours

As a background, you can work in several different colour systems when picking colours. The best ones to work in are perceptual colour systems like CIELAB, CIELUV, and the angular variants. Unfortunately carto does not support these systems, so you need to convert to/from them. Fortunately, there are websites that will do that for you, and websites with colour pickers.

This pull request adjusts the colours for residential, retail, commercial, industrial/railway, farm/farmland, and farmyard. Exact details in the commits.

I've placed a demo up at http://bl.ocks.org/pnorman/raw/f1b113ca40658de27405. Coverage is British Columbia, Washington, Northeast US, Tokyo, and Krakow.

Vancouver has all of the adjusted landuse within it, and one good example is in New Westminster, where there are Residential, Commercial, Retail and Industrial landuses near each other: http://bl.ocks.org/pnorman/raw/f1b113ca40658de27405/#16.00/49.2/-122.92

Industrial
image

Retail/Commercial (New to the right, Riverside Plaza is Retail, Riverside Business Center is Commercial)
image

Retail/Commercial
image

Residential
image

Residential
image

Low-zoom Industrial
image

Farms
image

Many farm fields
image

Low-zoom farms
image

pnorman added 2 commits June 1, 2014 13:38
"Base" landuse colours have some issues and are generally without a great deal of reason. As some examples

* Lightness is all over the place
* Of the "base" landuses only ``landuse=retail`` has a border, but it's strong-red, only it's got a width of 0.3 so you don't realize it.
* ``landuse=retail`` is more closely related to shop POIs than ``landuse=commercial``, but ``landuse=commercial`` has a colour more similar to the shop colours

A few things are done here

* Split out "base" solid landuse colours of residential, retail, commercial, industrial/railway, and farm/farmland.
* Gives them all the same lightness of 89. This is about the same as residential and retail were, and lightens the others, particularly commercial and industrial.
  * This basically flips retail and commercial in some ways. I looked at keeping them more the same, but I kept on tending to this, so decided to do it this way so that there was a colour difference between them
* Adjusts chromas
* Moves the industrial hue farther away from red. This is necessary with such light colours to allow it to be distinct from commercial while commercial is distinct from both retail and residential.
* Adds light lines to the ones missing them, consistent with current retail, school/university/college/hospital/kindergarten and most more POI-like landcover styles
  * Retail centres, industrial parks, residential development and commercial areas may all be named, and with a name is useful to have a border to indicate what size area the name applies to.
  * It aids in showing the limits between railway usage and adjacent industrial usage
  * Farm fields can be individually mapped, and the lines can be useful there, and those areas are typically low-clutter
  * The effect is intentionally fairly subtle
* Widened existing lines around retail, but still under 1 pixel. This helps with antialiasing artefacts. I didn't go all the way to 1, because I found that looked worse where there were two adjacent landuses of the same type.

It is possible to compute the difference between colours, either by transforming to Luv and using Euclidean distance, or [calculating directly in Lch](https://en.wikipedia.org/wiki/LCH_color_space#Color_and_hue_difference)

```
         Res.  Retail  Comm.  Ind.   Farml.
Farml.   12.0    12.4   10.0  17.3      0
Ind.      9.0    13.9    8.1   0
Comm.     8.5    7.6     0
Retail   16.0    0
Res.      0
```
Although not quite a "base" landuse in the same way farmland is, it's
worth handling at the same time to keep it in harmony with farmland.
@systemed
Copy link
Contributor

systemed commented Jun 3, 2014

Great improvement.

@matkoniecz
Copy link
Contributor

I like changes, but I would make farmland even more paler.

Borders on landuse=railway are rather poor idea - as it requires either continent-sized multipolygons or ugly rendering somewhere: see http://bl.ocks.org/pnorman/raw/f1b113ca40658de27405/#18.00/50.08300/19.88916

Maybe landuses railway and industrial may differ a bit?

In general, I am unsure about whatever borders are a good idea, in many places there is no definite divide between landuses.

Why garages landuses have no border unlike everything else?

@dieterdreist
Copy link

generally the changes make the situation much better, in detail:

  • industrial: don't like the new "pink" (might cause confusion with tourist
    attractions as well), better the old tone, maybe lighter or the new one
    even less saturated
  • retail / commercial: +1
  • residential: new tone is better, but outline might cause confusion about
    the presence of fences (barrier=fence looks similar)
  • farms +1, outline is a great improvement

@mrwojo
Copy link
Contributor

mrwojo commented Jun 3, 2014

👍 overall.

@desert and @construction could use some treatment. They're probably the greatest outliers in terms of fill darkness/saturation. Desert vs. farmland: Fallon, Nevada. Construction vs. buildings: Seattle. Also, a single range of hues represents farms, deserts, and allotments. "One of these things is not like the others." Maybe move deserts a little closer to a lighter yellow? Not necessary for this PR, just something to keep in mind.

I'd've gone the other direction with the borders by dropping them from retail. Borders should be reserved for where there's a sense of a single identifiable feature, which is often not the case with landuses. Perhaps make the border dependent on identifying tags like name=*? That's a pattern I see in mapping: retail (no name) = group of shops, retail w/name = mall; residential (no name) = group of houses, residential w/name = housing development/complex. Also, borders can visually compete with our other "thin line" features (barriers and power lines at least).

@matkoniecz
Copy link
Contributor

I would also prefer dropping borders (in fact I suggested it in #333).

Current desert colour is really heavy and aggressive - see for example http://www.openstreetmap.org/?mlat=39.6344&mlon=-118.4687#map=12/39.6344/-118.4687

@pnorman
Copy link
Collaborator Author

pnorman commented Jun 3, 2014

  • industrial: don't like the new "pink" (might cause confusion with tourist
    attractions as well), better the old tone, maybe lighter or the new one
    even less saturated

The old hue was even pinker image. The left colour is the the one in this PR, the right one is the same hue as the old colour and the same lightness and chroma as the new one.

I can't push the saturation any lower, then the industrial to commercial distance becomes too low.

I could easily move the hue even farther away from pink, going for something like image.

On the other hand, if we're going to use blue for office=*, perhaps landuse=commercial should occupy this part of the hue spectrum?

image
(L=89,c=7, marker at 330)

For reference, the hues are

               Old   New (target, pre-RGB rounding)
retail        19.9    30
retail-line  333.4    30
commercial    20.5    25
industrial   352.6   330
farm          82.9    80
farmyard      80.9    80

@pnorman
Copy link
Collaborator Author

pnorman commented Jun 3, 2014

@desert and @construction could use some treatment

I agree, but out of scope for this PR.

Why garages landuses have no border unlike everything else?

Garages are unchanged.

@pnorman
Copy link
Collaborator Author

pnorman commented Jun 3, 2014

  • residential: new tone is better, but outline might cause confusion about
    the presence of fences (barrier=fence looks similar)

Also, borders can visually compete with our other "thin line" features (barriers and power lines at least)

I agree in principle that borders could cause confusion, but looking at a residential area, I don't see is as a practical issue. The borders are just so much lighter.

image

However, looking at it, I think I need to push down the start of all borders to z16, that's when we start rendering "high-zoom" features like building borders, and at z15 it could be confused.

I'll also try lightening them all, from 75 to ~80, or perhaps width adjustments, or lightening plus more chroma increases.

I do feel borders serve a use, and are essential for malls and residential developments, as for example
image

Perhaps make the border dependent on identifying tags like name=*? That's a pattern I see in mapping: retail (no name) = group of shops, retail w/name = mall; residential (no name) = group of houses, residential w/name = housing development/complex.

I thought about this. I'm not sure, I'd like to encourage splitting on these types of features even if the name isn't known.

Borders on landuse=railway are rather poor idea - as it requires either continent-sized multipolygons or ugly rendering somewhere:

Good point, railway polygons are more likely to be arbitrarily split than industrial ones, which tend to be limited in size by roads or other features. I'd like to keep an indication of industrial/railway boundaries, so perhaps outlining only on named railway areas (e.g. yards) would work.

@pnorman pnorman mentioned this pull request Jun 3, 2014
pnorman added a commit to osm-ca/mapproxy-config-faramir that referenced this pull request Jun 3, 2014
pnorman added 3 commits June 3, 2014 19:51
Carto did this before when preprocessing, but doing it explicitly makes it easier to make later changes to one but not the other
Railway landuse can span wide areas and sometimes needs to be broken up at
arbitrary places, similar to rivers.

Faint outlines are maintained on named railway landuse, which is typically yards
@pnorman
Copy link
Collaborator Author

pnorman commented Jun 4, 2014

I did some work on the outlines and refreshed my demo with 084d9a4. Cache is empty so initial loads may be slow!

The railway issue is gone (no image, as there's nothing to see) as I'm only putting an outline on named railway landuses.

The other landuse outlines are the same if named, and lighter if unnamed.

I've pushed the outline rendering down to z16+, which is when fences, minor_lines, bushes and such appear.
image

image

image

I feel these changes fix fence confusion.

The industrial colour concerns mentioned in #599 (comment) are unchanged. I'm not sure that there's an issue or risk of confusion. The colours involved are image

Going farther into purple for either industrial or commercial remains an option. Reducing chroma is not an option - it will become too close to residential then.

@matkoniecz
Copy link
Contributor

I like new industrial colour, but that is just personal opinion. Is it intentional that in pnorman@596dba6 colour of railway landuse fill is unchanged?

I am still not a fan of borders on any unnamed landuses, but overall changes are a great improvement.

@pnorman
Copy link
Collaborator Author

pnorman commented Jun 4, 2014

Is it intentional that in pnorman/openstreetmap-carto@596dba6 colour of railway landuse fill is unchanged?

Yes - there's no colour changes here. I might give it a separate variable name for ease in customization

This makes customization easier and makes it clear that it's intentional
that it's the same colour as industrial.

The same is not done for farm/farmland because it is unlikely that anyone would want to differentiate between those two tags as they mean the same thing.
@pnorman
Copy link
Collaborator Author

pnorman commented Jun 4, 2014

@gravitystorm Thoughts on the industrial colour? I'm happy with the rest of this PR

Also, I want to take on some of the other bad colouring (e.g. desert and construction, as raised here). Do you think it should be in a follow-up pull request?

@dieterdreist
Copy link

2014-06-04 5:29 GMT+02:00 Paul Norman [email protected]:

I did some work on the outlines and refreshed my demo with 084d9a4
084d9a4
.

thank you, very nice!

@daganzdaanda
Copy link

I like all of it a lot!
PS: If you take on desert and construction, maybe also leisure=sports_centre? Or stick with the landuse tags first?

@matthijsmelissen
Copy link
Collaborator

This looks overall like an improvement.

I have the impression that the retail colour is too bright. What do others think?

@pnorman
Copy link
Collaborator Author

pnorman commented Jun 8, 2014

retail colour is too bright

It has more colour (chroma).

Edit:

To expand on the matter, to reduce the retail chroma would require adjusting the commercial hue to keep them distinct. This would then require the same from industrial, pushing it farther into purple. Which I'd be okay with, but it's important to be aware that reducing retail chroma will do that.

@vholten
Copy link
Contributor

vholten commented Jun 8, 2014

I also think that retail would look better with less chroma. @pnorman, maybe you could make the changes you described and show a screenshot?

@pnorman
Copy link
Collaborator Author

pnorman commented Jun 8, 2014

I also think that retail would look better with less chroma. @pnorman, maybe you could make the changes you described and show a screenshot?

@residential: #E1E1E1;      // Lch(89,0,0)
@residential-line: #B9B9B9; // Lch(75,0,0)
@retail: #F4DAD6;           // Lch(89,10,30)
@retail-line: #DFADA7;      // Lch(75,20,30)
@commercial: #F0DAE5;       // Lch(89,10,345)
@commercial-line: #D8ADC3;  // Lch(75,20,345)
@industrial: #E2DDF0;       // Lch(89,10,300)
@industrial-line: #BCB4D8;  // Lch(75,20,300)
@railway: @industrial;
@railway-line: @industrial-line;

image

Industrial on the left, commercial in the middle, retail on the right.

Note: After CIE-Lch to sRGB conversion, the values get rounded to the nearest integer (256th of 100%). In the case of industrial, it results in the chroma being 10.1 and the others are 9.8. If we're okay with this general look, I might slightly tweak the values to get better post-conversion agreement.

@gravitystorm gravitystorm merged commit c16701d into gravitystorm:master Jun 9, 2014
@gravitystorm
Copy link
Owner

All looks great to me, so I've merged this in. Feel free to open further pull requests to tweak colours or tackle additional ones as you see fit.

@gravitystorm
Copy link
Owner

daf5b39

@matthijsmelissen
Copy link
Collaborator

Note that the rendering algorithm for outlines in Mapnik is quite counterintuitive. I gave forest a 2px red outline and grassland a 2px blue outline with the following result:

screenshot_2017-05-27_23-57-39

It seems most of the outline is rendered on the outside of polygons, with the exception of a sliver of less than a pixel (this might have to do with the gamma setting). That means that with outlines of at least a pixel, in the case of two adjacent polygons, only the polygon that is drawn second is drawn with outline. If the second drawn polygon doesn't have an outline, the size of the outline is restricted to less than a pixel.

CC @pnorman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants