/* {0} on a node */
node[oneway],
node[bridge?],
node[landuse],
node[source:geometry],
node[source:outline] {
  throwWarning: tr("{0} on a node", "{0.key}");
  assertMatch: "node oneway=-1";
  assertNoMatch: "way oneway=-1";
  assertMatch: "node bridge=yes";
  assertNoMatch: "node bridge=13";
}

/* Building inside building (spatial test) */
*[building][building!~/no|entrance/][coalesce(tag("layer"),"0") = coalesce(parent_tag("layer"),"0")] ∈
*[building][building!~/no|entrance/] {
  throwWarning: tr("Building inside building");
}

/* Overlapping areas (spatial test) */
area[natural =~ /^(water|wetland|coastline)$/], area[landuse=reservoir] {
  set water_area;
}

area:closed:areaStyle.water_area ⧉ area:closed:areaStyle.water_area {
  throwWarning: tr("Overlapping Water Areas");
}

area:closed:areaStyle ⧉ area:closed:areaStyle {
  throwOther: tr("Overlapping Areas");
}

/* see ticket #9311 */
node[amenity=parking]["capacity:disabled" !~ /^(yes|[0-9]+)$/] ∈ *[amenity=parking] {
  throwWarning: tr("{0} inside {1}", "amenity=parking", "amenity=parking");
}

/* see ticket #9556 */
area:closed:areaStyle[tag("natural") = parent_tag("natural")] ⧉ area:closed:areaStyle[natural] {
  throwWarning: tr("Overlapping Identical Natural Areas");
}

area:closed:areaStyle[tag("landuse") = parent_tag("landuse")] ⧉ area:closed:areaStyle[landuse] {
  throwWarning: tr("Overlapping Identical Landuses");
}

/* see ticket:#9522 */
node[tag("amenity") = parent_tag("amenity")] ∈ *[amenity][amenity != parking] {
  throwWarning: tr("{0} inside {1}", concat("amenity=", tag("amenity")), concat("amenity=", tag("amenity")));
}
node[tag("leisure") = parent_tag("leisure")] ∈ *[leisure] {
  throwWarning: tr("{0} inside {1}", concat("leisure=", tag("leisure")), concat("leisure=", tag("leisure")));
}
node[tag("tourism") = parent_tag("tourism")] ∈ *[tourism] {
  throwWarning: tr("{0} inside {1}", concat("tourism=", tag("tourism")), concat("tourism=", tag("tourism")));
}
node[tag("shop") = parent_tag("shop")] ∈ *[shop] {
  throwWarning: tr("{0} inside {1}", concat("shop=", tag("shop")), concat("shop=", tag("shop")));
}
node[tag("power") = parent_tag("power")] ∈ *[power] {
  throwWarning: tr("{0} inside {1}", concat("power=", tag("power")), concat("power=", tag("power")));
}
