This algorithm joins all connected parts of MultiLineString
geometries into single LineString geometries.
If any parts of the input MultiLineString geometries are not
connected, the resultant geometry will be a MultiLineString
containing any lines which could be merged and any non-connected
line parts.
All pointer based methods have been removed.
Now we have only:
void setGeometry( const QgsGeometry& geom )
and
QgsGeometry geometry() const
Benefits include avoiding a whole lot of tricky pointer lifetime
issues, potential memory leaks, and finally closing #777, which
has survived for over 9 years!...
Impacts on PyQGIS code:
- no more need for the messy
g = QgsGeometry( feature.geometry() )
workaround, just use g = feature.geometry() instead
- IMPORTANT: you can no longer test whether a feature has geometry
using `if f.geometry():`, since QgsFeature::geometry() will
*always* return an object. Instead, use
`if not f.geometry().isEmpty():`, or preferably the new method
`if not f.hasGeometry():`
Fix#777
Adds a new method to QgsGeometry for merging linestrings.
By passing a multilinestring, any connected lines will
be joined into single linestrings. Behind the scenes this
uses GEOS' line merge.
A corresponding expression function "line_merge" has also
been added.
This commit changes the way polygon perimeter labeling works.
Previously the polygon would be clipped to the view extent, and
then the boundary of the clipped polygon used for perimeter
labeling.
This tended to push the labels to the outside of the map extent
(the clip boundary), since that's the longest straight section
of the resultant geometry.
Now, the boundary is taken *before* the clip, so that perimeter
based labels will never be placed on the artificial boundary
created at the map's extent.
Returns the closure of the combinatorial boundary of the
geometry (ie the topological boundary of the geometry).
For instance, a polygon geometry will have a boundary
consisting of the linestrings for each ring in the polygon.
Follows OGC / SQL/MM specs for boundary calculation
If the visible part of a polygon is clipped and becomes a multipolygon, only
one label is plotted on the wrong side of the polygon.
Settings:
Placement: Using Perimeter
Allowed positions: Below line / Line orientation dependent position checked
Repeat: 100 mm
Fix#15341
...and leave only:
QgsCoordinateTransform( const QgsCoordinateReferenceSystem& source,
const QgsCoordinateReferenceSystem& destination );
The other constructors were not used anyway in QGIS code,
had awkward/confusing API, and no unit tests.