Page tree
Skip to end of metadata
Go to start of metadata

Introduced in

Version:1.24

Description

Description:

Translates a VBS position to a different coordinate system.

The conversion only works, if an UTM origin is specified. This can either be done through a geo-referenced map configuration, or by using the setOrigin command.

Syntax

Syntax:posToCoord pos
Parameters:
Return Value:Array - ["latitude","longitude"]

Alternative Syntax

Syntax:posToCoord [pos, format, precision, round]
Parameters:
  • pos: Position3D - 3D position to translate.
  • format: String - Type of coordinate system to return (optional, default: "LL"):
    • "MGRS": returns ["MGRS coord",""]
    • "LL": returns ["latitude","longitude"]
    • "LLMS": returns ["Lat: Deg,Min,Sec", "Long: Deg,Min,Sec"]
    • "UTM": returns ["zone","easting","northing"] - "zone" consists of zone number, followed by the hemisphere letter (N or S) (V1.54+)
    • "UTMB": returns ["zone","easting","northing"] - "zone" consists of zone number, followed by the latitude band letter (A to Z, excluding O and I) (V1.54+)
    • "BNG": returns ["BNG string", ""] (V3.8.1+)
  • precision: Number - Number of digits to return for the MGRS format (maximum is 5).

V2.15+: Can also be applied to LLMS, LL, UTM, and UTMB, which can use values up to 15 (optional, default: 0).

  • round: Boolean - V2.15+: Whether result should be rounded (optional, default: false). The order of the precision and round arguments can be swapped.
Return Value:Array - Position information, depending on the format option. If the conversation fails, then empty strings are returned for both array elements.

Examples

Examples:
posToCoord [[2500,3000], 'LL']; // returns: ["39.58686 N","40.13539 W"]
posToCoord [[2500,3000], 'LLMS']; // returns: ["39` 35' 13'' N","40` 8' 7'' W"]
posToCoord [[2500,3000], 'MGRS']; // returns: ["24SVJ0250082520",""]
posToCoord [[2500,3000], 'UTM']; // returns: ["24N","402500mE","4382520mN"]
posToCoord [[2500,3000], 'UTMB']; // returns: ["24S","402500mE","4382520mN"]
posToCoord [[2500,3000], "UTM",3]; // returns: ["24N","402500.000mE","4382519.999mN"]
posToCoord [[2500,3000], "UTM",3,true]; // returns: ["24N","402500.000mE","4382520.000mN"]

Additional Information

See also: coordToPos, getOrigin, setOrigin, positionToGrid, MGRS, UTM
Multiplayer: 
Problems: 

Notes







Posted on July 27, 2011
Kronzky
Utilities for coordinate conversions and positioning can be found here:


  • GEOTRANS: conversion software by the NGA (National Geospatial-Intelligence Agency)
  • Coord-Fly-To Google: Position finding on Google Earth/Maps via geodesic (LLMS) or MGRS coordinates.