Modify

Opened 3 years ago

Last modified 4 months ago

#4445 new defect

Duplicated node test fails to detect them properly

Reported by: jfd553@… Owned by: team
Priority: normal Component: Core validator
Version: tested Keywords: Duplicated nodes
Cc: framm

Description (last modified by simon04)

I have imported a lot of data and the resulting ways have duplicated noded at intersection
Validator plugin doesn't detect those nodes even if the option is checked in preferences.

I've include a small file exported using JOSM (and checked with the Validator later version)

Attachments (1)

map.osm (174.0 KB) - added by jfd553@… 3 years ago.
osm map sample with described problem

Download all attachments as: .zip

Change History (12)

Changed 3 years ago by jfd553@…

osm map sample with described problem

comment:1 Changed 3 years ago by hamish_b@…

Hi,

To make a wild guess, I suspect that you are experiencing a floating point precision error.

For example I am working with some roads + bridges datasets which come from the data source as two layers. The roads are delivered with 6 numbers after the decimal place (~11cm for lat), the bridges to 9 (~0.1mm). Perhaps the Validator's "too close node" tool might help? Does that have a threshold setting?

e.g. if( fabs(a - b) < epsilon) ) { do_merge(a,b) }

It might be nice to apply a 1852*60 to the threshold so that the user can specify it in meters (and multiply by cos(lat) for longitude), but as we are working with questions of exact precision here perhaps it is better to leave it all in the realm of lat/lon?

(I'm not really finding that "too close node" tool, but I'm guessing it is right under my nose somewhere.
Validator
Plugin-Mainversion: 3118,
Plugin-Version: 20799
)

cheers,
Hamish

comment:2 Changed 3 years ago by HamishB <hamish_b@…>

Hello,

when opening .osm files downloaded then exported using JOSM, Merkaartor, and Xapi I have noticed some differences that, when mixed, cause the Validator to fail to detect duplicate nodes. It's an ascii representation + floating point precision issue.

  • JOSM seems to export with %.9g (~1cm)
  • Merkaartor seems to save with %.8f (~1mm)
  • Xapi seems to export with %.7f (~1cm)

(fwiw JOSM r3208 also fails to open the downloaded Merkaartor 0.14 .osm file due to missing version= tags in nodes)

Hamish

comment:3 Changed 3 years ago by Hamish <hamish_b@…>

Hi, a prototype/example python script to merge close nodes within some ground-units (given in meters) threshhold can be found here:

http://wiki.openstreetmap.org/wiki/Script_for_snapping_nodes_to_nearby_nodes

it's not all that good; mostly what I want to demonstrate with that is maintaining a constant distance threshold over varying latitudes, with threshold given in a meaningful unit.

Hamish

ps- see also #3720, #4959

comment:4 Changed 3 years ago by e2jk

  • Summary changed from Validator (18848) Duplicated node test fails to detect them properly to Duplicated node test fails to detect them properly

Changed title, removed version info: "Validator (18848)"

comment:5 follow-ups: Changed 20 months ago by simon04

Most duplicate nodes are listed as "Duplicate nodes in two un-closed ways". This type cannot be fixed automatically by intention (cf. comment never merge nodes from two different non-closed geometries).

What is the (un)expected behaviour?

comment:6 in reply to: ↑ 5 ; follow-up: Changed 20 months ago by Hamish <hamish_b@…>

Replying to simon04:

This type cannot be fixed automatically by intention
(cf. comment never merge nodes from two different non-closed geometries).

where can I find/read that comment? (or more importantly others like it) in the source code?

In my case for the New Zealand bulk data upload we get many many duplicate nodes from each of the government's 200 feature layers. A closed area of forest next to a closed area of sand for example. Those snap together easy enough.
But also things like a an unclosed fence line or hedgerow way which is along the edge of a closed forest or field area.

The layers I specifically wrote the python script for in comment:3 was for roads and bridge segments (bridges in the original data are defined by ~3 of the road's nodes (in coordinate space, not by node ID), + attributes).

Hamish

comment:7 in reply to: ↑ 6 Changed 20 months ago by simon04

Replying to Hamish <hamish_b@…>:

where can I find/read that comment? (or more importantly others like it) in the source code?

See http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java#L403

comment:8 in reply to: ↑ 5 Changed 20 months ago by NE2

Replying to simon04:

Most duplicate nodes are listed as "Duplicate nodes in two un-closed ways". This type cannot be fixed automatically by intention (cf. comment never merge nodes from two different non-closed geometries).

What is the (un)expected behaviour?

This is silly. If two roads have dupe nodes, it should be possible to fix them.

comment:9 in reply to: ↑ 5 ; follow-up: Changed 15 months ago by simon04

  • Description modified (diff)

Replying to simon04:

Most duplicate nodes are listed as "Duplicate nodes in two un-closed ways". This type cannot be fixed automatically by intention (cf. comment never merge nodes from two different non-closed geometries).

See also commit message of r3784.

@team: I don't get the reason why these errors are excluded from automatic fixes, neither. What is it?

comment:10 Changed 11 months ago by mrwojo

Should we close this ticket? Validator now detects many dupe nodes in the attached map.osm, and the Fix button issue is tracked in #5867.

comment:11 in reply to: ↑ 9 Changed 4 months ago by Don-vip

  • Cc framm added

Replying to simon04:

Replying to simon04:

Most duplicate nodes are listed as "Duplicate nodes in two un-closed ways". This type cannot be fixed automatically by intention (cf. comment never merge nodes from two different non-closed geometries).

See also commit message of r3784.

@team: I don't get the reason why these errors are excluded from automatic fixes, neither. What is it?

Me neither. I think we could at least merge all untagged nodes.

@Frederik: do you remember why ?

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team. Next status will be 'new'.
Next status will be 'needinfo'.The owner will change to jfd553@hotmail.com
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'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.