Skip to end of metadata
Go to start of metadata
Geometry Transformations

GeoServer can do symbolizations based on the geometry.  See the documentation Geometry Transformations in SLD.

Examples:

Symbolize vertices:

Just insert a function "vertices", mention the geometry attribute (SHAPE for SDE), and symbolize the vertex points (here a red square).

A style GISDATA.MBTA_ARC::Vertices was created using an additional rule with the code above.

Request:

http://giswebservices.massgis.state.ma.us/geoserver/massgis/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:GISDATA.MBTA_ARC&styles=GISDATA.MBTA_ARC::Vertices&bbox=220353,884236,241892,909751&width=432&height=512&srs=EPSG:26986&format=image/png

Response:

Start and End Points:

The startPoint and endPoint functions can be used to extract the start and end point of a line.

A style GISDATA.MBTA_ARC::Start_End_Points was created using an additional rule with the code above.  The start points are hollow green squares and the end points are small solid red dots.

Request:

http://giswebservices.massgis.state.ma.us/geoserver/massgis/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:GISDATA.MBTA_ARC&styles=GISDATA.MBTA_ARC::Start_End_Points&bbox=220353,884236,241892,909751&width=432&height=512&srs=EPSG:26986&format=image/png

Response:

Drop Shadow:

The offset function can be used to create drop shadow effects below polygons. Notice that the offset values reflect the fact that the data used in the example is in a geographic coordinate system. For MassGIS data generally the values would be meters.  Make sure to put the shadow underneath the symbolization of your polygons. Numbers can be positive or negative, governing displacement in the X and Y directions.  Here, 5 meters east, then 5 meters south (negative).

Request:

http://giswebservices.massgis.state.ma.us/geoserver/wms?LAYERS=massgis%3AGISDATA.STRUCTURES_POLY&TRANSPARENT=TRUE&STYLES=GISDATA.STRUCTURES_POLY%3A%3ADrop_Shadow&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&FORMAT=image%2Fpng&SRS=EPSG%3A26986&BBOX=235897,901216,236270,901442&WIDTH=1182&HEIGHT=720

Response:

Buffer:

GeoServer’s filter functions contain a number of set-related or constructive geometric functions, such as buffer, intersection, difference and others. See this page at bottom for Spatial Geometric Functions. These can be used as geometry transformations, but they be can quite heavy in terms of CPU consumption so it is advisable to use them with care. One strategy is to activate them only at higher zoom levels, so that fewer features are processed.

(Buffering can often be visually approximated by using very large strokes together with round line joins and line caps. This avoids incurring the performance cost of a true geometric buffer transformation.)

Request:

http://gisswebservices.massgis.state.ma.us/geoserver/wms?LAYERS=massgis%3AGISDATA.STRUCTURES_POLY&TRANSPARENT=TRUE&STYLES=GISDATA.STRUCTURES_POLY%3A%3ABuffer&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&FORMAT=image%2Fpng&SRS=EPSG%3A26986&BBOX=235897,901216,236270,901442&WIDTH=1182&HEIGHT=720

Response:

 

Centroids:

 

 

Request:

 http://giswebservices.massgis.state.ma.us/geoserver/massgis/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:GISDATA.TOWNS_POLYM&styles=GISDATA.TOWNS_POLYM::Centroids&bbox=220353,884236,241892,909751&width=432&height=512&srs=EPSG:26986&format=image/png