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.
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.
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.
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.
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.
New golf tags
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: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.
<Filter>[leisure] = 'golf_course'</Filter>
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.
<Filter>[golf] = 'fairway' or [golf] = 'tee' or [golf] = 'green'</Filter>
And then I added the bunker area, again with with a single rule-paragraph.
<Filter>[golf] = 'bunker'</Filter>
<PolygonPatternSymbolizer file= "%SYMBOLS_DIR%/beach.png" type="png" width="10" height="10"/>
Finally, two changes were required to the select statement in the leisure layer.
where landuse is not null
or leisure is not null
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
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.
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.
Golf: A good walk ruined ~ Mark Twain
The original golf style in XML format.
This article from the archives was originally published on Mon, 08/17/2009 - 01:54