Team Ai
Datasetpublic

NoeFlandre/osm-polygon-selection

osm-polygon-selection dataset A curated set of OpenStreetMap polygons from 310 geographic units — sovereign countries plus sub-country regions like Brazilian states, Chinese provinces, Indian zones, US states, Canadian provinces, Japanese regions, and Indonesian islands — classified by size bin (small / medium / large, area in [0.1, 100] km²) and tagged by continent (Natural Earth admin0 lookup). Size bins: small — area in [0.1, 1) km² (10,000 m² to 1 km², roughly 100 m × 100 m… See the full description on the dataset page: https://huggingface.co/datasets/NoeFlandre/osm-polygon-selection.

sourceHugging Faceodblupdated 3mo agoView on Hugging Face
0likes13kdownloads
Dataset Card

osm-polygon-selection dataset

A curated set of OpenStreetMap polygons from 310 geographic units — sovereign countries plus sub-country regions like Brazilian states, Chinese provinces, Indian zones, US states, Canadian provinces, Japanese regions, and Indonesian islands — classified by size bin (small / medium / large, area in [0.1, 100] km²) and tagged by continent (Natural Earth admin0 lookup).

Size bins:

  • —`small` — area in [0.1, 1) km² (10,000 m² to 1 km², roughly 100 m × 100 m to ~1 km × 1 km). Examples: a city block, a small park, a single farm field, a small wood lot, a residential courtyard, a parking lot, an industrial yard.
  • —`medium` — area in [1, 10) km² (1 km² to 10 km², roughly 1 km × 1 km to 3 km × 3 km). Examples: a large park, a small village/town footprint, a reservoir, a forest patch, an industrial zone, a golf course, a cemetery, a nature reserve.
  • —`large` — area in [10, 100] km² (10 km² to 100 km², roughly 3 km × 3 km to 10 km × 10 km). Examples: a large forest, a big lake, an entire town or small city, a large military training area, a national park section, a sizable agricultural region.

Polygons smaller than 0.1 km² (most individual buildings, houses, small ponds, single fields) and larger than 100 km² (whole countries, mountain ranges, big seas) are excluded by the size filter (see Filter chain below).

Status: All 310 geographic units are extracted end-to-end.

Total polygons: 16,297,690 (combined parquet: combined/all_world.parquet).

Coverage

This dataset processes one parquet per Geofabrik PBF region. Each region is bucketed in per_country/ as either a sovereign country or a sub-country region (state, province, federal district, island group, zone):

unit typecountexamples
Sovereign country~170france, ghana, japan, peru, australia, brazil, argentina
Sub-country region~130brazil-sudeste, china-beijing, japan-kanto, india-central-zone, us-texas, canada-ontario, russia-siberian-fed-district
Multi-country bundle~10gcc-states, ireland-and-northern-ireland, senegal-and-gambia, haiti-and-domrep, malaysia-singapore-brunei, israel-and-palestine

Total: 310 geographic units across all 6 inhabited continents plus Oceania. The 310 is not the count of sovereign states (which is ~195 per the UN); it's the count of discrete Geofabrik PBF regions we processed.

Layout

This dataset is split across five subfolders so you can pull only what you need:

folderwhat's insidetypical size
`per_country/`one folder per country with <country>.parquet + README.md~28 GB total, <1 MB per small country
`combined/`all_world.parquet — every polygon in one file~14 GB
`splits/`train.parquet, val.parquet, test.parquet — pre-filtered split parquets (no split column needed)~13 GB total
`sample/`sample_map.jsonl — ~18k representative polygons for quick viz~3 MB
`preview/`map_preview.png — static map thumbnail~1 MB

Start with sample/ or preview/ for a quick look. Pull per_country/<country>/<country>.parquet for a single-country study. Use combined/all_world.parquet for cross-country work or splits/<train/val/test>.parquet for ML training with the pre-defined 80/10/10 stratified-by-country split (seed=42).

What's in this dataset

Each row is one OSM polygon (closed way or multipolygon relation) that passed our filter chain (see below). The polygon geometry itself is included in the row as WKT (or WKB if OSM_POLYGON_GEOMETRY=wkb is set when the dataset is built) so you can render, query, or reproject it directly without re-deriving from centroid+area.

columntypedescription
osm_idint64OSM object id (int64).
osm_typestringOSM object type, "way" or "relation" (string).
centroid_lonfloat64polygon centroid longitude (WGS84, float64).
centroid_latfloat64polygon centroid latitude (WGS84, float64).
area_km2float64polygon area in km² (Web Mercator, float64).
tagslist(string)OSM key=value tags (list of strings).
matched_tagstringthe first tag in tags that hit the whitelist (string, the reason the polygon survived).
continentstringNatural Earth admin0 lookup of the centroid (string).
size_binstring"small" (0.1-1), "medium" (1-10), or "large" (10-100) km² (string).
countrystringISO-style country name (string).
extract_statusstring"clean" (extract ran to completion) or "killed" (extract was interrupted) (string).
pbf_datestringdate of the source PBF file (string, from mtime).
geometry_wktstringpolygon geometry as WKT (WGS84, string). Parse with shapely.wkt.loads(row.geometry_wkt).

Provenance

  • —Pipeline version: v0.1.0
  • —Git SHA: d69b105c41732c72c2162d737e3353b95bcbdfbf
  • —Built: 2026-07-06T23:15:51.406227
  • —Source: Geofabrik regional extracts (https://download.geofabrik.de/)
  • —Whitelist: 22,075 OSM key=value tags from osm-stats (see docs/whitelist_decisions.md in the project repo, or read the full rationale in the blog post). The whitelist is designed to filter polygons by landuse-style tags (natural, landuse, leisure, amenity, etc.) so the dataset focuses on physical land-cover / land-use features rather than buildings, addresses, or points of interest.

Geographic distribution

[image]

(Each circle is one polygon from the sample/ folder, color-coded by country. Circle size is proportional to sqrt(area_km2).)

Size-bin distribution (full dataset)

Counts every polygon in the 16,297,690-polygon dataset by size_bin, computed directly from combined/all_world.parquet via pyarrow.compute.value_counts. Percentages are exact ratios over the entire dataset, not a sample.

size_bincountpct
small12,474,30076.5%
medium3,294,82820.2%
large528,5623.2%
Total16,297,690100.0%

Example row

Here is one concrete row from the Liechtenstein parquet file (a natural=* polygon, fully filled-in with all 13 columns):

columnvalue
osm_id1342399548
osm_typeway
centroid_lon9.513440
centroid_lat47.070405
area_km20.3202
tagsnatural=grassland
matched_tagnatural=grassland
continentEurope
size_binsmall
countryliechtenstein
extract_statusclean
pbf_date2026-06-26
geometry_wktMULTIPOLYGON (((9.5109116 47.0686582, 9.5111015 47.0686316, 9.5112088 47.0685293, 9.5112785 47.06...

This row is representative: the full-dataset distribution above shows ~80% small, ~18% medium, ~2% large, and the dominant whitelist tag families (natural=*, landuse=*, leisure=*) account for the majority of matched_tag values.

Filter chain

Each polygon in this dataset has passed three filters:

  1. 1.Size filter (Stage 0): area in [0.1, 100] km². Polygons smaller than 0.1 km² or larger than 100 km² are dropped.
  2. 2.Whitelist filter (Stage 2): at least one OSM tag in the 22,075-tag whitelist. The whitelist is derived from a clustering of OSM tags across both tfidf and embeddings analyses.
  3. 3.Classify (Stage 3): continent assigned via Natural Earth admin0 shapefile, size_bin assigned by area.

Train / val / test split

Every row in every parquet (per_country/<country>/<country>.parquet and combined/all_world.parquet) carries a `split` column with one of three values: train, val, or test.

splitratiopolygons
train80%13,037,271
val10%1,628,432
test10%1,631,987
Total100%16,297,690

The split is stratified by country: each country's rows are assigned to train/val/test independently using a global numpy.random.default_rng seeded once with 42 and offset per country. The exact counts per country and the seed are recorded in `splits/split_manifest.json`.

To load only one split (e.g. for training), filter in pyarrow:

python
import pyarrow.compute as pc
import pyarrow.parquet as pq
table = pq.read_table("combined/all_world.parquet")
train = table.filter(pc.equal(table["split"], "train"))

The split is deterministic and re-runnable:

bash
uv run python scripts/make_split.py            # default seed=42, 80/10/10
uv run python scripts/make_split.py --seed 7   # different reproducible split

Per-country summary

CountryPolygonsStatus
afghanistan15,821clean
albania14,738clean
algeria32,601clean
american-oceania627clean
andorra776clean
angola19,197clean
argentina193,648clean
armenia7,720clean
australia115,145clean
austria133,711clean
azerbaijan15,826clean
azores2,640clean
bahamas2,882clean
bangladesh11,444clean
belarus223,750clean
belgium125,108clean
belize12,972clean
benin4,614clean
bhutan8,769clean
bolivia30,701clean
bosnia-herzegovina49,715clean
botswana5,327clean
brazil-centro-oeste58,137clean
brazil-nordeste46,565clean
brazil-norte46,154clean
brazil-sudeste59,249clean
brazil-sul65,807clean
bulgaria74,567clean
burkina-faso8,835clean
burundi4,659clean
cambodia4,374clean
cameroon71,789clean
canada-alberta134,835clean
canada-british-columbia148,372clean
canada-manitoba104,499clean
canada-new-brunswick16,313clean
canada-newfoundland-and-labrador91,841clean
canada-northwest-territories246,014clean
canada-nova-scotia23,043clean
canada-ontario182,052clean
canada-prince-edward-island4,579clean
canada-quebec251,374clean
canada-saskatchewan57,366clean
canada-yukon34,726clean
canary-islands2,560clean
cape-verde2,417clean
central-african-republic53,491clean
chad23,667clean
chile71,739clean
china-anhui17,945clean
china-beijing15,710clean
china-chongqing6,062clean
china-fujian13,047clean
china-gansu31,162clean
china-guangdong27,368clean
china-guangxi13,033clean
china-guizhou8,079clean
china-hainan4,158clean
china-hebei63,656clean
china-heilongjiang37,555clean
china-henan18,109clean
china-hong-kong1,519clean
china-hubei16,705clean
china-hunan13,182clean
china-inner-mongolia28,927clean
china-jiangsu29,605clean
china-jiangxi15,265clean
china-jilin16,150clean
china-liaoning12,329clean
china-macau90clean
china-ningxia6,196clean
china-qinghai7,691clean
china-shaanxi28,916clean
china-shandong49,948clean
china-shanghai5,564clean
china-shanxi14,141clean
china-sichuan22,246clean
china-tianjin8,836clean
china-tibet24,681clean
china-xinjiang34,254clean
china-yunnan16,805clean
china-zhejiang30,185clean
colombia36,412clean
comores395clean
congo-brazzaville6,643clean
congo-democratic-republic85,106clean
costa-rica7,476clean
croatia47,140clean
cuba23,386clean
cyprus4,846clean
czech-republic271,062clean
denmark175,795clean
djibouti576clean
east-timor1,553clean
ecuador16,139clean
egypt24,623clean
el-salvador3,517clean
equatorial-guinea1,004clean
eritrea3,278clean
estonia47,160clean
ethiopia29,663clean
faroe-islands1,278clean
fiji3,093clean
finland427,870clean
france492,538clean
gabon3,843clean
gcc-states59,856clean
georgia21,198clean
germany1,131,888clean
ghana11,445clean
greece45,142clean
greenland15,132clean
guernsey-jersey670clean
guinea12,311clean
guinea-bissau2,109clean
guyana2,192clean
haiti-and-domrep4,604clean
honduras6,160clean
hungary77,569clean
iceland47,896clean
india-central-zone51,347clean
india-eastern-zone21,480clean
india-north-eastern-zone12,160clean
india-northern-zone50,862clean
india-southern-zone66,323clean
india-western-zone39,173clean
indonesia-java10,582clean
indonesia-kalimantan7,663clean
indonesia-maluku3,800clean
indonesia-nusa-tenggara7,778clean
indonesia-papua4,208clean
indonesia-sulawesi5,805clean
indonesia-sumatra10,121clean
iran57,028clean
iraq26,861clean
ireland-and-northern-ireland159,879clean
isle-of-man2,648clean
israel-and-palestine13,681clean
italy276,991clean
ivory-coast14,273clean
jamaica1,865clean
japan-chubu14,376clean
japan-chugoku10,128clean
japan-hokkaido18,638clean
japan-kansai9,902clean
japan-kanto16,024clean
japan-kyushu23,846clean
japan-shikoku4,686clean
japan-tohoku18,838clean
jordan4,078clean
kazakhstan78,493clean
kenya16,916clean
kiribati584clean
kosovo5,377clean
kyrgyzstan17,110clean
laos6,380clean
latvia47,133clean
lebanon4,289clean
lesotho19,246clean
liberia2,342clean
libya13,046clean
liechtenstein565clean
lithuania76,550clean
luxembourg11,460clean
macedonia9,330clean
madagascar22,664clean
malawi5,337clean
malaysia-singapore-brunei20,439clean
maldives2,358clean
mali40,392clean
malta620clean
marshall-islands628clean
mauritania9,040clean
mauritius1,863clean
mayotte606clean
mexico68,967clean
micronesia755clean
moldova35,690clean
monaco2clean
mongolia10,941clean
montenegro11,785clean
morocco42,623clean
mozambique11,101clean
myanmar32,570clean
namibia9,316clean
nepal68,869clean
netherlands207,459clean
new-caledonia2,141clean
new-zealand127,834clean
nicaragua10,633clean
niger14,606clean
nigeria33,059clean
north-korea19,295clean
norway413,801clean
pakistan36,200clean
panama6,663clean
papua-new-guinea9,006clean
paraguay29,619clean
peru26,038clean
philippines36,555clean
poland637,908clean
polynesie-francaise2,195clean
portugal66,287clean
romania115,401clean
russia-central-fed-district315,956clean
russia-crimean-fed-district20,645clean
russia-far-eastern-fed-district192,337clean
russia-kaliningrad12,432clean
russia-north-caucasus-fed-district52,352clean
russia-northwestern-fed-district381,413clean
russia-siberian-fed-district291,830clean
russia-south-fed-district166,644clean
russia-ural-fed-district184,300clean
russia-volga-fed-district237,169clean
rwanda3,976clean
saint-helena-ascension-and-tristan-da-cunha174clean
samoa369clean
sao-tome-and-principe190clean
senegal-and-gambia20,479clean
serbia47,189clean
seychelles264clean
sierra-leone3,366clean
slovakia54,888clean
slovenia41,526clean
solomon-islands4,575clean
somalia48,453clean
south-africa120,252clean
south-korea39,039clean
south-sudan17,091clean
spain240,230clean
sri-lanka13,748clean
sudan38,043clean
suriname9,410clean
swaziland4,113clean
sweden397,661clean
switzerland61,156clean
syria21,603clean
taiwan14,124clean
tajikistan24,831clean
tanzania16,046clean
thailand32,789clean
togo3,408clean
tonga916clean
tunisia8,498clean
turkey113,609clean
turkmenistan6,353clean
uganda10,449clean
ukraine645,578clean
united-kingdom205,002clean
uruguay10,051clean
us-alabama28,004clean
us-alaska62,521clean
us-arizona38,727clean
us-arkansas18,513clean
us-california51,998clean
us-colorado61,550clean
us-connecticut12,802clean
us-delaware7,255clean
us-district-of-columbia564clean
us-florida229,464clean
us-georgia29,945clean
us-hawaii2,619clean
us-idaho17,217clean
us-illinois79,460clean
us-indiana42,034clean
us-iowa30,362clean
us-kansas56,789clean
us-kentucky12,179clean
us-louisiana17,618clean
us-maine17,529clean
us-maryland24,684clean
us-massachusetts22,134clean
us-michigan73,209clean
us-minnesota72,441clean
us-mississippi7,704clean
us-missouri48,147clean
us-montana18,606clean
us-nebraska31,375clean
us-nevada14,207clean
us-new-hampshire11,186clean
us-new-jersey28,145clean
us-new-mexico21,070clean
us-new-york42,871clean
us-north-carolina36,095clean
us-north-dakota14,275clean
us-ohio117,344clean
us-oklahoma13,752clean
us-oregon45,342clean
us-pennsylvania44,038clean
us-puerto-rico2,318clean
us-rhode-island6,360clean
us-south-carolina20,613clean
us-south-dakota11,975clean
us-tennessee22,002clean
us-texas82,221clean
us-utah22,027clean
us-vermont7,452clean
us-virgin-islands193clean
us-virginia33,844clean
us-washington51,195clean
us-west-virginia25,081clean
us-wisconsin84,094clean
us-wyoming14,739clean
uzbekistan35,052clean
vanuatu663clean
venezuela14,723clean
vietnam21,025clean
yemen7,008clean
zambia15,684clean
zimbabwe7,545clean
Total16,297,690

Back to the dataset root