Opened 9 years ago

Closed 9 years ago

#9522 closed enhancement (fixed)

New test for nodes inside polygons with the same values

Reported by: naoliv Owned by: team
Priority: normal Milestone: 14.01
Component: Core validator Version:
Keywords: Cc:


Now that there is an inner test in MapCSS, couldn't JOSM verify for nodes containing the same properties as the polygons that are external to it?

For example, an area amenity=hospital + name=foo and an internal node (not connected to the way), with exactly the same properties (amenity=hospital + name=foo)

I see a lot of people in Brazil mapping an area and a node inside it with the same values.

Attachments (0)

Change History (7)

comment:1 Changed 9 years ago by simon04

The spatial containment test is computationally expensive. Thus to include such a test, the set of outer objects should be as restricted as possible (e.g. test only amenitiys) as well as the test results should be of significant importance.

comment:2 Changed 9 years ago by Don-vip

Thanks naoliv for setting up Rules/Brazilian-Specific? :)

I see you have implemented this ticket in your rule. Maybe we can integrate it into core validator ? It's not specific to Brazil and it would benefit to all :)

/* locais que já estão definidos por área mas possuem um nó igual */
node[amenity=bank]  *[amenity=bank],
node[amenity=bar]  *[amenity=bar],
node[amenity=cafe]  *[amenity=cafe],
node[amenity=cinema]  *[amenity=cinema],
node[amenity=clinic]  *[amenity=clinic],
node[amenity=college]  *[amenity=college],
node[amenity=community_centre]  *[amenity=community_centre],
node[amenity=fast_food]  *[amenity=fast_food],
node[amenity=fire_station]  *[amenity=fire_station],
node[amenity=fuel]  *[amenity=fuel],
node[amenity=hospital]  *[amenity=hospital],
node[amenity=kindergarten]  *[amenity=kindergarten],
node[amenity=library]  *[amenity=library],
node[amenity=parking]  *[amenity=parking],
node[amenity=pharmacy]  *[amenity=pharmacy],
node[amenity=place_of_worship]  *[amenity=place_of_worship],
node[amenity=police]  *[amenity=police],
node[amenity=public_building]  *[amenity=public_building],
node[amenity=restaurant]  *[amenity=restaurant],
node[amenity=school]  *[amenity=school],
node[amenity=townhall]  *[amenity=townhall],
node[amenity=university]  *[amenity=university],
node[leisure=common]  *[leisure=common],
node[leisure=park]  *[leisure=park],
node[leisure=pitch]  *[leisure=pitch],
node[leisure=playground]  *[leisure=playground],
node[leisure=sports_centre]  *[leisure=sports_centre],
node[leisure=stadium]  *[leisure=stadium],
node[leisure=swimming_pool]  *[leisure=swimming_pool],
node[leisure=track]  *[leisure=track],
node[tourism=hotel]  *[tourism=hotel],
node[tourism=artwork]  *[tourism=artwork],
node[tourism=attraction]  *[tourism=attraction],
node[tourism=zoo]  *[tourism=zoo],
node[shop=convenience]  *[shop=convenience],
node[shop=mall]  *[shop=mall],
node[shop=supermarket]  *[shop=supermarket] {
        throwWarning: tr("nó dentro de área com mesmo valor: {0}", "{0.tag}");

Simon, what do you think about performance ?

comment:3 Changed 9 years ago by naoliv

It's indeed not specific to Brazil [like some other tests - we need to talk about them :-)].
But as you can see, they are somehow limited to the most common ones that I found here. Maybe it could be possible to make it more generic, instead specifing each one of them?

comment:4 Changed 9 years ago by simon04

To shorten this test, we could use the trick from source:trunk/data/validator/geometry.mapcss:

node[tag("amenity") = parent_tag("amenity")]  *[amenity] /* ... */

Performance-wise I would say this test is okay since all of those polygons are small in size and thus do not contain many objects inside. Only a real test will show the practical side. ;-)

comment:5 Changed 9 years ago by Don-vip

Nice. But it must not affect the special treatment of amenity=parking.

I think we can give it a go then, for amenity != parking, leisure, tourism and shop :)

comment:6 Changed 9 years ago by Don-vip

Milestone: 14.01

comment:7 Changed 9 years ago by simon04

Resolution: fixed
Status: newclosed

In 6719/josm:

fix #9522 - New test for nodes inside polygons with the same values
see #9311 - Repair parking inside parking if capacity:disabled is not set

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.