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 authored Apr 9, 2019
1 parent 2b35644 commit 8d66402
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/symbology/qgsfillsymbollayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 8d66402

Please sign in to comment.