Home / Blog / When OSM doesn't have a polygon, draw one yourself
May 8, 2026· Wine World Map
When OSM doesn't have a polygon, draw one yourself
OpenStreetMap is great at administrative boundaries and abysmal at
wine appellations. The tag boundary=wine_appellation exists. There
are about 30 of them in the world. There are roughly 2,000 official
wine appellations.
The first version of scripts/import-boundaries.js ran three queries
per region:
relation["boundary"="wine_appellation"]["name"~"^X$",i]
relation["name"="X"]["boundary"]
relation["name"="X"]["type"="boundary"]
These work for the famous ones — Bordeaux, Bourgogne, Mosel, Tokaj — because OSM contributors map these as administrative or natural boundaries. They fail for almost everything in the New World. Napa Valley turns into Napa County. Hunter Valley returns nothing usable. Central Otago, Marlborough, Walla Walla — silence.
So we added strategy 4: draw the polygon ourselves from individual vineyards.
The trick
Pretty much every commercial vineyard in OSM is tagged
landuse=vineyard. That tag is very well populated, because
vineyards are obvious from satellite and mapping vineyards is one
of those things volunteers actually enjoy.
Query Overpass for every landuse=vineyard polygon within a radius
around the curated centroid:
[out:json][timeout:60];
way["landuse"="vineyard"](around:50000, 38.5, -122.3);
out geom;
Pull the vertices, throw them at Andrew's monotone-chain convex hull, and you get a polygon that contains every known vineyard in that radius. Not the legal AOC line, but a perfectly serviceable "this is where the vineyards actually are" outline.
What we got
| Region | Vineyards found | Strategy hit | |---|---:|---| | Hunter Valley (AU) | 1,070 | 4 (was failing) | | Goriška Brda (SI) | 5,921 | 4 | | Vipava Valley (SI) | 6,762 | 4 | | Štajerska (SI) | 5,970 | 4 | | Cappadocia (TR) | 241 | 4 | | Yarra Valley (AU) | mid-thousands | 4 | | Trentino-Alto Adige (IT) | 4,830 | 4 |
The convex hull is a generous shape. For Trentino it pulls in some non-vineyard alpine valley between vineyard clusters. That's fine — the map's job is to communicate "wine happens here", not litigate property lines.
What still doesn't work
A handful of regions return nothing: Provence (vineyards present in
OSM but tagged inconsistently with farmland), Willamette Valley
(vineyards tagged but the lat/lng centroid is too far from the
clusters), and some appellations that are too small for our radius
buckets. They get a circle drawn around the centroid as a fallback,
which Map.tsx renders when boundary is null.
Lesson
When the data you want isn't in OSM under the tag you'd expect, look for it under the tag the cartographers actually used. Vineyards were never going to be tagged as appellations — those are legal constructs invisible from the air. They were always going to be tagged as land use, because that's what's literally on the ground.
#openstreetmap#geo#import