[pal-developer] Some optimizations and bug corrections
Maxence Laurent
maxence.laurent at heig-vd.ch
Fri Jul 9 03:03:46 EDT 2010
Thanks for your work, Marc-Antoine,
Patch applied in revision 118 of the trunk.
@vianney are you using the trunk or the pal-0.2 tags ? You should switch
to the trunk version in the latter case.
cheers
maxence
On 08/07/10 18:42, Marc-Antoine Nussli wrote:
> 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
>
More information about the pal-developer
mailing list