Positioning Objects in DIGGSML

What is a CRS?


A CRS is a way of defining where a point actually represents. A point is pretty useless unless you know the coordinate system the point refers to, this may be Ordnance Survey British National Grid, WGS84 Lattitude-Longditude, United States National Grid or a State Grid as required.

However this coordinate system does not have to be a grid, it may also be linear, either straight, segmented (multiple straight line sections) or curved (or a number of others, Affine, Cartesian, Ellipsoidal, Spherical, Cylindrical, Polar, Vertical and Linear).

In this way it is possible to define a Hole's CRS as a linear coordinate system defining the centreline of the Hole in 3D space, with 0 at Ground Level (or 0m AOD if you wish to work in Level rather than Depth) and depths are measured as points along this linear coordinate system, so a point no longer has an Easting and Northing component a point may be a single distance along the Hole's coordinate system.

GML's coordinateReferenceSystems.xsd defines a CoordinateReferenceSystem as:

Quote:

A coordinate reference system consists of an ordered sequence of coordinate system axes that are related to the earth through a datum. A coordinate reference system is defined by one datum and by one coordinate system. Most coordinate reference system do not move relative to the earth, except for engineering coordinate reference systems defined on moving platforms such as cars, ships, aircraft, and spacecraft. For further information, see OGC Abstract Specification Topic 2.

GML's coordinateReferenceSystems.xsd defines a gml:EngineeringCRS as:

Quote:

A contextually local coordinate reference system; which can be divided into two broad categories:
- earth-fixed systems applied to engineering activities on or near the surface of the earth;
- CRSs on moving platforms such as road vehicles, vessels, aircraft, or spacecraft.
For further information, see OGC Abstract Specification Topic 2.

This pretty well fits the requirements of DIGGSML which is based around defining "engineering activities on or near the surface of the earth"!

What's in a gml:EngineeringCRS


Now, an gml:EngineeringCRS is actually made up to three things:
  1. A Name.
  2. A Linear Coordinate System (gml:LinearCS), defining the line along which the CRS refers.
  3. A datum (gml:EngineeringDatum), defining where this reference system starts along that coordinate system.

GML's coordinateSystems.xsd defines a gml:LinearCS as:

Quote:

A one-dimensional coordinate system that consists of the points that lie on the single axis described. The associated ordinate is the distance from the specified origin to the point along the axis. Example: usage of the line feature representing a road to describe points on or along that road. A LinearCS shall have one usesAxis association.

Defining an EngineeringCRS


