User:Naoliv/JOSM Rules

From OpenStreetMap Wiki
Jump to navigation Jump to search
/* something is wrong when *_name is the same as name */
*[name = *designation],
*[name = *alt_name],
*[name = *int_name],
*[name = *loc_name],
*[name = *nat_name],
*[name = *official_name],
*[name = *old_name],
*[name = *reg_name],
*[name = *short_name],
*[name = *sorting_name] {
        throwWarning: tr("{0} e {1} are the same; remove the unneeded {1} key", "{0.key}", "{0.value}");
        fixRemove: "{0.value}";

/* it's good to have a name and/or ref in motorway_junction */
node[highway = motorway_junction][!name][!ref] {
        throwOther: tr("{0} without {1} or {2}", "{0.value}", "{1.key}", "{2.key}");

/* needs to verify since iata=0 isn't a valid value */
*[iata = "0"] {
        throwWarning: tr("{0} with value = {1}", "{0.key}", "{0.value}");
}

/* some kind of nodes that should be connected to a way */
node:unconnected[power = pole],
node:unconnected[power = tower],
node:unconnected[traffic_calming],
node:unconnected[highway = mini_roundabout],
node:unconnected[highway = motorway_junction],
node:unconnected[highway = stop],
node:unconnected[highway = giveway],
node:unconnected[highway = turning_circle],
node:unconnected[highway = crossing],
node:unconnected[highway = speed_camera],
node:unconnected[highway = traffic_signals] {
        throwWarning: tr("{0} must be part of a way", "{1.tag}");
}


/* landuse=yes isn't valid */
*[landuse?] {
        throwWarning: tr("use a valid value for {0} instead ''{1}''", "{0.key}", tag("landuse"));
}

/* the highway name defines its own address; addr:street on the highway shouldn't be necessary */
*[highway]["addr:street"] {
        throwWarning: tr("the {0} name should be specified by "name" instead {1}", "{0.key}", "{1.key}");
}

/* levels should actually be building:levels */
*[building][levels] {
        throwWarning: tr("the number of levels is indicated by building:levels instead {0}", "{1.key}");
        fixChangeKey: "levels => building:levels";
}

/* it's good to have the tower type */
node[man_made = tower][!"tower:type"] {
        throwOther: tr("({0} without {1})", "{0.tag}" "{1.key}");
}

/* amenity=yes is wrong */
*[amenity?] {
        throwWarning: tr("({0}={1}) is an invalid value for amenity", "{0.key}", tag("amenity"));
}

/* place=yes is wrong */
*[place?] {
        throwWarning: tr("({0}={1}) is an invalid value for place", "{0.key}", tag("place"));
}

/* place of worship without religion */
*[amenity = place_of_worship][!religion] {
        throwOther: tr("place of worship without ({0})", "{1.key}");
}

/* it's good to have the icao identifier */
*[aeroway = aerodrome][!icao],
*[aeroway = helipad][!icao] {
        throwOther: tr("{0} without {1}", "{0.value}", "{1.key}");
}

/* surface defined on a node is wrong */
node[surface] {
        throwWarning: tr("node wrongly tagged with {0}", "{0.key}");
}

/* highway/waterway with a negative layer and without tunnel */
*[highway][layer < 0][!tunnel],
*[waterway][layer < 0][!tunnel] {
        throwWarning: tr("{0} with a negative {1} and without {2}", "{0.key}", "{1.key}", "{2.key}");
}

/* highway/waterway with positive layer and without bridge */
*[highway][layer > 0][!bridge],
*[waterway][layer > 0][!bridge] {
        throwWarning: tr("{0} with a positive {1} and without {2}", "{0.key}", "{1.key}", "{2.key}");
}

/* motorway_junction is only for nodes */
way[highway = motorway_junction] {
        throwError: tr("{0} must be used only on the highway exit node", "{0.tag}");
        suggestAlternative: "highway=motorway_link";
}

/* lanes = 0 or negative are wrong */
*[highway][lanes < 1] {
        throwError: tr("{0} with an invalid number of ({1})", "{0.key}", "{1.key}");
}

/* good to have */
*[highway = service][!service],
*[highway = track][!tracktype],
*[route = ferry][!duration] {
        throwOther: tr("{0} without {1}", "{0.tag}", "{1.key}");
}