Mapper reads a file that gives measurement information. This file can also include hints to Mapper, so it is easier for the program to calculate the point positions.
Technically speaking, the file format is an XML application,
called Map-Data,
and defined in a Document Type Definition (DTD)
called Map-Data.dtd.
The definitive source of information about the Mapper file format
is this DTD.
This section gives an easier to understand introduction to the format.
The bare minimum file provides no data, it merely declares the units that Mapper should use for computation, and a rectangular region in which points should be expected to lie. Such a skeleton file looks like this:
<?xml version="1.0" standalone="no"?> <!DOCTYPE Map-Data SYSTEM "Map-Data.dtd"> <Map-Data x="0" y="0" width="1" height="1"> <Units angle="degrees" length="m"/> </Map-Data>
A typical Mapper file declares several points for which Mapper must calculate the coordinates, and gives the constraints on the positions of those points (that is, the measurements made). The constraints are grouped together; these groups indicate which constraints have similar accuracy, and declares how accurate the constraints are. The file also indicates the origin of the coordinate system, by declaring the origin to be a fixed point. The points are used to define several terrain features.
We usually have a rough idea of the coordinates of the points.
We should provide these initial guesses to Mapper,
to reduce the calculation effort required.
and because,
in some circumstances (especially with Angle constraints),
Mapper has difficulty calculating the answer
without a reasonable guess.
Here is a typical Mapper data file:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE Map-Data SYSTEM "Map-Data.dtd">
<Map-Data x="00" y="20" width="20" height="20">
<Units angle="degrees" length="m"/>
<Point id="ne" x="20" y="20"/>
<Point id="se" x="20" y="0"/>
<Point id="sw" x="0" y="0"/>
<Point id="nw" x="0" y="20"/>
<Fixed-point point="sw" x="0" y="0"/>
<Constraint-group angle-uncertainty="5" length-uncertainty="1 + 10%">
<Cite>Measurements on Sunday 30 June 2002</Cite>
<Angle at="ne" from="nw" to="se" d="90"/>
<Angle at="se" from="ne" to="sw" d="90"/>
<Angle at="sw" from="se" to="nw" d="90"/>
<Angle at="nw" from="sw" to="ne" d="90"/>
<Bearing from="se" to="ne" d="007"/>
<Distance from="ne" to="nw" d="18"/>
<Distance from="ne" to="se" d="16"/>
</Constraint-group>
<Area-feature class="building">
<Name lang="en">My House</Name>
<Node point="ne"/>
<Line-segment point="se"/>
<Line-segment point="sw"/>
<Line-segment point="nw"/>
</Area-feature>
</Map-Data>
This input file includes a declaration that Mapper should calculate
the position of the north-east corner of the building,
a point named ne,
and provides an initial guess of (20,20) as the coordinates of this point,
thus:
<Point id="ne" x="20" y="20"/>
This input file declares that the south-west corner of the building,
a point named sw,
will be the coordinate origin, by fixing its coordinates to be (0,0), thus:
<Fixed-point point="sw" x="0" y="0"/>
This input file declares several measurements that were measured together and have the same accuracy, (5° for angles, and 1m plus an additional 10% for distances) by placing them in a grouping element them thus:
<Constraint-group angle-uncertainty="5" length-uncertainty="1 + 10%">
<Cite>Measurements on Sunday 30 June 2002</Cite>
</Constraint-group>
This input file declares that the walls of the building are at 90° to each other, using elements such as this:
<Angle at="ne" from="nw" to="se" d="90"/>
This input file declares that the building is oriented 7° east, by giving the bearing of the north-east corner from the south east corner, thus:
<Bearing from="se" to="ne" d="007"/>
This input file declares that the length of the north face of the building (which has the north-east and north-west corners at each end) is 18m thus:
<Distance from="ne" to="nw" d="18"/>
This input file declares that the map represents a building
(called My House
),
which is an area bounded by four straight lines
connecting the corners of the building, thus:
<Area-feature class="building">
<Name lang="en">My House</Name>
<Node point="ne"/>
<Line-segment point="se"/>
<Line-segment point="sw"/>
<Line-segment point="nw"/>
</Area-feature>
This documentation is still being written,
and is therefore incomplete.
$Revision: 6.3 $
$Date: 2002/07/06 15:38:35 $