[GIS] Using M ‘Measure’ value in SQL Server 2008

geometryintersectionlinear-referencingnetsql server

MS Sql Server 2008 geometry type supports adding Z and M values to geometry objects, including linestrings. However, I cannot find any way to make use of these values, since methods such as .STIntersection() return a 2D point.

My end goal is to find where a given point intersects with a linestring and then find the equivalent Z and M values.

Googling and scouring Technet has yielded no useful information other than to make me wish I was using PostgreSql instead, which seems to include the functionality I require (unfortunately I am constrained to Sql Server).

Does anyone know how to actually make use of the Z and M values within linestrings, or of any toolsets that provide this functionality?

Best Answer

Both these values are user defined. While the Z-measure is defined as the elevation, the unit definition (feet, meters, furlongs, etc) is left up to the developer. The Measure variable isn't even defined what it means, and could be anything that's a single value.

Since neither of these are well defined, none of the built in tools can use them. Defining the tools and the meaning are left up to the developer.

From the SQL Server documentation:

The Z (elevation) value of the instance. The semantics of the elevation value are user-defined.

and

The semantics of the measure value are user-defined but generally describe the distance along a linestring. For example, the measure value could be used to keep track of mileposts along a road.

M values are not used in any calculations made by the library and will not be carried through any library calculations.