* @source $URL$
*/
public class PolarStereographicHandlerFactory implements ProjectionHandlerFactory {
public ProjectionHandler getHandler(ReferencedEnvelope renderingEnvelope, CoordinateReferenceSystem sourceCrs, boolean wrap, int maxWraps) throws FactoryException {
MapProjection mapProjection = CRS.getMapProjection(renderingEnvelope
.getCoordinateReferenceSystem());
if (renderingEnvelope != null && mapProjection instanceof PolarStereographic) {
boolean north;
// variant B uses standard_parallel
ParameterValue<?> stdParallel = null;
try {
stdParallel = mapProjection.getParameterValues().parameter(
AbstractProvider.STANDARD_PARALLEL_1.getName().getCode());
} catch (ParameterNotFoundException e) {
// ignore
}
if(stdParallel != null) {
north = stdParallel.doubleValue() > 0;
} else {
// variant A uses latitude of origin
ParameterValue<?> latOrigin = null;
try {
latOrigin = mapProjection.getParameterValues().parameter(
AbstractProvider.LATITUDE_OF_ORIGIN.getName().getCode());
} catch (ParameterNotFoundException e) {
// ignore
}
if(latOrigin != null) {