Skip to content

Commit 9420fd3

Browse files
authored
Apply SLD PointSymbolizer on single centroid for polygon
SLD 1.0 and StyleEncoding 1.1 specs say that if a line, polygon, or raster geometry is used with PointSymbolizer, then the semantic is to use the centroid of the geometry, or any similar representative point. When QGIS read an SLD, it applies the point on the centroid of all parts of the multi-polygon and not on the unique centroid of the mutil-polygon. ST_Centroid is the PostGIS implementation of the Simple Feature standard for SQL and it generates only one point for multi-polygon. So I think SLD PointSymbolizer has to be applied to the single centroid.
1 parent e1756f5 commit 9420fd3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/core/symbology/qgsfillsymbollayer.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -3512,6 +3512,7 @@ QgsSymbolLayer *QgsCentroidFillSymbolLayer::createFromSld( QDomElement &element
35123512

35133513
std::unique_ptr< QgsCentroidFillSymbolLayer > sl = qgis::make_unique< QgsCentroidFillSymbolLayer >();
35143514
sl->setSubSymbol( marker.release() );
3515+
sl->setPointOnAllParts( false );
35153516
return sl.release();
35163517
}
35173518

0 commit comments

Comments
 (0)