The first thing you need to define for your gml:EngineeringCRS is it's name, this is a freeform string describing this CRS (e.g "crs_BH127").
Next is the gml:LinearCS, this must also have a name (e.g "cs_BH127"), the gml:LinearCS also needs to include an axis, and this is where DIGGSML comes in, GML doesn't allow you to specifiy the path of an axis, just that it's vertical, horizontal, north etc, so DIGGSML defines a new Axis Object that enables you to specify the LineString path, this is called a "CoordinateSystemAxis" (not a gml:CoordinateSystemAxis, since it's a DIGGSML object). This CoordinateSystemAxis object has a name, an abbreviation, and a loose gml:axisDirection as well as a diggs:axisDirection that allows an xlink:href to the gml:LineString (or a gml:LineString definition in-place) to the axis description line.

Once the Axis is defined all that remains is the Datum, again DIGGSML defines a replacement for the gml:EngineeringDatum, allowing you to specifiy the origin point for this datum in addition to the GML requirement for a name.

After that the CRS is complete, it can be referenced in the file to define a point as a distance along that line.

Here's an example defining the CRS.


Example 1 - Defining a Hole with it's Centre Line Geometry and associated CRS.



 0<Hole>
 1  <hasCRS>
 2    <gml:EngineeringCRS gml:id="crs_bh127">
 3      <gml:srsName>BH127 CRS</gml:srsName>
 4      <gml:usesCS>
 5        <gml:LinearCS gml:id="lcs_bh127">
 6          <gml:csName>BH127 CS</gml:csName>
 7          <gml:usesAxis>
 8            <CoordinateSystemAxis gml:id="axis_BH127" gml:uom="m">
 9              <gml:name>Depth Down Borehole 127</gml:name>
10              <gml:axisAbbrev>D</gml:axisAbbrev>
 1              <gml:axisDirection>Down</gml:axisDirection>
 2            <axisDirection>
 3            <gml:LineString srsName="urn:ogc:def:crs:epsg:6.9:27700" srsDimension="3" gml:id="cl_bh127">
 4              <gml:posList>407415 268653 23.45 407415 268653 24.55</gml:posList>
 5            </gml:LineString>
 6            </axisDirection>
 7          </CoordinateSystemAxis>
 8        </gml:usesAxis>
 9      </gml:LinearCS>  
20    </gml:usesCS>
 1    <gml:usesEngineeringDatum>
 2      <EngineeringDatum gml:id="datum_bh127">
 3        <gml:datumName>BH127 Ground Level</gml:datumName>
 4        <origin>
 5          <gml:Point srsName="urn:ogc:def:crs:epsg:6.9:27700" srsDimension="3">
 6            <gml:pos>407415 268653 23.45</gml:pos>
 7          </gml:Point>
 8        </origin>
 9      </EngineeringDatum>
30    </gml:usesEngineeringDatum>
 1  </gml:EngineeringCRS>
 2  </hasCRS>
 3  
 4  <id codeSpace="keynetix.com">BH127</id>
 5  <name codeSpace="keynetix.com">Borehole 127</name>
 6  <startDateTime>2007-01-01T12:00:00</startDateTime>
 7  <!-- Hole properties follow here... -->
 8</Hole>

How do we position Objects in DIGGSML?


DIGGSML uses the GML concept of the CRS as a way of defining an Object's position. That is you define a custom coordinate system with the purpose of defining the position of an Object and any child objects within that Object.

In this example we can see a Hole object defined (starting on Line 1) with it's associated geometry, including it's centreline string (starting on Line 5) and it's EngineeringCRS (starting on Line 13).

Example 2 - Referencing the CRS path from the Hole's geometry


 0<Hole>
 1  <geometry>
 2    <lines>
 3      <gml:lineStringMember>
 4        <gml:LineString srsName="urn:ogc:def:crs:epsg:6.9:27700" srsDimension="3" gml:id="cl_bh127">
 5          <gml:posList>407415 268653 23.45 407415 268653 22.35</gml:posList>
 6        </gml:LineString>
 7      </gml:lineStringMember>
 8    </lines>
 9  </geometry>
10  <!-- Hole properties including CRS definition follow here... -->
 1</Hole>

A Hole object should include a geometry property, the example above includes the centreline of the hole as a LineString in the geometry. As is usual in GML it makes no sense to redefine this line later in the CRS, so we could replace the LineString in the CRS with a reference to the existing one in the geometry using xlink as shown by changing the following lines in Example 1.
8  <CoordinateSystemAxis gml:id="axis_BH127" gml:uom="m">
9    <gml:name>Depth Down Borehole 127</gml:name>
10   <gml:axisAbbrev>D</gml:axisAbbrev>
 1   <gml:axisDirection>Down</gml:axisDirection>
 2   <axisDirection xlink:href="cl_bh127" />
 3 </CoordinateSystemAxis>

This next more specific example stores heights as a depth from the ground level of the hole, it would be simple to specify a different datum and transfer all heights as elevations (either against AOD or any other national datum, or even a site datum) rather than depths. In piling ground level has variable meaning, various ground levels are defined at SI, at survey, at construction, specifying the CRS to use AOD or a national elevation datum (or site HI) means all positions are done in terms of Elevation (or Level) rather than depth.


Example 3 - Locating properties along an Object's CRS.



01<layers>
 2  <Layer>
 3    <depthTop><gml:pos srsName="crs_bh127">0</gml:pos></depthTop>
 4    <depthBase><gml:pos srsName="crs_bh127">0.75</gml:pos></depthBase>
 5    <system>MajorConstituent</system>
 6    <classification>FILL</classification>
 7    <description>Topsoil</description>
 8  </Layer>
 9  
10  <Layer>
 1    <depthTop><gml:pos srsName="crs_bh127">0.75</gml:pos></depthTop>
 2    <depthBase><gml:pos srsName="crs_bh127">1.1</gml:pos></depthBase>
 3    <system>MajorConstituent</system>
 4    <classification>FILL</classification>
 5    <description>Sandy grey brown soil with many fragments of glass and plastic. MADE GROUND</description>
 6  </Layer>
 7</layers>

The example layers property would fit in at line 43 of the first example, and it shows two examples of locating top and base depths along the Hole's CRS (top at Line 03 and 11, base at 04 and 12). The srsName attributes applied to the gml:pos properties are referencing the CRS for the location of the positions.

Example 4 - Graphical Representation.


bbCode image

This is the graphical representation of that very simple example Hole.

CRS referencing is a complicated area of the framework and can be quite daunting to a novice, hopefully this small example has shown that using a CRS based referencing system is not as hard as it initially looks, and also given a small insight into some of the many benefits of referencing vertical depths/elevations in this way.