| java.lang.Object org.geotools.renderer.lite.RendererUtilities
RendererUtilities | final public class RendererUtilities (Code) | | Class for holding utility functions that are common tasks for people using
the "StreamingRenderer/Renderer".
author: dblasby author: Simone Giannecchini |
Method Summary | |
public static double | calculateOGCScale(ReferencedEnvelope envelope, int imageWidth, Map hints) This method performs the computation using the methods suggested by the OGC SLD specification, page 26. | public static double | calculateScale(Envelope envelope, CoordinateReferenceSystem coordinateReferenceSystem, int imageWidth, int imageHeight, double DPI) Find the scale denominator of the map. | public static double | calculateScale(ReferencedEnvelope envelope, int imageWidth, int imageHeight, Map hints) First searches the hints for the scale denominator hint otherwise calls
RendererUtilities.calculateScale(Envelope,CoordinateReferenceSystem,int,int,double) . | public static double | calculateScale(ReferencedEnvelope envelope, int imageWidth, int imageHeight, double DPI) Find the scale denominator of the map. | public static Envelope | createMapEnvelope(Rectangle paintArea, AffineTransform worldToScreen) | public static ReferencedEnvelope | createMapEnvelope(Rectangle paintArea, AffineTransform worldToScreen, CoordinateReferenceSystem crs) Creates the map's bounding box in real world coordinates
NOTE It is worth to note that here we do not take into account the half a
pixel translation stated by ogc for coverages bounds. | public static AffineTransform | worldToScreenTransform(Envelope mapExtent, Rectangle paintArea) | public static AffineTransform | worldToScreenTransform(ReferencedEnvelope mapExtent, Rectangle paintArea) Sets up the affine transform
NOTE It is worth to note that here we do not take into account the half a
pixel translation stated by ogc for coverages bounds. | public static AffineTransform | worldToScreenTransform(Envelope mapExtent, Rectangle paintArea, CoordinateReferenceSystem destinationCrs) This worldToScreenTransform method makes the assumption that the crs is
in Lon,Lat or Lat,Lon. |
OGC_DEGREE_TO_METERS | final static double OGC_DEGREE_TO_METERS(Code) | | |
calculateOGCScale | public static double calculateOGCScale(ReferencedEnvelope envelope, int imageWidth, Map hints)(Code) | | This method performs the computation using the methods suggested by the OGC SLD specification, page 26.
Parameters: envelope - Parameters: imageWidth - |
calculateScale | public static double calculateScale(Envelope envelope, CoordinateReferenceSystem coordinateReferenceSystem, int imageWidth, int imageHeight, double DPI) throws TransformException, FactoryException(Code) | | Find the scale denominator of the map. Method: 1. find the diagonal
distance (meters) 2. find the diagonal distance (pixels) 3. find the
diagonal distance (meters) -- use DPI 4. calculate scale (#1/#2)
NOTE: return the scale denominator not the actual scale (1/scale =
denominator)
TODO: (SLD spec page 28): Since it is common to integrate the output of
multiple servers into a single displayed result in the web-mapping
environment, it is important that different map servers have consistent
behaviour with respect to processing scales, so that all of the
independent servers will select or deselect rules at the same scales. To
insure consistent behaviour, scales relative to coordinate spaces must be
handled consistently between map servers. For geographic coordinate
systems, which use angular units, the angular coverage of a map should be
converted to linear units for computation of scale by using the
circumference of the Earth at the equator and by assuming perfectly
square linear units. For linear coordinate systems, the size of the
coordinate space should be used directly without compensating for
distortions in it with respect to the shape of the real Earth.
NOTE: we are actually doing a a much more exact calculation, and
accounting for non-square pixels (which are allowed in WMS) ADDITIONAL
NOTE from simboss: I added soe minor fixes. See below.
Parameters: envelope - Parameters: coordinateReferenceSystem - Parameters: imageWidth - Parameters: imageHeight - Parameters: DPI - screen dots per inch (OGC standard is 90) throws: TransformException - throws: FactoryException - |
calculateScale | public static double calculateScale(ReferencedEnvelope envelope, int imageWidth, int imageHeight, double DPI) throws TransformException, FactoryException(Code) | | Find the scale denominator of the map. Method: 1. find the diagonal
distance (meters) 2. find the diagonal distance (pixels) 3. find the
diagonal distance (meters) -- use DPI 4. calculate scale (#1/#2)
NOTE: return the scale denominator not the actual scale (1/scale =
denominator)
TODO: (SLD spec page 28): Since it is common to integrate the output of
multiple servers into a single displayed result in the web-mapping
environment, it is important that different map servers have consistent
behaviour with respect to processing scales, so that all of the
independent servers will select or deselect rules at the same scales. To
insure consistent behaviour, scales relative to coordinate spaces must be
handled consistently between map servers. For geographic coordinate
systems, which use angular units, the angular coverage of a map should be
converted to linear units for computation of scale by using the
circumference of the Earth at the equator and by assuming perfectly
square linear units. For linear coordinate systems, the size of the
coordinate space should be used directly without compensating for
distortions in it with respect to the shape of the real Earth.
NOTE: we are actually doing a a much more exact calculation, and
accounting for non-square pixels (which are allowed in WMS) ADDITIONAL
NOTE from simboss: I added soe minor fixes. See below.
Parameters: envelope - Parameters: imageWidth - Parameters: imageHeight - Parameters: DPI - screen dots per inch (OGC standard is 90)TODO should I take into account also the destination CRS? Otherwise I amjust assuming that the final crs is lon,lat that is it maps lon to x (nraster space) and lat to y (in raster space). throws: TransformException - throws: FactoryException - |
createMapEnvelope | public static Envelope createMapEnvelope(Rectangle paintArea, AffineTransform worldToScreen) throws NoninvertibleTransformException(Code) | | Creates the map's bounding box in real world coordinates ((Taken
from the old LiteRenderer))
Parameters: worldToScreen - a transform which converts World coordinates to screen pixelcoordinates. Parameters: paintArea - the size of the rendering output area |
createMapEnvelope | public static ReferencedEnvelope createMapEnvelope(Rectangle paintArea, AffineTransform worldToScreen, CoordinateReferenceSystem crs) throws NoninvertibleTransformException(Code) | | Creates the map's bounding box in real world coordinates
NOTE It is worth to note that here we do not take into account the half a
pixel translation stated by ogc for coverages bounds. One reason is that
WMS 1.1.1 does not follow it!!!
Parameters: worldToScreen - a transform which converts World coordinates to screen pixelcoordinates. Parameters: paintArea - the size of the rendering output area |
worldToScreenTransform | public static AffineTransform worldToScreenTransform(Envelope mapExtent, Rectangle paintArea)(Code) | | Sets up the affine transform ((Taken from the old LiteRenderer))
Parameters: mapExtent - the map extent Parameters: paintArea - the size of the rendering output area a transform that maps from real world coordinates to the screen |
worldToScreenTransform | public static AffineTransform worldToScreenTransform(ReferencedEnvelope mapExtent, Rectangle paintArea)(Code) | | Sets up the affine transform
NOTE It is worth to note that here we do not take into account the half a
pixel translation stated by ogc for coverages bounds. One reason is that
WMS 1.1.1 does not follow it!!!
Parameters: mapExtent - the map extent Parameters: paintArea - the size of the rendering output area a transform that maps from real world coordinates to the screen |
worldToScreenTransform | public static AffineTransform worldToScreenTransform(Envelope mapExtent, Rectangle paintArea, CoordinateReferenceSystem destinationCrs)(Code) | | This worldToScreenTransform method makes the assumption that the crs is
in Lon,Lat or Lat,Lon. If the provided envelope does not carry along a
crs the assumption that the map extent is in the classic Lon,Lat form. In
case the provided envelope is of type.
Note that this method takes into account also the OGC standard with
respect to the relation between pixels and sample.
Parameters: mapExtent - The envelope of the map in lon,lat Parameters: paintArea - The area to paint as a rectangle Parameters: destinationCrs - |
|
|