org.deegree.services.wms
Class MapService

java.lang.Object
  extended by org.deegree.services.wms.MapService

public class MapService
extends java.lang.Object

MapService

Version:
$Revision: 28910 $, $Date: 2010-12-20 10:48:17 +0100 (Mo, 20. Dez 2010) $
Author:
Andreas Schmitz, last edited by: $Author: aschmitz $

Field Summary
 java.util.HashMap<java.lang.String,Layer> layers
           
 StyleRegistry registry
           
 int updateSequence
          The current update sequence.
 
Constructor Summary
MapService(ServiceConfigurationType conf, org.deegree.commons.xml.XMLAdapter adapter)
           
 
Method Summary
protected static void applyHints(Layer l, java.util.Map<Layer,GetMap.Quality> qualities, java.util.Map<Layer,GetMap.Interpolation> interpolations, java.util.Map<Layer,GetMap.Antialias> antialiases, java.awt.Graphics2D g)
           
 void close()
           
static void fillInheritedInformation(Layer layer, java.util.List<org.deegree.cs.CRS> srs)
           
 java.util.HashMap<Layer,GetMap.Antialias> getDefaultAntialiases()
           
 java.util.HashMap<Layer,java.lang.Integer> getDefaultFeatureInfoRadius()
           
 java.util.HashMap<Layer,GetMap.Interpolation> getDefaultInterpolations()
           
 java.util.HashMap<Layer,java.lang.Integer> getDefaultMaxFeatures()
           
 java.util.HashMap<Layer,GetMap.Quality> getDefaultQualities()
           
 java.util.ArrayList<LayerUpdater> getDynamics()
           
 org.deegree.commons.utils.Pair<org.deegree.feature.GenericFeatureCollection,java.util.LinkedList<java.lang.String>> getFeatures(GetFeatureInfo fi)
           
 int getGlobalFeatureInfoRadius()
           
 int getGlobalMaxFeatures()
           
 Layer getLayer(java.lang.String name)
           
 java.awt.image.BufferedImage getLegend(GetLegendGraphic req)
           
static org.deegree.geometry.primitive.LineString getLegendLine(int xpos, int ypos, int xsz, int ysz)
           
static org.deegree.geometry.primitive.Polygon getLegendRect(int xpos, int ypos, int xsize, int ysize)
           
 org.deegree.commons.utils.Pair<java.lang.Integer,java.lang.Integer> getLegendSize(org.deegree.rendering.r2d.se.unevaluated.Style style)
           
 org.deegree.commons.utils.Pair<java.awt.image.BufferedImage,java.util.LinkedList<java.lang.String>> getMapImage(GetMap gm)
           
 Layer getRootLayer()
           
 java.util.List<org.deegree.feature.types.FeatureType> getSchema(GetFeatureInfoSchema fis)
           
 StyleRegistry getStyles()
           
protected  java.util.LinkedList<java.lang.String> paintLayer(Layer l, org.deegree.rendering.r2d.se.unevaluated.Style s, java.awt.Graphics2D g, GetMap gm)
           
 void paintMap(java.awt.Graphics2D g, GetMap gm, java.util.LinkedList<java.lang.String> warnings)
          Paints the map on a graphics object.
static java.awt.image.BufferedImage postprocessPng8bit(java.awt.image.BufferedImage img)
           
static java.awt.image.BufferedImage prepareImage(int width, int height, java.awt.Color color, boolean transparent, java.lang.String format)
           
static java.awt.image.BufferedImage prepareImage(java.lang.Object req)
           
 void update()
          Updates any dynamic layers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

layers

public java.util.HashMap<java.lang.String,Layer> layers

registry

public StyleRegistry registry

updateSequence

public int updateSequence
The current update sequence.

Constructor Detail

MapService

public MapService(ServiceConfigurationType conf,
                  org.deegree.commons.xml.XMLAdapter adapter)
           throws java.net.MalformedURLException
Parameters:
conf -
adapter -
Throws:
java.net.MalformedURLException
Method Detail

fillInheritedInformation

public static void fillInheritedInformation(Layer layer,
                                            java.util.List<org.deegree.cs.CRS> srs)
Parameters:
layer -
srs -

update

public void update()
Updates any dynamic layers.


getDynamics

public java.util.ArrayList<LayerUpdater> getDynamics()
Returns:
the dynamic layer updaters for this map service

getRootLayer

public Layer getRootLayer()
Returns:
the root layer

getLayer

public Layer getLayer(java.lang.String name)
Parameters:
name -
Returns:
the named layer, or null

paintLayer

protected java.util.LinkedList<java.lang.String> paintLayer(Layer l,
                                                            org.deegree.rendering.r2d.se.unevaluated.Style s,
                                                            java.awt.Graphics2D g,
                                                            GetMap gm)
                                                     throws WMSException.MissingDimensionValue,
                                                            WMSException.InvalidDimensionValue
