Skip to content
Permalink
Browse files

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.
  • Loading branch information
rldhont committed Apr 9, 2019
1 parent c2840a2 commit 93656c21244b88a09227ebf6e862bfc86e669d81
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/core/symbology/qgsfillsymbollayer.cpp
@@ -3512,6 +3512,7 @@ QgsSymbolLayer *QgsCentroidFillSymbolLayer::createFromSld( QDomElement &element

std::unique_ptr< QgsCentroidFillSymbolLayer > sl = qgis::make_unique< QgsCentroidFillSymbolLayer >();
sl->setSubSymbol( marker.release() );
sl->setPointOnAllParts( false );
return sl.release();
}

0 comments on commit 93656c2

Please sign in to comment.
You can’t perform that action at this time.