mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 14:11:02 +01:00
Catch when OS grid references aren't calculated
This commit is contained in:
parent
ad4451a757
commit
5e68959c03
@ -81,6 +81,9 @@ export function convertCoordinates (inLat, inLong, inFormat, outFormat, precisio
|
||||
const latlon = new geodesy.LatLonEllipsoidal(parseFloat(convLat), parseFloat(convLong));
|
||||
const osng = geodesy.OsGridRef.latLonToOsGrid(latlon);
|
||||
convLat = osng.toString();
|
||||
if (convLat === "") {
|
||||
throw "Couldn't convert co-ordinates to Ordnance Survey National Grid. Are they out of range?";
|
||||
}
|
||||
} else {
|
||||
convLat = convertSingleCoordinate(convLat.toString(), "Decimal Degrees", outFormat, precision);
|
||||
convLong = convertSingleCoordinate(convLong.toString(), "Decimal Degrees", outFormat, precision);
|
||||
|
Loading…
Reference in New Issue
Block a user