Modify

Opened 3 weeks ago

Last modified 7 days ago

#23621 new enhancement

Check for trees that are too big

Reported by: anonymous Owned by: team
Priority: normal Milestone:
Component: Core validator Version:
Keywords: natural tree size Cc:

Description

According to the Guinness World Records, the greatest circumference for a tree is 43m. I suggest implementing a check for trees with circumferences exceeding this value, as they are likely to be errors.

For instance, we currently have 2001 nodes in the database with a circumference of 45: https://overpass-turbo.eu/s/1JUU. Osmose could suggest to check them and:

  1. delete the value if plainly wrong or
  2. fix 'circumference=45' to 'circumference=0.45' or 'circumference=45 cm'

Another check could be on height. Trees taller than Hyperion (tallest tree in the world with 116m) are likely to be errors.

I suggested this check in Osmose and they redirect me here:

https://overpass-turbo.eu/s/1JWd
At least 62638 trees worldwide affected by the circumference limit of 43m (excluding those with units or decimals).

I suspect this might be interesting for JOSM, for their numerical validation rules (which we synchronize with Osmose). That way it benefits more people and people who add those trees get a warning prior to uploading it in the first place.

Attachments (0)

Change History (12)

comment:1 by skyper, 3 weeks ago

Keywords: natural tree size added

comment:2 by Famlam, 3 weeks ago

If interesting for JOSM, I would propose the following rule:

node[circumference >= 50][natural=tree] {
  throwWarning: tr("Unusually large value of {0} in meters, possibly centimeter units are meant?", "{0.key}");
  assertMatch: "node natural=tree circumference=200";
  assertMatch: "node natural=tree circumference=82.4";
  assertNoMatch: "node natural=tree circumference=18.4";
  assertNoMatch: "node natural=tree circumference=\"100 cm\"";
  assertNoMatch: "node natural=tree circumference=43"; /* Current world record */
}

This gives about 72k results worldwide.
Or, if you also want to also include the 2 trees worldwide with m-units explicitly specified:

node[circumference=~/^([1-9][0-9]{2,}|[5-9][0-9])(\.[0-9]+)?( ?m)?$/][natural=tree] {
  throwWarning: tr("Unusually large value of {0} in meters, possibly centimeter units are meant?", "{0.key}");
  assertMatch: "node natural=tree circumference=200";
  assertMatch: "node natural=tree circumference=\"82.4 m\"";
  assertNoMatch: "node natural=tree circumference=18.4";
  assertNoMatch: "node natural=tree circumference=\"100 cm\"";
  assertNoMatch: "node natural=tree circumference=43"; /* Current world record */
}
Last edited 3 weeks ago by Famlam (previous) (diff)

comment:3 by gaben, 2 weeks ago

I would opt for the first version, easier to understand and maintain.

Also the circumference and diameter_crown should be added to the numeric validator to warn cases such as circumference=10m -> circumference=10 m.

comment:4 by GerdP, 2 weeks ago

Is there really no method to ask for the - possibly converted - value in m using mapcss?
We have a similar test for towers also using a very complex regex:

*[man_made=communications_tower][height][height =~ /^((7[0-4]|[1-6]?[0-9])(\.[0-9]*)?( m)?|(2(4[0-5]|[0-3][0-9])|1?[0-9]?[0-9])((\.[0-9]*)?( ft|\')|\'(11|10|[0-9])(\.[0-9]*)?\"))$/] { /* 75m ~ 246ft ~ 246' */
  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
  suggestAlternative: "man_made=tower + tower:type=communication + height";
  group: tr("suspicious tag combination");
  assertMatch: "node man_made=communications_tower height=58";
  assertMatch: "node man_made=communications_tower height=\"74 m\"";
  assertMatch: "node man_made=communications_tower height=0.8";
  assertMatch: "node man_made=communications_tower height=245'";
  assertMatch: "node man_made=communications_tower height=\"224.22 ft\"";
  assertMatch: "node man_made=communications_tower height=231'10.22\"";
  assertNoMatch: "node man_made=communications_tower height=\"75 m\"";
  assertNoMatch: "node man_made=communications_tower height=75.72";
  assertNoMatch: "node man_made=communications_tower height=\"328.22 ft\"";
  assertNoMatch: "node man_made=communications_tower height=4358'8\"";
  assertNoMatch: "node height=4358'";
}

comment:5 by gaben, 2 weeks ago

In Rules/Runways I've used some MapCSS hack (to_int()) to get the value, but it does not look better.

Last edited 2 weeks ago by gaben (previous) (diff)

comment:6 by skyper, 2 weeks ago

There is a ticket about supporting unit conversion with a library but I cannot find it right now. Maybe it was closed as wontfix as the size of the library was to big.

Last edited 2 weeks ago by skyper (previous) (diff)

in reply to:  6 comment:7 by gaben, 9 days ago

Is it a call for a conversion plugin? :)

comment:8 by Famlam, 8 days ago

I think it would be a 'nice to have' to support all units (either as a plugin or via a complicated mapcss regex or ...), but I don't think it should be a blocker for this issue, not?
I mean, if I quickly search for any circumference tag value containing a ', ", "in" or "ft", there's just 317 worldwide.

I suspect the majority of the cases with 'too large' circumferences will be due to people who assume the wrong default unit, thus for instance entering a value in mm without adding mm to the value. (For such cases the simple numerical rule in comment:2 would be enough)

comment:9 by gaben, 7 days ago

FYI: Yesterday I created a unit conversion plugin. So far it's capable converting metric lenght values, the imperial ones not yet.

The biggest work would be to collect and categorize all the tags which contains units.

Regarding the ticket, I'm fine with the proposed rule from comment:2.

comment:10 by GerdP, 7 days ago

A plugin seems wrong to me if we distribute the rules with core.

comment:11 by gaben, 7 days ago

Yeah, but is there a better option? It wouldn't make into core because it's using a lib.

comment:12 by stoecker, 7 days ago

Writing a function to convert about 10 different units shouldn't be so complicated that it needs a lib. Supporting strange units is anyway a bad idea. There is reason why SI units exist.

Last edited 7 days ago by stoecker (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to anonymous.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.