Golf course style for OpenStreetMap

rweait's picture

photo ccby chispita from flickr
In July 2009, Peter Miller wondered aloud on the OpenStreetMap-talk mailing list, if detailed rendering of golf courses was coming to OpenStreetMap? It's a fair question and one that has run through the mind of any OpenStreetMap enthusiast who has spent an afternoon at a good walk ruined.[1]

Peter asked:

Any chance of opengolfmap? I am needing a map to show the interaction
between an existing golf course and a proposed cycle route. I can add
the data to the map but I am not aware of anything that will render it.
http://wiki.openstreetmap.org/wiki/Proposed_features/Golf_course

I've taken a first cut at golf course rendering rules, using the wiki for guidance and using available resources. The results are rough but encouraging, I think. Until recently, all golf courses on OpenStreetMap were undifferentiated green blobs.

golf course area rendered by Mapnik

The Pine Lakes Country Club, in Myrtle Beach was built in 1927 and is known as The Granddaddy in an area known for golf courses.

Find Pine Lakes Country Club on OpenStreetMap.org.

Available resources

OpenStreetMap has tags to show areas of water and trees, and the aerial imagery in the area is good, so I started by adding:
k:natural; v:water # for water features and
k:landuse; v:forest # for trees

The aerial imagery had long shadows that made for some guesswork on the tree placement. Even so, the server did a good job of rendering the new trees and water data which gave the map a little bit of the flavour of Pine Lakes. This project could really benefit from a fact finding mission and a site survey to Pine Lakes. I'll happily make that sacrifice.

Pine Lakes, trees and water

New golf tags

With the easy stuff done I had to face the mapnik style sheet. I wanted to add tee boxes, fairways, greens and bunkers to the map to really show the character of the golf course. Most of these features were visible from the available images. The wiki article on golf course tagging covered all of this except the tee boxes.

k:golf; v:fairway
k:golf; v:green
k:golf; v:bunker
k:golf; v:tee # added in the same spirit.

With most of the holes added to the map, I saved a local copy and started rendering.

First I turned the golf_course area off at high zoom levels by adding a MinScaleDenominator line to the k:leisure; v:golf_course rule.

<Rule>
  <Filter>[leisure] = 'golf_course'</Filter>
  <MaxScaleDenominator>1000000</MaxScaleDenominator>
  <MinScaleDenominator>20000</MinScaleDenominator>
  <PolygonSymbolizer>
    <CssParameter name="fill">#b5e3b5</CssParameter>
  </PolygonSymbolizer>
</Rule>

Then I added the tee, fairway and green areas, only at high zoom levels, with a single paragraph. Added after the k:leisure; v:golf_course rule.

<Rule>
  <Filter>[golf] = 'fairway' or [golf] = 'tee' or [golf] = 'green'</Filter>
  <MaxScaleDenominator>20000</MaxScaleDenominator>
  <PolygonSymbolizer>
    <CssParameter name="fill">#b5e3b5</CssParameter>
  </PolygonSymbolizer>
</Rule>

And then I added the bunker area, again with with a single rule-paragraph.

<Rule>
  <Filter>[golf] = 'bunker'</Filter>
  <MaxScaleDenominator>20000</MaxScaleDenominator>
  <PolygonPatternSymbolizer file= "%SYMBOLS_DIR%/beach.png" type="png" width="10" height="10"/>
</Rule>

Finally, two changes were required to the select statement in the leisure layer.
(select way,aeroway,amenity,landuse,leisure,man_made,golf,military,"natural",power,tourism,name
from %PREFIX%_polygon
where landuse is not null
or leisure is not null
or aeroway='apron'
or man_made='pier'
or golf in ('bunker','tee','fairway','green')
or amenity in ('parking','university','college','school','hospital','grave_yard')
or military in ('barracks','danger_area')
or "natural" in ('field','beach','glacier','heath','mud','wood')
or power in ('station','sub_station')
or tourism in ('attraction','camp_site','caravan_site','picnic_site','zoo')
order by z_order,way_area desc
) as leisure

basic golf style rendered by mapnik

When rendered by mapnik, locally we can see a dogleg right with a psychologically challenging tee shot over the water. Stay right, or use a fade to take some of the sting out of the long approach shot to the clubhouse green, carefully guarded by two silent, sandy sentries. Or something like that.

Next steps

There is room to improve the map of this course with a detailed site survey, including rough location, cart paths, hole numbering, distances and recommended shots. The course was recently remodeled after an ownership change and several bouts of hurricane damage. The aerial imagery may be out of date.

The cartography for this basic golf style can be improved. Colours should be better matched. Bunkers are a little weak and tee boxes should stand out more against water. The addition of rough and hole outlines will improve the appearance of rendered golf courses.

The style sheet organization can be improved with a proper golf course layer. The current style is added to the leisure layer and while appropriate, it may be too busy for a general-purpose map.

You'll find my complete style template file, as used to render these examples, below.

Your comments, questions and suggestions regarding golf course rendering on OpenStreetMap are are welcome.

Credits

Map images and data © 2009 CCBYSA OpenStreetMap and contributors.
Golf photo © 2008 CCBY chispita_666 on flickr.

[1]Golf: A good walk ruined ~ Mark Twain

Resources

The original golf style in XML format.

This article from the archives was originally published on Mon, 08/17/2009 - 01:54

Comments

Golf course style

Golf courses are one of my favorite things to map, for a few reasons. They look great when the details are drawn, which also helps to differentiate them from parks. Each one "tells a story" as you can imagine a journey through the landscape from one hole to another. And they give distinction to OSM because other online maps don't do golf courses (they only show the outline). Nothing else screams "well mapped area" like a finely detailed golf course.

After searching far and wide for the best mapping format, the most impressive courses I found were in Reston, Virginia:

http://www.openstreetmap.org/?lat=38.95095&lon=-77.34521&zoom=15&layers=M

I've been copying this format all over the Chicago area with over 20 golf courses done so far but no end in sight. (You can see a few here: http://www.openstreetmap.org/?lat=41.7737&lon=-88.09997&zoom=15&layers=M) The Reston courses have some interesting tags that I've adopted, such as grass=mown for fairways and grass=finely_mown for tees. Many golf courses give funny names to each hole, which I usually put on the fairway for better readability (example: http://www.openstreetmap.org/?lat=41.69219&lon=-88.32728&zoom=17&layers=M). I'd be curious to get feedback about this style compared to others. I must say I prefer natural=beach to natural=sand, even though the latter tag is better named for the role of a bunker.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.