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?

  • Welcome to gis.SE. Your problem is intractable if you limit yourself to SQL Server 2008. I'd try to resolve the problem with client side support (like code.google.com/p/nettopologysuite or similar)
    – BradHards
    Feb 26, 2014 at 10:18
  • Thanks for the reply. I am limited to SqlServer (not just 2008), however it doesn't appear that the later versions have any increased spatial capabilities so I have avoided upgrading. NTS looks like it has some interesting functions that I will need to play with...
    – Maximus
    Feb 28, 2014 at 1:56

1 Answer 1


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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.