LuciadRIA can format point locations as strings in a variety of output formats. This can be useful to display the map position of the mouse cursor in the view, for example. The LuciadRIA samples all show mouse locations on the map.

Longitude-latitude coordinate formatting

The shape/format module offers the class LonLatPointFormat, which allows you to format points from and to longitude-latitude coordinates.

The formatting of the coordinates is determined by a pattern string in EBNF notation:

const format = new LonLatPointFormat({pattern: "lat(+D),lon(+D)"});
console.log(format.format(10, 10));

Other coordinate formatting

  • shape/format/MGRSPointFormat formats points as MGRS or UTM/UPS coordinates. It can also parse MGRS or UTM/UPS strings into points.

  • shape/format/GARSPointFormat formats points as GARS coordinates. It can also parse GARS strings into points.

Refer to the respective documentation for more information.