Statistics
| Revision:

root / branches / F2 / libraries / libJCRS / src / org / geotools / referencing / operation / projection / PlateCarree.java @ 12205

History | View | Annotate | Download (4.56 KB)

1
/*
2
 *    GeoTools - OpenSource mapping toolkit
3
 *    http://geotools.org
4
 *
5
 *   (C) 2005-2006, Geotools Project Managment Committee (PMC)
6
 *
7
 *    This library is free software; you can redistribute it and/or
8
 *    modify it under the terms of the GNU Lesser General Public
9
 *    License as published by the Free Software Foundation; either
10
 *    version 2.1 of the License, or (at your option) any later version.
11
 *
12
 *    This library is distributed in the hope that it will be useful,
13
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 *    Lesser General Public License for more details.
16
 */
17
package org.geotools.referencing.operation.projection;
18

    
19
// OpenGIS dependencies
20
import org.geotools.metadata.iso.citation.CitationImpl;
21
import org.geotools.referencing.NamedIdentifier;
22
import org.geotools.resources.cts.ResourceKeys;
23
import org.geotools.resources.cts.Resources;
24
import org.opengis.parameter.ParameterDescriptor;
25
import org.opengis.parameter.ParameterDescriptorGroup;
26
import org.opengis.parameter.ParameterNotFoundException;
27
import org.opengis.parameter.ParameterValueGroup;
28
import org.opengis.referencing.FactoryException;
29
import org.opengis.referencing.operation.CylindricalProjection;
30
import org.opengis.referencing.operation.MathTransform;
31
//import org.geotools.resources.i18n.ErrorKeys;
32
//import org.geotools.resources.i18n.Errors;
33

    
34

    
35
/**
36
 * Plate Carree (or Equirectangular) projection. This is a particular case of
37
 * {@linkplain EquidistantCylindrical Equidistant Cylindrical} projection where the
38
 * {@code standard_parallel_1} is 0.
39
 *
40
 * @see <A HREF="http://www.remotesensing.org/geotiff/proj_list/equirectangular.html">"Equirectangular" on Remote Sensing</A>
41
 *
42
 * @since 2.2
43
 * @source $URL: http://svn.geotools.org/geotools/tags/2.3.0/module/referencing/src/org/geotools/referencing/operation/projection/PlateCarree.java $
44
 * @version $Id: PlateCarree.java 12205 2007-06-19 07:15:42Z jlgomez $
45
 * @author John Grange
46
 * @author Martin Desruisseaux
47
 */
48
public class PlateCarree extends EquidistantCylindrical {
49
    /**
50
     * Constructs a new map projection from the supplied parameters.
51
     *
52
     * @param  parameters The parameter values in standard units.
53
     * @throws ParameterNotFoundException if a mandatory parameter is missing.
54
     */
55
    protected PlateCarree(final ParameterValueGroup parameters) throws ParameterNotFoundException {
56
        super(parameters);
57
    }
58

    
59
    /**
60
     * {@inheritDoc}
61
     */
62
    public ParameterDescriptorGroup getParameterDescriptors() {
63
        return Provider.PARAMETERS;
64
    }
65

    
66
    /**
67
     * The {@link org.geotools.referencing.operation.MathTransformProvider} for an
68
     * {@linkplain org.geotools.referencing.operation.projection.PlateCarree Plate Carree}
69
     * projection.
70
     *
71
     * @see org.geotools.referencing.operation.DefaultMathTransformFactory
72
     *
73
     * @since 2.2
74
     * @version $Id: PlateCarree.java 12205 2007-06-19 07:15:42Z jlgomez $
75
     * @author John Grange
76
     */
77
    public static class Provider extends AbstractProvider {
78
        /**
79
         * The parameters group.
80
         */
81
        static final ParameterDescriptorGroup PARAMETERS = createDescriptorGroup(new NamedIdentifier[] {
82
                new NamedIdentifier(CitationImpl.ESRI,     "Plate_Carree"),
83
                new NamedIdentifier(CitationImpl.OGC,      "Equirectangular"),
84
                new NamedIdentifier(CitationImpl.GEOTIFF,  "CT_Equirectangular")
85
            }, new ParameterDescriptor[] {
86
                SEMI_MAJOR,       SEMI_MINOR,
87
                                  CENTRAL_MERIDIAN,
88
                FALSE_EASTING,    FALSE_NORTHING
89
            });
90

    
91
        /**
92
         * Constructs a new provider. 
93
         */
94
        public Provider() {
95
            super(PARAMETERS);
96
        }
97

    
98
        /**
99
         * Returns the operation type for this map projection.
100
         */
101
        protected Class getOperationType() {
102
            return CylindricalProjection.class;
103
        }
104

    
105
        /**
106
         * Creates a transform from the specified group of parameter values.
107
         *
108
         * @param  parameters The group of parameter values.
109
         * @return The created math transform.
110
         * @throws ParameterNotFoundException if a required parameter was not found.
111
         */
112
        protected MathTransform createMathTransform(final ParameterValueGroup parameters) 
113
                throws ParameterNotFoundException, FactoryException
114
        {
115
            if (isSpherical(parameters)) {
116
                return new PlateCarree(parameters);
117
            } else {
118
                throw new FactoryException(Resources.format(ResourceKeys.ERROR_ELLIPTICAL_NOT_SUPPORTED));
119
            }
120
        }
121
    }
122
}