Object
PseudoFactory
PseudoEpsgFactory
- All Implemented Interfaces:
AuthorityFactory
,CRSAuthorityFactory
,CSAuthorityFactory
,DatumAuthorityFactory
,Factory
public class PseudoEpsgFactory
extends PseudoFactory
implements DatumAuthorityFactory, CSAuthorityFactory, CRSAuthorityFactory
Creates referencing objects for a limited set of hard-coded EPSG codes
using
ObjectFactory
and MathTransformFactory
. This pseudo-factory
can be used with implementation that do not support (or don't want to test) a "real"
CRSAuthorityFactory
for the EPSG database.- Since:
- 3.1
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CoordinateOperationFactory
Factory to use for buildingConversion
instances, ornull
if none.protected final CRSFactory
Factory to use for buildingCoordinateReferenceSystem
instances, ornull
if none.protected final CSFactory
Factory to use for buildingCoordinateSystem
instances, ornull
if none.protected final DatumFactory
Factory to use for buildingDatum
instances, ornull
if none.protected final MathTransformFactory
Factory to use for buildingMathTransform
instances, ornull
if none.protected final Units
Provider of predefinedUnit
instances (degree, metre, second, etc).protected final ValidatorContainer
The set of validators to use for verifying objects conformance (nevernull
). -
Constructor Summary
ConstructorDescriptionPseudoEpsgFactory
(Units units, DatumFactory datumFactory, CSFactory csFactory, CRSFactory crsFactory, CoordinateOperationFactory copFactory, MathTransformFactory mtFactory, ValidatorContainer validators) Creates a new pseudo-factory which will use the given factories. -
Method Summary
Modifier and TypeMethodDescriptioncreateCartesianCS
(String code) Creates a Cartesian coordinate system from a code.createCompoundCRS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.Returns an arbitrary coordinate reference system from a code.createCoordinateSystem
(String code) Returns an arbitrary coordinate system from a code.Returns a coordinate system axis from a code.createCylindricalCS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createDatum
(String code) Returns an arbitrary datum from a code.createDerivedCRS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createEllipsoid
(String code) Returns an ellipsoid from a code.createEllipsoidalCS
(String code) Creates an ellipsoidal coordinate system from a code.createEngineeringCRS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createEngineeringDatum
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createGeocentricCRS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createGeodeticDatum
(String code) Returns a geodetic datum from a code.createGeographicCRS
(String code) Returns a geographic coordinate reference system from a code.createImageCRS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createImageDatum
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createObject
(String code) Returns an arbitrary object from a code.protected ParameterValueGroup
createParameters
(int code) Returns the parameters to use for creating the coordinate operation identified by the given EPSG code.createParametricCRS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createParametricCS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createParametricDatum
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createPolarCS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createPrimeMeridian
(String code) Returns a prime meridian from a EPSG code.createProjectedCRS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createPropertiesMap
(int code, String name) Builds a map of properties for a referencing object to be built.createSphericalCS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createTemporalCRS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createTemporalDatum
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createTimeCS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.Unit<?>
createUnit
(String code) Returns an unit from a code.createVerticalCRS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createVerticalCS
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.createVerticalDatum
(String code) The default implementation throwsNoSuchAuthorityCodeException
unconditionally.The default implementation returnsnull
.getAuthorityCodes
(Class<? extends IdentifiedObject> type) The default implementation returns an empty set.getDescriptionText
(String code) The default implementation returnsnull
.Methods inherited from class PseudoFactory
getVendor
-
Field Details
-
units
Provider of predefinedUnit
instances (degree, metre, second, etc). -
datumFactory
Factory to use for buildingDatum
instances, ornull
if none. -
csFactory
Factory to use for buildingCoordinateSystem
instances, ornull
if none. -
crsFactory
Factory to use for buildingCoordinateReferenceSystem
instances, ornull
if none. -
copFactory
Factory to use for buildingConversion
instances, ornull
if none. -
mtFactory
Factory to use for buildingMathTransform
instances, ornull
if none. -
validators
The set of validators to use for verifying objects conformance (nevernull
).
-
-
Constructor Details
-
PseudoEpsgFactory
public PseudoEpsgFactory(Units units, DatumFactory datumFactory, CSFactory csFactory, CRSFactory crsFactory, CoordinateOperationFactory copFactory, MathTransformFactory mtFactory, ValidatorContainer validators) Creates a new pseudo-factory which will use the given factories.- Parameters:
units
- provider of predefinedUnit
instances.datumFactory
- factory for creatingDatum
instances.csFactory
- factory for creatingCoordinateSystem
instances.crsFactory
- factory for creatingCoordinateReferenceSystem
instances.copFactory
- factory for creatingConversion
instances.mtFactory
- factory for creatingMathTransform
instances.validators
- the set of validators to use for verifying objects conformance, Cannot benull
; if there is no particular validators, useValidators.DEFAULT
.
-
-
Method Details
-
getAuthority
The default implementation returnsnull
.- Specified by:
getAuthority
in interfaceAuthorityFactory
- Returns:
- the organization responsible for definition of the database.
-
getAuthorityCodes
public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type) throws FactoryException The default implementation returns an empty set.- Specified by:
getAuthorityCodes
in interfaceAuthorityFactory
- Parameters:
type
- the spatial reference objects type.- Returns:
- the set of authority codes for spatial reference objects of the given type. If this factory does not contain any object of the given type, then this method returns an empty set.
- Throws:
FactoryException
- if this method cannot provide the requested information.- TODO:
- Needs to be implemented.
-
getDescriptionText
The default implementation returnsnull
.- Specified by:
getDescriptionText
in interfaceAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- a description of the object, or
null
if the object corresponding to the specifiedcode
has no description. - Throws:
FactoryException
- if this method cannot provide the requested information.
-
createPropertiesMap
Builds a map of properties for a referencing object to be built. The map shall contain at least theIdentifiedObject.NAME_KEY
identifier associated to the given value. Subclasses can override this method in order to provide more information if they wish.- Parameters:
code
- The EPSG code of the object being built.name
- The name of the object being built.- Returns:
- a map containing the properties for the object to create.
-
createObject
Returns an arbitrary object from a code.Supported codes Code Name 4326 WGS 84 6326 World Geodetic System 1984 6422 Ellipsoidal 2D CS. Axes: latitude, longitude. Orientations: north, east. UoM: degree - Specified by:
createObject
in interfaceAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the datum for the given code.
- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createDatum
Returns an arbitrary datum from a code.Supported codes Code Name 6326 World Geodetic System 1984 - Specified by:
createDatum
in interfaceDatumAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the datum for the given code.
- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createEngineeringDatum
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createEngineeringDatum
in interfaceDatumAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the datum for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.- See Also:
-
createImageDatum
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createImageDatum
in interfaceDatumAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the datum for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.- See Also:
-
createVerticalDatum
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createVerticalDatum
in interfaceDatumAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the datum for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.- See Also:
-
createTemporalDatum
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createTemporalDatum
in interfaceDatumAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the datum for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.- See Also:
-
createParametricDatum
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createParametricDatum
in interfaceDatumAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the datum for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.- See Also:
-
createGeodeticDatum
Returns a geodetic datum from a code.Supported codes Code Name 6326 World Geodetic System 1984 6284 Pulkovo 1942 - Specified by:
createGeodeticDatum
in interfaceDatumAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the datum for the given code.
- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createEllipsoid
Returns an ellipsoid from a code.Supported codes Code Name 7001 Airy 1830 7004 Bessel 1841 7011 Clarke 1880 (IGN) 7019 GRS 1980 7022 International 1924 7024 Krassowsky 1940 7030 WGS 84 - Specified by:
createEllipsoid
in interfaceDatumAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the ellipsoid for the given code.
- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createPrimeMeridian
Returns a prime meridian from a EPSG code.Supported codes Code Name 8901 Greenwich 8903 Paris 8908 Jakarta - Specified by:
createPrimeMeridian
in interfaceDatumAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the prime meridian for the given code.
- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createCoordinateSystem
Returns an arbitrary coordinate system from a code.Supported codes Code Name 6422 Ellipsoidal 2D CS. Axes: latitude, longitude. Orientations: north, east. UoM: degree - Specified by:
createCoordinateSystem
in interfaceCSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate system for the given code.
- Throws:
FactoryException
- if the object creation failed.
-
createCartesianCS
Creates a Cartesian coordinate system from a code.Supported codes Code Name 6500 Earth centred, earth fixed, righthanded 3D coordinate system, consisting of 3 orthogonal axes with X and Y axes in the equatorial plane, positive Z-axis parallel to mean earth rotation axis and pointing towards North Pole. UoM: m - Specified by:
createCartesianCS
in interfaceCSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate system for the given code.
- Throws:
FactoryException
- if the object creation failed.
-
createPolarCS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createPolarCS
in interfaceCSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.
-
createCylindricalCS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createCylindricalCS
in interfaceCSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.
-
createSphericalCS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createSphericalCS
in interfaceCSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.
-
createEllipsoidalCS
Creates an ellipsoidal coordinate system from a code.Supported codes Code Name 6403 Ellipsoidal 2D CS. Axes: latitude, longitude. Orientations: north, east. UoM: grads. 6422 Ellipsoidal 2D CS. Axes: latitude, longitude. Orientations: north, east. UoM: degree 6423 Ellipsoidal 3D CS. Axes: latitude, longitude, ellipsoidal height. Orientations: north, east, up. UoM: degree, degree, metre. 6424 Ellipsoidal 2D CS. Axes: longitude, latitude. Orientations: east, north. UoM: degree - Specified by:
createEllipsoidalCS
in interfaceCSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate system for the given code.
- Throws:
FactoryException
- if the object creation failed.
-
createVerticalCS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createVerticalCS
in interfaceCSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.
-
createTimeCS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createTimeCS
in interfaceCSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.
-
createParametricCS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createParametricCS
in interfaceCSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.
-
createCoordinateSystemAxis
Returns a coordinate system axis from a code.Supported codes Code Name Unit 58 Geodetic latitude grad 59 Geodetic longitude grad 106, 108, 221 Geodetic latitude degree 107, 109, 220 Geodetic longitude degree 110 Ellipsoidal height metre 115 Geocentric X metre 116 Geocentric Y metre 117 Geocentric Z metre - Specified by:
createCoordinateSystemAxis
in interfaceCSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the axis for the given code.
- Throws:
FactoryException
- if the object creation failed.
-
createUnit
Returns an unit from a code.Supported codes Code Name 9001 metre 9102 degree 9105 grad 9122 degree (supplier to define representation) - Specified by:
createUnit
in interfaceCSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the unit for the given code.
- Throws:
FactoryException
- if the object creation failed.
-
createCoordinateReferenceSystem
public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException Returns an arbitrary coordinate reference system from a code.Supported codes Code Name 4326 WGS 84 - Specified by:
createCoordinateReferenceSystem
in interfaceCRSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createCompoundCRS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createCompoundCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.
-
createDerivedCRS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createDerivedCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.
-
createEngineeringCRS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createEngineeringCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.
-
createGeographicCRS
Returns a geographic coordinate reference system from a code.Supported codes Code Name 4326 WGS 84 4284 Pulkovo 1942 - Specified by:
createGeographicCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createGeocentricCRS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createGeocentricCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.- See Also:
-
createImageCRS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createImageCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.
-
createProjectedCRS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createProjectedCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.- See Also:
-
createTemporalCRS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createTemporalCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.- See Also:
-
createVerticalCRS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createVerticalCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.- See Also:
-
createParametricCRS
The default implementation throwsNoSuchAuthorityCodeException
unconditionally.- Specified by:
createParametricCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- value allocated by authority.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException
- if this method cannot provide the requested information.- See Also:
-
createParameters
Returns the parameters to use for creating the coordinate operation identified by the given EPSG code. The coordinate operation is typically a map projection used by exactly one projected CRS, which is listed in the second column for information purpose.The supported codes are determined from the set of examples published in the EPSG guidance document, augmented with other sources (IGNF). The following table lists the supported codes. Codes in italics are not official EPSG codes.
Supported codes Code Used by CRS CRS or transformation name Operation method 19905 3002 Makassar / NEIEZ Mercator (variant A) 19884 3388 Pulkovo 1942 / Caspian Sea Mercator Mercator (variant B) 3856 3857 WGS 84 / Pseudo-Mercator Popular Visualisation Pseudo Mercator 310642901 310642901 IGNF:MILLER Miller_Cylindrical 19958 29873 Timbalai 1948 / RSO Borneo (m) Hotine Oblique Mercator (variant B) 19916 27700 OSGB 1936 / British National Grid Transverse Mercator 17529 2053 South African Survey Grid zone 29 Transverse Mercator 19975 2314 Trinidad 1903 / Trinidad Grid Cassini-Soldner 19878 3139 Vanua Levu 1915 / Vanua Levu Grid Hyperbolic Cassini-Soldner 19910 24200 JAD69 / Jamaica National Grid Lambert Conic Conformal (1SP) 14204 32040 NAD27 / Texas South Central Lambert Conic Conformal (2SP) 6198 6201 Michigan CS27 Central zone Lambert Conic Conformal (2SP Michigan) 19902 31300 Belge 1972 / Belge Lambert 72 Lambert Conic Conformal (2SP Belgium) 19986 3035 ETRS89 / LAEA Europe Lambert Azimuthal Equal Area 16061 5041 WGS 84 / UPS North (E,N) Polar Stereographic (variant A) 19993 3032 WGS 84 / Australian Antarctic Polar Polar Stereographic (variant B) 19983 2985 Petrels 1972 / Terre Adelie Polar Stereographic Polar Stereographic (variant C) 19914 28992 Amersfoort / RD New Oblique Stereographic 9818 9818 Polyconic Polyconic 9840 9840 Orthographic Orthographic 15399 3295 Guam 1963 / Yap Islands Modified Azimuthal Equidistant 19952 2065 CRS S-JTSK (Ferro) / Krovak Krovak 9605 4230 ED50 to WGS 84 Abridged Molodensky 15595 5820 EPSG topocentric example B Geocentric/topocentric conversions - Parameters:
code
- the EPSG code of the coordinate operation to create.- Returns:
- the coordinate operation (typically a map projection) parameters.
- Throws:
FactoryException
- if the given EPSG code is unknown to this factory.- See Also:
-