Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 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 8 years ago.
rel1956189.zip (1.5 MB ) - added by GerdP 8 years ago.
test data containing complex mp rel

Download all attachments as: .zip

Change History (5)

by GerdP, 8 years ago

Attachment: rel1956189.zip added

test data containing complex mp rel

comment:1 by Don-vip, 8 years ago

Milestone: 16.07

comment:2 by Don-vip, 8 years ago

Resolution: fixed
Status: newclosed

In 10684/josm:

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

comment:3 by Don-vip, 8 years ago

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. Next status will be 'reopened'.

Add Comment


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