The Locations File Format is a simple XML file for representing a set of geographic locations with view directions. It can be used, for example, to represent the position and orientation of a camera in the real or virtual world.
The contents of the file have the following structure:
- <locations-file file-format-version="1.0">
- <name> Name </name>
- <point1> X, Y, Z </point1>
- <point2> X, Y, Z </point2>
Name is any text string to identify the location.
X, Y are geographic coordinates, commonly known as longitude and latitude. The element <point1> represents where the location is, and <point2> represents where it is looking. The vector from <point1> to <point2> is the view direction.
Z is the elevation of each point, in meters.
The Datum of the coordinates is implicitly WGS84. If you don't know what a Datum is, you can generally ignore this consideration.
The expected file extension for Location files is .loc
This format does not encode every aspect of real-world cameras - such as field of view, roll, focal length, aspect ratio, etc. This is a deliberate design decision, in order to keep the format simple and allow the receiving environment to control these parameters by itself. However, if desired, one could easily add elements (children of the <location> element) for additional parameters, and the result would remain compatible with applications that expect standard Location files.
honoka'a.loc is a simple file with four locations.
The vtlib library provides support for reading and writing Location files, adding and removing locations, and automatically converts to and from the coordinate system of your terrain. The class
vtLocationSaverprovides this functionality.