Throws:
WMSException.MissingDimensionValue
WMSException.InvalidDimensionValue

prepareImage

public static java.awt.image.BufferedImage prepareImage(java.lang.Object req)
Parameters:
req - should be a GetMap or GetLegendGraphic
Returns:
an empty image conforming to the request parameters

prepareImage

public static java.awt.image.BufferedImage prepareImage(int width,
                                                        int height,
                                                        java.awt.Color color,
                                                        boolean transparent,
                                                        java.lang.String format)
Parameters:
width -
height -
color -
transparent -
format -
Returns:
an empty image conforming to the parameters

applyHints

protected static void applyHints(Layer l,
                                 java.util.Map<Layer,GetMap.Quality> qualities,
                                 java.util.Map<Layer,GetMap.Interpolation> interpolations,
                                 java.util.Map<Layer,GetMap.Antialias> antialiases,
                                 java.awt.Graphics2D g)

postprocessPng8bit

public static final java.awt.image.BufferedImage postprocessPng8bit(java.awt.image.BufferedImage img)
Parameters:
img -
Returns:
a new 8bit image, quantized

paintMap

public void paintMap(java.awt.Graphics2D g,
                     GetMap gm,
                     java.util.LinkedList<java.lang.String> warnings)
              throws WMSException.MissingDimensionValue,
                     WMSException.InvalidDimensionValue
Paints the map on a graphics object.

Parameters:
g -
gm -
warnings -
Throws:
WMSException.InvalidDimensionValue
WMSException.MissingDimensionValue

getMapImage

public org.deegree.commons.utils.Pair<java.awt.image.BufferedImage,java.util.LinkedList<java.lang.String>> getMapImage(GetMap gm)
                                                                                                                throws WMSException.MissingDimensionValue,
                                                                                                                       WMSException.InvalidDimensionValue
Parameters:
gm -
Returns:
a rendered image, containing the requested maps
Throws:
WMSException.InvalidDimensionValue
WMSException.MissingDimensionValue

getFeatures

public org.deegree.commons.utils.Pair<org.deegree.feature.GenericFeatureCollection,java.util.LinkedList<java.lang.String>> getFeatures(GetFeatureInfo fi)
                                                                                                                                throws WMSException.MissingDimensionValue,
                                                                                                                                       WMSException.InvalidDimensionValue
Parameters:
fi -
Returns:
a collection of feature values for the selected area, and warning headers
Throws:
WMSException.InvalidDimensionValue
WMSException.MissingDimensionValue

getSchema

public java.util.List<org.deegree.feature.types.FeatureType> getSchema(GetFeatureInfoSchema fis)
Parameters:
fis -
Returns:
an application schema object

close

public void close()

getStyles

public StyleRegistry getStyles()
Returns:
the style registry

getLegendRect

public static org.deegree.geometry.primitive.Polygon getLegendRect(int xpos,
                                                                   int ypos,
                                                                   int xsize,
                                                                   int ysize)
Parameters:
xpos -
ypos -
xsize -
ysize -
Returns:
a made up rectangle to be used in a legend

getLegendLine

public static org.deegree.geometry.primitive.LineString getLegendLine(int xpos,
                                                                      int ypos,
                                                                      int xsz,
                                                                      int ysz)
Parameters:
xpos -
ypos -
xsz -
ysz -
Returns:
a made up line string to be used in a legend

getLegend

public java.awt.image.BufferedImage getLegend(GetLegendGraphic req)
Parameters:
req -
Returns:
the legend

getLegendSize

public org.deegree.commons.utils.Pair<java.lang.Integer,java.lang.Integer> getLegendSize(org.deegree.rendering.r2d.se.unevaluated.Style style)
Parameters:
style -
Returns:
the legend width/height given a base size of 32x32

getDefaultAntialiases

public java.util.HashMap<Layer,GetMap.Antialias> getDefaultAntialiases()
Returns:
the map w/ default settings

getDefaultInterpolations

public java.util.HashMap<Layer,GetMap.Interpolation> getDefaultInterpolations()
Returns:
the map w/ default settings

getDefaultQualities

public java.util.HashMap<Layer,GetMap.Quality> getDefaultQualities()
Returns:
the map w/ default settings

getDefaultMaxFeatures

public java.util.HashMap<Layer,java.lang.Integer> getDefaultMaxFeatures()
Returns:
the map w/ default settings

getDefaultFeatureInfoRadius

public java.util.HashMap<Layer,java.lang.Integer> getDefaultFeatureInfoRadius()
Returns:
the map w/ default settings

getGlobalFeatureInfoRadius

public int getGlobalFeatureInfoRadius()
Returns:
the default feature info radius

getGlobalMaxFeatures

public int getGlobalMaxFeatures()
Returns:
the global max features setting


Copyright © 2011. All Rights Reserved.