[pal-developer] Some optimizations and bug corrections
Marc-Antoine Nussli
marc-antoine.nuessli at euratlas.com
Thu Jul 8 12:42:46 EDT 2010
Hi PAL folks,
I've used PAL for one project last year. Thus, I had the opportunity to
make some little corrections and optimizations which bring big
improvements for the computation time of polygons labeling.
So, here is a patch to include these modifications as well as some
explanations of the various changes made.
Maxence will surely integrate all, or a part, of the changes in the
development version of PAL but you can use the patch in the meantime.
Here are the explanations of the changes:
-Use 'const GEOSGeometry' and 'const PalGeometry' instead of non-const
ones. This allows to use in more general context where you don't
necessarly have access to non-const Geometry.
-In function extractXYCoord (Util.cpp), possible bugfix to avoid
removing the last point of a polygon which should always be equal to the
first point. At least, this(last point=first point) is something which
seems to be assumed in other functions doing geometrical computations on
polygons.
-In fucntion splitGeom (Util.cpp), added a compiler option to skip
butterflying detection. This is a quite long operation on big polygons
and it can be avoided if we know that the polygons are valid. More
generally, it may be interesting to have some way to specify whether pal
can trust the input geometries and thus avoid useless tests/corrections.
-In LabelPosition::setCostFromPolygon (labelposition.cpp), simple
changes making very big differences... Coordinates where fetched
multiple times for each features without any reason...
-In Pal::getLayer (Pal.cpp) removed an exception thrown when the layer
was inexisting. Seemed not very usefull to me to have an exception here.
Moreover, with the NULL value, we can use this to check if some layer
exists or not...
Best regards
ma
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pal-nuessli-branch-07-07-10-general-changes.patch
Type: text/x-patch
Size: 10719 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/pal-developer/attachments/20100708/c5c06d52/pal-nuessli-branch-07-07-10-general-changes.bin
More information about the pal-developer
mailing list