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 2b35644 commit 8d664028f963cda0eb0e033a119e1ec67f8bf117
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/core/symbology/qgsfillsymbollayer.cpp
@@ -3510,6 +3510,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 8d66402

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