Package com.luciad.util
Class TLcdLonLatParser
java.lang.Object
com.luciad.util.TLcdLonLatParser
- All Implemented Interfaces:
ILcdParser
This
ILcdParser
parses various string formats for
longitude/latitude ordinates. The following formats are recognized:
- dd°mm'ss",ddd°mm'ss"
- dd°mm'ss.ss",ddd°mm'ss.ss"
- ddNdddE
- ddmmNdddmmE
- ddmmssNdddmmssE
- dd.ddddNdd.dddddE
- ddmm.mmmmNdddmm.mmmmE
- ddmmss.ssssNdddmmss.ssssE
- xx.x°,xxx.x°
- xx.xx°,xxx.xx°
- xx.xxx°,xxx.xxx°
- xx.xxxx°,xxx.xxxx°
- xx.xxxxx°,xxx.xxxxx°
- xx.xxxxxx°,xxx.xxxxxx°
In these formats, 'd' and 'x' stand for a digit of the degrees, 'm' stands for a digit of the minutes, and 's' stands for a digit of the seconds. Parts of the numbers may be left out, as long as they remain unambiguous. The latitude hemisphere qualifications can be 'N' or 'S', and the longitude hemisphere qualifications can be 'E' or 'W' (all case-insensitive). If the an input strings contains just a single double, it is interpreted as degrees.
The ranges of the input strings are not validated. Input like 306075N will be converted to 31 degrees, 1 minute, and 15 seconds North.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.The pattern property is not used.static final String
Deprecated.The pattern property is not used.static final String
Deprecated.The pattern property is not used.static final String
Deprecated.The pattern property is not used.static final String
Deprecated.The pattern property is not used.static final String
Deprecated.The pattern property is not used.static final String
Deprecated.The pattern property is not used.static final String
Deprecated.The pattern property is not used.static final int
Deprecated.The mode property is not used.static final int
Deprecated.The mode property is not used.static final String
Deprecated.The pattern property is not used.static final String
Deprecated.The pattern property is not used. -
Constructor Summary
ConstructorDescriptionCreates a new TLcdLonLatParser.TLcdLonLatParser
(int aMode) Deprecated.Use the constructor without parameters.TLcdLonLatParser
(String aPattern) Deprecated.Use the constructor without parameters. -
Method Summary
Modifier and TypeMethodDescriptionint
getMode()
Deprecated.The mode property is not used.double
latddmmssAsDouble
(String aString) Parses the given String as a latitude ordinate.double
londdmmssAsDouble
(String aString) Parses the given String as a longitude ordinate.double
londdmmssAsDouble
(String aString, int aDegFieldSize) Deprecated.double
ordinateAsDouble
(String aString) Parses the given String as a longitude or latitude ordinate.Parses the given String as a longitude or latitude ordinate.Deprecated.Use the methodparse(String)
.void
setMode
(int aNewMode) Deprecated.The mode property is not used.void
setPattern
(String aNewPattern) Deprecated.The pattern property is not used.
-
Field Details
-
LATCOORD
public static final int LATCOORDDeprecated.The mode property is not used.Mode property for latitude coordinates.- See Also:
-
LONCOORD
public static final int LONCOORDDeprecated.The mode property is not used.Mode property for longitude coordinates.- See Also:
-
DEFAULT
Deprecated.The pattern property is not used.Default pattern : dd°mm'ss",ddd°mm'ss" .- See Also:
-
DEFAULT2
Deprecated.The pattern property is not used.Default pattern 2: dd°mm'ss.ss",ddd°mm'ss.ss" .- See Also:
-
NSWE
Deprecated.The pattern property is not used.NSWE pattern: ddmmssNdddmmssE .- See Also:
-
NSWE2
Deprecated.The pattern property is not used.NSWE pattern 2: ddmmss.ssssNdddmmss.ssssE .- See Also:
-
DEC_DEG_1
Deprecated.The pattern property is not used.Decimal degrees pattern 1: xx.x°,xxx.x° .- See Also:
-
DEC_DEG_2
Deprecated.The pattern property is not used.Decimal degrees pattern 2: xx.xx°,xxx.xx° .- See Also:
-
DEC_DEG_3
Deprecated.The pattern property is not used.Decimal degrees pattern 3: xx.xxx°,xxx.xxx° .- See Also:
-
DEC_DEG_4
Deprecated.The pattern property is not used.Decimal degrees pattern 4: xx.xxxx°,xxx.xxxx° .- See Also:
-
DEC_DEG_5
Deprecated.The pattern property is not used.Decimal degrees pattern 5: xx.xxxxx°,xxx.xxxxx° .- See Also:
-
DEC_DEG_6
Deprecated.The pattern property is not used.Decimal degrees pattern 6: xx.xxxxxx°,xxx.xxxxxx° .- See Also:
-
-
Constructor Details
-
TLcdLonLatParser
public TLcdLonLatParser()Creates a new TLcdLonLatParser. -
TLcdLonLatParser
public TLcdLonLatParser(int aMode) Deprecated.Use the constructor without parameters.Creates a new TLcdLonLatParser with format patternNSWE
and the given mode.- Parameters:
aMode
- the mode:LONCOORD
orLATCOORD
.
-
TLcdLonLatParser
Deprecated.Use the constructor without parameters.Creates a new TLcdLonLatParser with the given format pattern and modeLATCOORD
.- Parameters:
aPattern
- the pattern.
-
-
Method Details
-
setPattern
Deprecated.The pattern property is not used.The pattern property is not used. This method has an empty implementation.- Parameters:
aNewPattern
- the new pattern.
-
setMode
public void setMode(int aNewMode) Deprecated.The mode property is not used. This method has an empty implementation.The property mode is not used. This method has an empty implementation.- Parameters:
aNewMode
- the new mode:LONCOORD
orLATCOORD
.- See Also:
-
getMode
public int getMode()Deprecated.The mode property is not used. This method always returns -1.Returns -1. The property mode is not used.- Returns:
- always -1
- See Also:
-
parse
Parses the given String as a longitude or latitude ordinate.- Specified by:
parse
in interfaceILcdParser
- Parameters:
aString
- theString
to be parsed.- Returns:
- the resulting ordinate, represented as a new
Double
, ornull
, when the String passed could not be interpreted as an ordinate.
-
parse
Deprecated.Use the methodparse(String)
.The mode parameter is disregarded. Use the methodparse(String)
.- Parameters:
aString
- theString
to be parsed.aMode
- not taken into account.- Returns:
- the resulting ordinate, represented as a new
Double
, ornull
if the parsing failed.
-
latddmmssAsDouble
Parses the given String as a latitude ordinate. This method callsordinateAsDouble(String)
.- Parameters:
aString
- theString
to be parsed.- Returns:
- the resulting latitude ordinate.
- Throws:
NumberFormatException
- if the String is not in a longitude or latitude format that can be parsed.
-
londdmmssAsDouble
Parses the given String as a longitude ordinate. This method callsordinateAsDouble(String)
.- Parameters:
aString
- theString
to be parsed.- Returns:
- the resulting longitude ordinate.
- Throws:
NumberFormatException
- if the String is not in a longitude or latitude format that can be parsed.
-
londdmmssAsDouble
Deprecated.Parses the given String as a longitude ordinate.- Parameters:
aString
- theString
to be parsed.aDegFieldSize
- value in [1,2,3]: 3 means the pattern is dddmmss[EW] (e.g. 0031645E), 2 means the pattern is ddmmss[EW] (e.g. 031645E), 1 means the pattern is dmmss[EW] (e.g. 31645E).- Returns:
- the resulting longitude ordinate.
-
ordinateAsDouble
Parses the given String as a longitude or latitude ordinate.- Parameters:
aString
- theString
to be parsed.- Returns:
- the parsed ordinate.
- Throws:
NumberFormatException
- if the String is not in a longitude or latitude format that can be parsed.
-