root / org.gvsig.jcrs / libJCRS / src / org / geotools / referencing / operation / projection / IdrPlateCarree.java @ 38
History | View | Annotate | Download (4.88 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 IdrEquidistantCylindrical 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: IdrPlateCarree.java 12357 2007-06-27 09:05:41Z dguerrero $
|
45 |
* @author John Grange
|
46 |
* @author Martin Desruisseaux
|
47 |
*/
|
48 |
public class IdrPlateCarree extends IdrEquidistantCylindrical { |
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 IdrPlateCarree(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.IdrPlateCarree Plate Carree}
|
69 |
* projection.
|
70 |
*
|
71 |
* @see org.geotools.referencing.operation.DefaultMathTransformFactory
|
72 |
*
|
73 |
* @since 2.2
|
74 |
* @version $Id: IdrPlateCarree.java 12357 2007-06-27 09:05:41Z dguerrero $
|
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 NamedIdentifier(new CitationImpl("IDR"), "IDR") |
86 |
}, new ParameterDescriptor[] { |
87 |
SEMI_MAJOR, SEMI_MINOR, |
88 |
CENTRAL_MERIDIAN, |
89 |
FALSE_EASTING, FALSE_NORTHING |
90 |
}); |
91 |
|
92 |
/**
|
93 |
* Constructs a new provider.
|
94 |
*/
|
95 |
public Provider() { |
96 |
super(PARAMETERS);
|
97 |
} |
98 |
|
99 |
/**
|
100 |
* Returns the operation type for this map projection.
|
101 |
*/
|
102 |
protected Class getOperationType() { |
103 |
return CylindricalProjection.class;
|
104 |
} |
105 |
|
106 |
/**
|
107 |
* Creates a transform from the specified group of parameter values.
|
108 |
*
|
109 |
* @param parameters The group of parameter values.
|
110 |
* @return The created math transform.
|
111 |
* @throws ParameterNotFoundException if a required parameter was not found.
|
112 |
*/
|
113 |
protected MathTransform createMathTransform(final ParameterValueGroup parameters) |
114 |
throws ParameterNotFoundException, FactoryException
|
115 |
{ |
116 |
if (isSpherical(parameters)) {
|
117 |
return new IdrPlateCarree(parameters); |
118 |
} else {
|
119 |
throw new FactoryException(Resources.format(ResourceKeys.ERROR_ELLIPTICAL_NOT_SUPPORTED)); |
120 |
} |
121 |
} |
122 |
} |
123 |
} |