Page:
PolygonSymbolizer
Pages
A perfect testcase
API changes between v2.0 and v2.1
API changes between v3.0 and v3.1
AWS Lambda
About Mapnik
AlsoFilter
Api changes between v2.1 and v2.2
Api changes between v2.2 and v2.3
Api changes between v2.3 and v3.0
ArchInstallation
Aspect Fix Mode
Benchmark Notes
BoundsClipping
BrokenExceptions
BuildingSymbolizer
CSV Plugin
CairoVersions
CentOS_RHEL
ChangeLog
Code sprint
CodingStandards
Compiler Notes
Compositing
Contributing
DebianInstallation
DebugSymbolizer
DebuggingMapnik
DemoGallery
DeveloperTopics
DevelopingPlugins
Development
ElseFilter
ExampleCode
Expression
FasterCompiling
Fasterlabeling
Filter
FontSet
FreeBSDInstallation
GDAL
GEOS
GSOC Ideas
GSOC2010
GSOC2010_Application
GSOC2010_Ideas
GSOC2011
GSOC2011_Ideas
GeoJSON Plugin
GettingStarted
GettingStartedInPython
GettingStartedInXML
GlyphSymbolizer
GroupSymbolizer
Grouped rendering
Gsoc2012 application
Gsoc2012
HaitiStyles
Home
Ideas
Ideas_Compositing
Ideas_FutureMapnik
Image IO
InstallationTroubleshooting
InternationalText
IntroductionToGIS
Kismet
LabelingSupport
Layer
LearningMapnik
Legending
LinePatternSymbolizer
LineSymbolizer
LinuxInstallation
Logging
MacInstallation
MacInstallationSource
MacInstallation_Homebrew
MacPostGIS_Setup
MacPythonUpgradeIssues
ManagingLargeXmlFiles
MapDesign
Mapnik Development
Mapnik Installation
Mapnik with wxPython
Mapnik2
Mapnik2_Changes
MapnikCodeSprint
MapnikCodeSprint_MCS01
MapnikCodeSprint_MCS01_Location
MapnikCodeSprint_MCS01_Results
MapnikCodeSprint_MCS01_Schedule
MapnikCodeSprint_MCS02
MapnikCoreConcepts
MapnikDependencies
MapnikInstallationSvn
MapnikReferences
MapnikReleaseSteps
MapnikReleases
MapnikRenderers
MapnikTutorials
MapnikUtilities
MapnikViewer
Mapnikinstallation
MarkersSymbolizer
MaxScaleDenominator
MemoryDatasource
MetaWriter
MinScaleDenominator
ModServer
Nik2Img
Notes and caveats
OCCI
OGR
OpenSolarisInstallation
OpenSolarisInstallation_32bit
OpenSolarisInstallation_64bit
OpenSolarisInstallation_TroubleShooting
OpenSuse
OpenSuseInstallation
OptimizeRenderingWithPostGIS
OsmPlugin
OutputFormats
PackageBuilding
Paleoserver
Path Expression
PgRaster
PluginArchitecture
PointSymbolizer
PolygonPatternSymbolizer
PolygonSymbolizer
PostGIS
Postgis async
Python Plugin
Python3k
RFC: Raster color interpretation
Raster
RasterColorizer
RasterSymbolizer
Rasterlite
Related projects and utilities
Release0.6.0
Release0.6.1
Release0.7.0
Release0.7.1
Release0.7.2
Release2.0.0
Release2.0.1
Release2.0.2
Release2.1.0
Release2.2.0
Runtime Logging
SQLite
SVG support
Scale factor
ScaleAndPpi
ShapeFile
ShieldSymbolizer
ShieldSymbolizerTests
Style
StyleShare
Svg rendering gochas
SymbologySupport
Text Rendering Overview
TextSymbolizer
Trac to Github wiki migration notes
Troubleshooting
UbuntuInstallation
UbuntuInstallationOld
UsingCustomFonts
UsingScons
WindowsInstallation
World population tutorial
XMLConfigReference
XmlFormatDiscussion
iOS
mapnik.Datasource
mapnik.Layer
mapnik.Map
my choice
No results
15
PolygonSymbolizer
Jez Nicholson edited this page 2018-01-23 13:25:18 +00:00
Symbolizer that specifies rendering of an area enclosed by a polygon.
For example, the rundemo.py
and rundemo.cpp
applications use PolygonSymbolizer objects to "fill-in" Canadian provinces with different colors and to make bodies of water look blue.
Configuration Options
parameter | value | default | * description * | accepts expressions |
---|---|---|---|---|
fill | CSS colour | "grey" | Fill color to assign to a polygon, defaults to rgba(128,128,128,1) which means gray and fully opaque (alpha = 1), same as rgb(128,128,128) | mapnik >= 3.0 |
fill-opacity | 0.0 - 1.0 | 1.0 | The opacity of the polygon (an alternative way of specifying alpha). Can be used in combination with an rgba color and will be multiplied with the existing alpha component of the color. | mapnik >= 3.0 |
gamma | 0.0 - 1.0 | 1.0 | Level of antialiasing of polygon edges - basically gamma 1 (the default) means fully antialiasing, while a lesser gamma reduces the antialiasing level leading to more jaggy polygon edges. Lower gamma may be desirable in cases where you would prefer that the background color not "shine through". | mapnik >= 3.0 |
comp-op | none | Compositing | no |
- Note: gamma is available in Mapnik >= 0.7.0, see #428 for more detail.
Examples
Default
<PolygonSymbolizer />
Default fill with Gamma correction
<PolygonSymbolizer gamma=".65" fill="#bbbbbb"/>
Custom Fill and Opacity
<PolygonSymbolizer fill="steelblue"/>
<PolygonSymbolizer fill-opacity="0.05" fill="green"/>
Python
p = PolygonSymbolizer(Color('steelblue'))
p.fill_opacity = 0.7
C++
polygon_symbolizer p(color("steelblue"));
p.set_gamma(0.65);
p.set_opacity(0.7);