OpenStreetMap

Almost one year ago, I decided to take a crack at fixing something that bugged me in the way golf courses were rendered in carto. And now that fix – or what it evolved into – is finally merged and getting deployed!

If you look at the wiki page for leisure=golf_course, you’ll find a rich vocabulary for how to (micro)map many aspects of the layout: tees, holes, pins, bunkers, so on and so on. And in many of these tags, there’s an admonition: don’t tag for the renderer just to get these features to show up. Naturally, mappers will do what they want to do, and most fairways, greens, and bunkers have accompanying landuse=grass and natural=sand tags. In fact, in iD, creating a fairway, green, rough, or tee automatically adds landuse=grass to the tags. Likewise, bunkers add natural=sand.

This is useful for making a case that carto needs to render these tags, and that there’s a general agreement on what they should look like. After much back and forth and discussion in the PRs, a consensus emerged. golf=tee, fairway, driving_range, and rough would get the same fill color as landuse=grass. rough would also get a subtle pattern on top of its fill to highlight the different length of grass. The green would get a darker shade to differentiate it from the surrounding fairway, and so golf=green would get the same color as leisure=pitch. And golf=bunker would get a natural=sand color.

On top of that, agreement was reached on rendering golf=hole, a line that shows the playing path, along with a label of its ref or name. And finally, the actual location of the hole – golf=pin – would get an icon, labeled where applicable.

One final change was updating the fill of leisure=golf_course. The original green background was a single-use color. Carto is already a green-heavy color scheme, and the opportunity was taken to remove one shade, instead using the same color as campsites.

And so, as of carto 5.4.0, all of these details are now visible in the standard rendering. This can make a pretty big difference in how golf courses appear.

Sample rendering of a golf course, before and after

Sample rendering of a golf course, before and after

It’s not perfect, but in my eyes it’s a big improvement. One remaining criticism I have is that there’s not a lot of contrast between the new blue-green of a golf=green and the blue of a water hazard, so in some cases it can be difficult to discern the difference between where you’re putting and what you’re avoiding. But overall I’m very happy with the changes, and learned a lot about the considerations and thought process behind the colors and symbols in carto.

Follow up work would include getting iD to change its tag-suggestion behavior, and perhaps picking a new shade of leisure=pitch that’s a little bit further away from water. Of course, as I learned, even something as seemingly simple as changing some colors takes a lot of thought and consideration.

Thanks to Christoph Hormann, Paul Norman, Joseph E., and Paul Dicker. They were all extremely helpful offering feedback, answering beginner questions, and giving extra context on why decisions were made. This was my first PR, and I’m extremely happy to get it across the finish line.

Discussion

Comment from GinaroZ on 29 September 2021 at 14:17

Could you not change the golf=green colour to the old golf course colour - rgb(181 227 181) - which would be less blue and more green?

Comment from jgruca on 1 October 2021 at 01:29

I’ve created a PR with a greener shade of green for pitch. We’ll see where it goes.

Comment from pkoby on 3 October 2021 at 12:29

A couple of observations on the colors:

The golf green’s pitch color seems so similar to water in my eyes because it lacks a subtle darker outline like other leisure=pitches have (compare here https://www.openstreetmap.org/#map=19/39.32029/-76.64602). Perhaps the green could include that? I’m also keen for a less-blue pitch color.

Also, as a non-golfer, I don’t know what counts as rough, so I haven’t been mapping it. In your image examples, bunkers seem to be consistently surrounded by rough, thus contrasting in color. However, if the bunker isn’t surrounded by rough, it fades into the background of the golf course (see https://www.openstreetmap.org/way/987528872). I don’t have a solution, and perhaps it’s a mapping error to leave out the rough, but it’s an observation. I also noticed that adding surface=sand to a bunker does not add a stipple texture like it does to a beach (I don’t think natural does it either, but bunkers aren’t natural https://wiki.openstreetmap.org/wiki/Talk:Tag:leisure%3Dgolf_course#What_is_natural_in_a_bunker.3F).

Comment from Nearby0051 on 9 October 2021 at 20:40

Thanks for your effort, looks great!

Log in to leave a comment