Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#13251 closed enhancement (fixed)

[Patch] Improve multipolygon validator

Reported by: anonymous Owned by: team
Priority: normal Milestone: 16.07
Component: Core Version:
Keywords: Cc:

Description

I noticed that the multipolygon validator needs a long time
to validate complex polygons, esp. when the outer polygon is very complex and
also inner complex polygons exist.
In my test data the rel 1956189 requires
DEBUG: Test 'Multipolygon' completed in 2 min 46 s

I looked at the code and found that the method
PolygonIntersection org.openstreetmap.josm.tools.Geometry.polygonIntersection(Area a1, Area a2, double eps)
calls the cpu expensive method inter.equals(a1) without checking first
if the bbox of a1 fits into the bbox of a2, which can be done much cheaper.
The same happens with inter.equals(a2)
Attached is a patch that implements the improvement,
in my test case the time was reduced to
DEBUG: Test 'Multipolygon' completed in 47.8 s

Attachments (2)

improve_polygon_intersection_test.patch (870 bytes) - added by GerdP 5 years ago.
rel1956189.zip (1.5 MB) - added by GerdP 5 years ago.
test data containing complex mp rel

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by GerdP

Changed 5 years ago by GerdP

Attachment: rel1956189.zip added

test data containing complex mp rel

comment:1 Changed 5 years ago by Don-vip

Milestone: 16.07

comment:2 Changed 5 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 10684/josm:

fix #13251 - Improve multipolygon validator performance (patch by gpetermann_muenchen)

comment:3 Changed 5 years ago by Don-vip

thanks, this is a great performance improvement!

Modify Ticket

Change Properties
Set your email in Preferences
Action
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.