Skip to content

Instantly share code, notes, and snippets.

@tordans
Last active May 9, 2026 20:04
Show Gist options
  • Select an option

  • Save tordans/549a328ccff34963192899113c73d35a to your computer and use it in GitHub Desktop.

Select an option

Save tordans/549a328ccff34963192899113c73d35a to your computer and use it in GitHub Desktop.
Example custom preset (presets_url=) and validation rules (maprules=) for iD
{
"presets": {
"amenity/bench_with_backrest": {
"icon": "temaki-bench",
"geometry": ["point"],
"tags": { "amenity": "bench", "backrest": "yes" },
"addTags": { "amenity": "bench", "backrest": "yes" },
"fields": ["inscription", "material", "seats", "colour"],
"name": "Bench with Backrest",
"terms": ["bench", "seat", "backrest"]
},
"amenity/bench_holzbank": {
"icon": "temaki-bench",
"imageURL": "https://d1rsoc1eahlexs.cloudfront.net/media/amasty/webp/wysiwyg/Kategorien/gartenbank_terrasse_jpeg.webp",
"geometry": ["point", "vertex"],
"tags": { "amenity": "bench", "material": "wood" },
"addTags": { "amenity": "bench", "material": "wood" },
"fields": ["inscription", "material", "seats", "colour"],
"name": "Holzbank",
"terms": ["bench", "wood", "Holz", "Gartenbank", "Holzbank", "Gartenmöbel"]
}
}
}
[
{
"geometry": "node",
"equals": { "amenity": "bench" },
"absence": "backrest",
"warning": "Bench is missing backrest=yes or backrest=no",
"fixes": [
{ "title": "Set backrest=yes", "tags": { "backrest": "yes" } },
{ "title": "Set backrest=no", "tags": { "backrest": "no" } }
]
},
{
"geometry": "node",
"equals": { "amenity": "bench" },
"presence": "backrest",
"negativeRegex": { "backrest": ["^yes$", "^no$"] },
"suggestion": "Bench backrest must be yes or no",
"fixes": [
{ "title": "Set backrest=yes", "tags": { "backrest": "yes" } },
{ "title": "Set backrest=no", "tags": { "backrest": "no" } }
]
},
{
"geometry": "node",
"equals": { "amenity": "bench" },
"presence": "seats",
"negativeRegex": { "seats": ["^[1-9][0-9]*$"] },
"warning": "Bench seats must be a positive integer"
},
{
"geometry": "node",
"equals": { "amenity": "bench" },
"presence": "material",
"negativeRegex": {
"material": [
"^(wood|metal|plastic|stone|concrete|recycled_plastic)$"
]
},
"warning": "Bench material should be one of: wood, metal, plastic, stone, concrete, recycled_plastic"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment