Navigation Menu

Skip to content

Commit

Permalink
Apply SLD PointSymbolizer on single centroid for polygon
Browse files Browse the repository at this point in the history
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 e1756f5 commit 9420fd3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/symbology/qgsfillsymbollayer.cpp
Expand Up @@ -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();
}

Expand Down

0 comments on commit 9420fd3

Please sign in to comment.