08-Placemarks For Raster Output
Adding placemarks when the KMScore decides on raster output
Overview
Normally when a raster image is returned, there is no extra data returned such as the name of the feature. This is normally only returned when KML is returned. But in the example of your viewport zoomed in to a small area of a very large feature, it would normally have to return that whole large feature - which can be slow. With KMSCORE and KMZ output, you can speed this up by returning a raster image instead. But without additional information such as the name of the feature, this is not always useful.
The KMPLACEMARK format option can be used to provide placemarks in addition to the raster image; one folder for each image and one placemark for each feature polygon. Each placemark will display the name of the polygon, placed in the same location as the polygon's label would be. The placemark's description field may contain non-spatial attribute values as per the feature type's description template.
Specifying KMPLACEMARK
To specify KMPLACEMARK, simply add format options to the request url and specify "kmplacemark:<true|false>". For example:
http://localhost:8080/geoserver/wms?service=WMS&request=GetMap&format=application/vnd.google-earth.kml+XML &width=1024&height=1024&srs=EPSG:4326&layers=topp:states&styles=population&bbox=-180,-90,180,90 &format_options=kmplacemark:true
If the KMPLACEMARK option is set to false or is not specified, then the behaviour will revert to the default of not adding placemarks.
Note that this can be used with the new KML reflector, but not with the deprecated version. For example, this will work:
http://localhost:8080/geoserver/kml/wms?layers=topp:states&format_options=kmplacemark:true
while this will not:
http://localhost:8080/geoserver/wms/kml_reflect?layers=topp:states&format_options=kmplacemark:true