Opened 8 years ago
Closed 8 years ago
#14786 closed enhancement (fixed)
[Patch] Test for proper "ele" values
Reported by: | naoliv | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 17.05 |
Component: | Core validator | Version: | |
Keywords: | ele | Cc: |
Description
In https://wiki.openstreetmap.org/wiki/Key:ele we can see that ele
is a numeric value that represents the elevation, in meters.
From #Local_Units we can assume that using units (even m
for meter) is not needed (or is invalid).
If I am not lacking coffee, we have 8226 nodes, 3323 ways and 245 relations in OSM with an incorrect ele
value http://overpass-turbo.eu/s/p0i
Is it useful to have this test in JOSM?
/* should be safe to just remove the meters unit from the value */ *[ele][ele =~ /^-?[0-9]+(\.[0-9]+)? ?m$/] { throwWarning: tr("{0} must be a numeric value, in meters and without units", "{0.key}"); fixAdd: concat("ele=", trim(replace(tag("ele"), "m", ""))); set .ele_is_fixed; } *[ele][ele !~ /^-?[0-9]+(\.[0-9]+)?$/]!.ele_is_fixed { throwWarning: tr("{0} must be a numeric value, in meters and without units", "{0.key}"); }
I am assuming that we can have negative values and that it's safe offer a fix to remove m
from the value (for example, when ele=100m
or ele=100 m
)
Attached is also a small test case: nodes inside the green area should not receive any warning, nodes in orange should; nodes inside the yellow area are able to be automatically fixed.
Attachments (1)
Change History (3)
by , 8 years ago
Attachment: | testcase.osm added |
---|
comment:1 by , 8 years ago
Keywords: | ele added |
---|---|
Milestone: | → 17.05 |
Summary: | Test for proper "ele" values → [Patch] Test for proper "ele" values |
comment:2 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In 12215/josm: