Package org.apache.sis.referencing.cs
Class Codes
java.lang.Object
org.apache.sis.referencing.cs.Codes
Map units of measurement and axis directions to
CoordinateSystem
objects defined in the EPSG database.
Current version uses hard-coded mapping.- Since:
- 0.8
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int
Axis directions as a maximum of 4 directions packed in a single integer.(package private) final short
EPSG code of the coordinate reference system.All hard-coded EPSG codes known to this class.(package private) final short
EPSG code of the target unit of measurement. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Codes
(int directions, short unit, short epsg) Creates a new code for the given axis directions and units. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares thisCodes
instance with the given object for equality.int
hashCode()
Returns the hash code value for thisCodes
instance.(package private) static short
lookup
(javax.measure.Unit<?> unit, org.opengis.referencing.cs.AxisDirection[] directions) Returns the EPSG code for the given axis directions and unit of measurement, or 0 if none.private static int
pack
(org.opengis.referencing.cs.AxisDirection[] directions) Packs the given axis directions in a single integer.
-
Field Details
-
directions
final int directionsAxis directions as a maximum of 4 directions packed in a single integer. Each byte is anCodeList.ordinal()
value.- See Also:
-
unit
final short unitEPSG code of the target unit of measurement. Applies only to the two first axes. The third axis, if any, is assumed in metres. -
epsg
final short epsgEPSG code of the coordinate reference system. -
EPSG
All hard-coded EPSG codes known to this class.
-
-
Constructor Details
-
Codes
private Codes(int directions, short unit, short epsg) Creates a new code for the given axis directions and units.
-
-
Method Details
-
pack
private static int pack(org.opengis.referencing.cs.AxisDirection[] directions) Packs the given axis directions in a single integer.- Returns:
- the packed directions, or 0 if the given directions cannot be packed.
-
lookup
static short lookup(javax.measure.Unit<?> unit, org.opengis.referencing.cs.AxisDirection[] directions) Returns the EPSG code for the given axis directions and unit of measurement, or 0 if none.- Parameters:
unit
- the unit of the two first axis. The third axis, if any, is assumed in metres.directions
- axis directions to look for.
-
hashCode
public int hashCode()Returns the hash code value for thisCodes
instance. Note thatlookup(Unit, AxisDirection[])
needs that the hash code excludes the EPSG code. -
equals
Compares thisCodes
instance with the given object for equality. Note thatlookup(Unit, AxisDirection[])
needs that the comparison excludes the EPSG code.
-