Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-3_6] Apply SLD PointSymbolizer on single centroid for polygon #9779

Merged
merged 2 commits into from
Apr 12, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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 authored Apr 9, 2019
commit 9420fd3da47e2b17c1fef369ad16762fbcd71e3c
1 change: 1 addition & 0 deletions src/core/symbology/qgsfillsymbollayer.cpp
Original file line number Diff line number Diff line change
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