[mkgmap-dev] [mp: PATCH] Multipolygons: inner and nested polygons supported now
From Felix Hartmann extremecarver at googlemail.com on Sat Jan 2 13:42:47 GMT 2010
On 02.01.2010 12:36, WanMil wrote: > Am 02.01.2010 12:17, schrieb Felix Hartmann: >> Ups, there must be some bug, or the code is very inefficient. >> >> Austria compiled fine, but when I compiled Italy using this patch versus >> standard trunk. Usually the 16 tiles of italy compile in 8 minutes. Now >> it has compiled 6 tiles in 20 minutes only. However while 5 tiles >> compiled in normal speed, 1 took 10 minutes and currently it is stuck >> again. >> It seems to get stuck on single tiles and max-jobs is then not >> continuing until the file it is stuck on finishes (only one instead of 2 >> cpu cores used for a long time). >> >> The one tile it took 10 minutes instead of 1 minute to compile, was also >> the only one with quite substantial size increase (5.07 to 5.20 MB). >> >> I'll break the rendering now and delete the following line from my >> relations file, maybe this is causing it to go slow? >> landuse=forest { apply { add landuse=forest; add >> name = '${name}'; add ref = '${ref}' } } >> _______________________________________________ >> mkgmap-dev mailing list >> mkgmap-dev at lists.mkgmap.org.uk >> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev >> > > The code is not optimized (and not well tested...) yet. > I expect two possible problems: > * an endless loop? > * the bugfixed findCpa method is much more complex > > findCpa now checks if the line that is created between the outer and > the inner polygon intersects the outer polygon. I am using a very > rough (and probably very unoptimized) solution. And it will get worse > because the current implementation is not complete. > The if statement in line 698 > if (intersects(l1, > l1.get(newDistance.index1), > l2.get(newDistance.index2)) == false) { > > must be replaced with > > if (intersects(l1, > l1.get(newDistance.index1), > l2.get(newDistance.index2)) == false > && intersects(l2, > l1.get(newDistance.index1), > l2.get(newDistance.index2)) == false) { > > You could try to increase the maxEntries variable in findCpa. The > current value 500000 seems to be too low. Set it much higher might > reduce the number of intersects calls. But this also depends on the > geometry of the polygons. .. Germany needed only 10% more compilation time. For Italy I now increased maxEntries to 25000000 (so 50x bigger) and it compiled the first two tiles where it got stuck before as usual and takes about 15% more time in general.. I did not notice any big difference in memory consumption (though as the other message I wrote today mkgmap memory requirements doubled over the last 50 revisions . and I suspect a memory leak somewhere). It got stuck a bit later on one tile for 8 minutes nevertheless. I then reran with 250Mio and expeceted it to not get stuck anymore. But the same tile as above again took ~8 minutes instead of ~1 minute to compile so it is not the maxEntries that is too low with that particular tile (though 50.000 definitely was too low, and increasing it to 25 Mio seemed to have good effects, Should I try with 50 billions to see whether it does not get stuck anymore?). --Now I will retry Austria/Germany/Italy with the different if statement in line 698 and look at the result. > > WanMil
- Previous message: [mkgmap-dev] [mp: PATCH] Multipolygons: inner and nested polygons supported now
- Next message: [mkgmap-dev] Do we have a memory leak in mkgmap recently introduced?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list