org.geotoolkit.referencing.operation.provider.PseudoMercator Maven / Gradle / Ivy
/*
* Geotoolkit.org - An Open Source Java GIS Toolkit
* http://www.geotoolkit.org
*
* (C) 2009-2012, Open Source Geospatial Foundation (OSGeo)
* (C) 2009-2012, Geomatys
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package org.geotoolkit.referencing.operation.provider;
import net.jcip.annotations.Immutable;
import org.opengis.metadata.citation.Citation;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.referencing.ReferenceIdentifier;
import org.opengis.referencing.operation.MathTransform2D;
import org.opengis.referencing.operation.CylindricalProjection;
import org.geotoolkit.referencing.NamedIdentifier;
import org.geotoolkit.referencing.operation.projection.Mercator;
import org.geotoolkit.metadata.iso.citation.Citations;
/**
* The provider for "Popular Visualisation Pseudo Mercator" projection (EPSG:1024).
* This is also known as the "Google projection", defined by popular demand but not considered
* a valid projection method.
*
* The math transform implementations instantiated by this provider may be any of the following
* classes:
*
*
* - {@link org.geotoolkit.referencing.operation.projection.Mercator}
*
*
*
* The following table summarizes the parameters recognized by this provider.
* For a more detailed parameter list, see the {@link #PARAMETERS} constant.
* Operation name: {@code Popular Visualisation Pseudo Mercator}
*
Area of use: (union of CRS domains of validity in EPSG database)
*
* in latitudes: 85°00.0′S to 85°00.0′N
* in longitudes: 180°00.0′W to 180°00.0′E
*
*
* Parameter name Default value
* {@code semi_major}
* {@code semi_minor}
* {@code roll_longitude} false
* {@code latitude_of_origin} 0°
* {@code central_meridian} 0°
* {@code false_easting} 0 metres
* {@code false_northing} 0 metres
*
*
*
* @author Martin Desruisseaux (Geomatys)
* @version 3.20
*
* @see Geotk coordinate operations matrix
*
* @since 3.03
* @module
*/
@Immutable
public class PseudoMercator extends MapProjection {
/**
* For cross-version compatibility.
*/
private static final long serialVersionUID = -8126827491349984471L;
/**
* The operation parameter descriptor for the {@linkplain
* org.geotoolkit.referencing.operation.projection.UnitaryProjection.Parameters#centralMeridian
* central meridian} parameter value.
*
* This parameter is mandatory.
* Valid values range is [-180 … 180]° and default value is 0°.
*
* @deprecated Invoke {@linkplain #PARAMETERS}.{@linkplain ParameterDescriptorGroup#descriptor(String)
* descriptor(String)}
instead.
*/
@Deprecated
public static final ParameterDescriptor CENTRAL_MERIDIAN = Mercator1SP.CENTRAL_MERIDIAN;
/**
* The operation parameter descriptor for the {@linkplain
* org.geotoolkit.referencing.operation.projection.UnitaryProjection.Parameters#latitudeOfOrigin
* latitude of origin} parameter value.
*
* This parameter is mandatory.
* Valid values range is [-90 … 90]° and default value is 0°.
*
* @deprecated Invoke {@linkplain #PARAMETERS}.{@linkplain ParameterDescriptorGroup#descriptor(String)
* descriptor(String)}
instead.
*/
@Deprecated
public static final ParameterDescriptor LATITUDE_OF_ORIGIN = Mercator1SP.LATITUDE_OF_ORIGIN;
/**
* The operation parameter descriptor for the {@linkplain
* org.geotoolkit.referencing.operation.projection.UnitaryProjection.Parameters#falseEasting
* false easting} parameter value.
*
* This parameter is mandatory.
* Valid values range is unrestricted and default value is 0 metre.
*
* @deprecated Invoke {@linkplain #PARAMETERS}.{@linkplain ParameterDescriptorGroup#descriptor(String)
* descriptor(String)}
instead.
*/
@Deprecated
public static final ParameterDescriptor FALSE_EASTING = Mercator1SP.FALSE_EASTING;
/**
* The operation parameter descriptor for the {@linkplain
* org.geotoolkit.referencing.operation.projection.UnitaryProjection.Parameters#falseNorthing
* false northing} parameter value.
*
* This parameter is mandatory.
* Valid values range is unrestricted and default value is 0 metre.
*
* @deprecated Invoke {@linkplain #PARAMETERS}.{@linkplain ParameterDescriptorGroup#descriptor(String)
* descriptor(String)}
instead.
*/
@Deprecated
public static final ParameterDescriptor FALSE_NORTHING = Mercator1SP.FALSE_NORTHING;
/**
* The group of all parameters expected by this coordinate operation.
* The following table lists the operation names and the parameters recognized by Geotk:
*
*
*
*
*
* Name: EPSG
:Popular Visualisation Pseudo Mercator
* Alias: Geotk
:Cylindrical Mercator projection
* Identifier: EPSG
:1024
*
*
*
*
* Name: OGC
:semi_major
* Alias: EPSG
:Semi-major axis
*
*
*
* Type: {@code Double}
* Obligation: mandatory
* Value range: [0…∞) metres
*
*
*
*
* Name: OGC
:semi_minor
* Alias: EPSG
:Semi-minor axis
*
*
*
* Type: {@code Double}
* Obligation: mandatory
* Value range: [0…∞) metres
*
*
*
*
* Name: Geotk
:roll_longitude
*
*
*
* Type: {@code Boolean}
* Obligation: optional
* Default value: false
*
*
*
*
* Name: OGC
:latitude_of_origin
* Alias: EPSG
:Latitude of natural origin
*
*
*
* Type: {@code Double}
* Obligation: mandatory
* Value range: [-90 … 90]°
* Default value: 0°
*
*
*
*
* Name: OGC
:central_meridian
* Alias: EPSG
:Longitude of natural origin
*
*
*
* Type: {@code Double}
* Obligation: mandatory
* Value range: [-180 … 180]°
* Default value: 0°
*
*
*
*
* Name: OGC
:false_easting
* Alias: EPSG
:False easting
*
*
*
* Type: {@code Double}
* Obligation: mandatory
* Value range: (-∞ … ∞) metres
* Default value: 0 metres
*
*
*
*
* Name: OGC
:false_northing
* Alias: EPSG
:False northing
*
*
*
* Type: {@code Double}
* Obligation: mandatory
* Value range: (-∞ … ∞) metres
* Default value: 0 metres
*
*
*
*/
public static final ParameterDescriptorGroup PARAMETERS;
static {
final Citation[] excludes = {
Citations.ESRI, Citations.NETCDF, Citations.GEOTIFF, Citations.PROJ4
};
PARAMETERS = UniversalParameters.createDescriptorGroup(new ReferenceIdentifier[] {
new NamedIdentifier(Citations.EPSG, "Popular Visualisation Pseudo Mercator"),
new IdentifierCode (Citations.EPSG, 1024),
sameNameAs(Citations.GEOTOOLKIT, Mercator1SP.PARAMETERS)
}, excludes, new ParameterDescriptor>[] {
SEMI_MAJOR, SEMI_MINOR, ROLL_LONGITUDE,
LATITUDE_OF_ORIGIN, CENTRAL_MERIDIAN,
FALSE_EASTING, FALSE_NORTHING
}, MapProjectionDescriptor.ADD_EARTH_RADIUS);
}
/**
* Constructs a new provider.
*/
public PseudoMercator() {
super(PARAMETERS);
}
/**
* Returns the operation type for this map projection.
*/
@Override
public Class getOperationType() {
return CylindricalProjection.class;
}
/**
* {@inheritDoc}
*/
@Override
protected MathTransform2D createMathTransform(ParameterValueGroup values) {
return Mercator.create(getParameters(), values);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy