public enum Convention extends Enum<Convention>
PRIMEM[…]
and PARAMETER[…]
elements:
AXIS[…]
elements in the WKT.WKT1_COMMON_UNITS
enumeration allows parsing and formatting using the older interpretation.
The WKT1_IGNORE_AXES
enumeration mimics the most minimalist WKT 1 parsers,
but should be avoided when not imposed by compatibility reasons.WKTFormat.getConvention()
,
WKTFormat.setConvention(Convention)
Defined in the sis-metadata
module
Enum Constant and Description |
---|
INTERNAL
A special convention for formatting objects as stored internally by Apache SIS.
|
WKT1
The OGC 01-009 format, also known as “WKT 1”.
|
WKT1_COMMON_UNITS
The Simple Feature format, also known as “WKT 1”.
|
WKT1_IGNORE_AXES
The Simple Feature format without parsing of axis elements.
|
WKT2
The ISO 19162 format, also known as “WKT 2”.
|
WKT2_SIMPLIFIED
The ISO 19162 format with omission of some optional elements.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isSimplified()
Returns
true if this convention is one of the simplified variants of WKT. |
int |
majorVersion()
Returns the major version of the Well Known Text represented by this convention.
|
static Convention |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Convention[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Convention WKT2
Unless otherwise specified by WKTFormat.setNameAuthority(Citation)
, projections
and parameters formatted with this convention will use the EPSG
names when available.
This is the default convention used by FormattableObject.toWKT()
and for new WKTFormat
instances.
public static final Convention WKT2_SIMPLIFIED
WKT2
convention except for the following aspects:
"GeodeticCRS"
instead of "GeodCRS"
) except for the "Unit"
keyword,
because they match the class or interface names.PrimeMeridian
element omitted if the meridian is Greenwich.Axis
element omits the Order
sub-element.Unit
elements are less verbose:Ellipsoid
and VerticalExtent
elements omit the LengthUnit
sub-element
if that unit is SI.METRE
.Parameter
elements omit the LengthUnit
sub-element
if that unit is the same than the unit of the ProjectedCRS
axes.Parameter
and PrimeMeridian
elements omit the AngleUnit
sub-element
if that unit is the same than the unit of the GeodeticCRS
axes.AngleUnit
, LengthUnit
, ScaleUnit
, ParametricUnit
and TimeUnit
are formatted as plain Unit
elements.Id
is formatted only for the root element
(omit parameters and operation methods Id
).This is the default convention used by FormattableObject.toString()
.
public static final Convention WKT1
Unless otherwise specified by WKTFormat.setNameAuthority(Citation)
, projections
and parameters formatted with this convention will use the OGC
names when available.
GeocentricCRS
, WKT 1 uses a legacy set of Cartesian axes
which were defined in OGC 01-009. Those axes use the Other, Easting and Northing
axis directions instead than the geocentric ones.
For more uniform handling of CRS objects in client code, SIS parser replaces some WKT 1 conventions by
the ISO ones when possible.
|
|
public static final Convention WKT1_COMMON_UNITS
This convention is identical to WKT1
except for the following aspects:
PRIMEM
and PARAMETER
elements are always degrees,
no matter the units of the enclosing GEOGCS
element.public static final Convention WKT1_IGNORE_AXES
WKT1_COMMON_UNITS
except that all AXIS[…]
elements are ignored.
Since the WKT 1 specification said that the default axis order shall be (x,y) or
(longitude, latitude), ignoring AXIS[…]
elements is equivalent to forcing
the coordinate systems to that default order.
Note that AXIS[…]
elements still need to be well formed even when parsing a text with this convention.
Malformed axis elements will continue to cause a ParseException
despite their content being ignored.
This convention may be useful for compatibility with some other softwares that do not handle axis order correctly. But except when imposed by such compatibility reasons, this convention should be avoided as much as possible.
@Debug public static final Convention INTERNAL
WKT2_SIMPLIFIED
convention,
with the following differences:
CompoundCRS
shows nested compound CRS if any (the structure is not flattened).Id
elements are formatted for child elements in addition to the root one.Id
element omits the URI
sub-element if the later is derived by Apache SIS
from the Id
properties.Remarks
element is formatted for all
identified objects,
not only CRS or coordinate operations.ImageDatum
includes the Pixel in Cell code.TemporalDatum
includes the Origin date.public static Convention[] values()
for (Convention c : Convention.values()) System.out.println(c);
public static Convention valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int majorVersion()
public boolean isSimplified()
true
if this convention is one of the simplified variants of WKT.
The simplifications are documented in the WKT2_SIMPLIFIED
javadoc.
This methods consider version 1 of WKT as a “simplified” convention, since this version was indeed simpler than version 2.
true
it this convention uses a simplified variant of WKT.Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.