1. GeoServer login --> Style tab click --> New Style


2. Labeling example


columnName ---> label column name in PostGIS table


...

<TextSymbolizer>

<Label>

<ogc:PropertyName>columnName</ogc:PropertyName>

</Label>

<Font>

<CssParameter name="font-family">Arial</CssParameter>

<CssParameter name="font-size">12</CssParameter>

<CssParameter name="font-style">normal</CssParameter>

</Font>

<LabelPlacement>

<PointPlacement>

<AnchorPoint>

<AnchorPointX>0.5</AnchorPointX>

<AnchorPointY>0.5</AnchorPointY>

</AnchorPoint>

</PointPlacement>

</LabelPlacement>

<Geometry>

<ogc:Function name="centroid">

<ogc:PropertyName>geom</ogc:PropertyName>

</ogc:Function>

</Geometry>

<VendorOption name="repeat">-1</VendorOption>

<VendorOption name="maxDisplacement">400</VendorOption>

</TextSymbolizer>

...



+ Recent posts