public class TLcdBNGUtil extends Object
Constructor and Description |
---|
TLcdBNGUtil()
Constructs a new TLcdBngUtil object
|
Modifier and Type | Method and Description |
---|---|
void |
bng2BngXY(String aBng,
ILcd2DEditablePoint a2DPointSFCT)
Finds the numeric coordinates in the BNG reference system given a string in BNG notation.
|
void |
bng2LonLat(String aBng,
ILcd2DEditablePoint a2DPointSFCT)
Finds the geodetic coordinates of the south-west corner of a square cell expressed in the
British national grid notation.
|
String |
bngXY2Bng(ILcdPoint aBngXYPoint,
int aNumberOfDigits,
boolean aIncludeSpaces)
Transforms a grid point in the BNG reference system into BNG notation.
|
String |
lonLat2Bng(ILcdPoint aLonLatPoint,
int aNumberOfDigits,
boolean aIncludeSpaces)
Converts a lon-lat point (WGS84) into BNG notation.
|
public String lonLat2Bng(ILcdPoint aLonLatPoint, int aNumberOfDigits, boolean aIncludeSpaces) throws TLcdOutOfBoundsException
aLonLatPoint
- point to be converted. The point has to be specified within WGS84!aNumberOfDigits
- defines the number of digits per coordinate in the formatted string.aIncludeSpaces
- defines whether or not a space will be placed after the letters and
between the two numbers in the formatted string.TLcdOutOfBoundsException
- if the coordinate is outside the valid area of the British grid reference system.public void bng2LonLat(String aBng, ILcd2DEditablePoint a2DPointSFCT) throws ParseException
aBng
- the string in BNG notation. The string must contain two letters followed by two numbers
which must both have the same amount of digits.a2DPointSFCT
- a point that will be set to the coordinates of the south-west corner of the BNG cell.ParseException
- if the string is not formatted in valid BNG notation.public String bngXY2Bng(ILcdPoint aBngXYPoint, int aNumberOfDigits, boolean aIncludeSpaces) throws TLcdOutOfBoundsException
aBngXYPoint
- coordinate in BNG reference system.aNumberOfDigits
- defines the number of digits per coordinate in the formatted string.aIncludeSpaces
- defines whether or not a space will be placed after the letters and
between the two numbers in the formatted string.TLcdOutOfBoundsException
- if the coordinate is outside the valid area of the British grid reference system.public void bng2BngXY(String aBng, ILcd2DEditablePoint a2DPointSFCT) throws ParseException
aBng
- the string in BNG notation. The string must contain two letters followed by two numbers
which must both have the same amount of digits.a2DPointSFCT
- a point that will be set to the coordinates in the BNG reference system.ParseException
- if the string is not formatted in valid BNG notation.