Question & Answer
What are the semantics of the M coordinate (measure)?
An M coordinate, which is also known as "measure", is an additional value that can be stored for each point of a geometry. Measures allow you to store additional information directly in the geometry. Measures are always numeric and are stored as double precision numbers. They can be positive, negative, or zero. Unlike coordinates, measures are not used in DB2® Spatial Extender to define locations, they are used to convey information required by an application.
Spatial Extender provides the functions ST_FindMeasure() and ST_MeasureBetween() to operate on these values. Any further use of the M coordinates will vary, depending on the application.ST_FindMeasure() finds the part of the given geometry that matches exactly the given M coordinate. ST_MeasureBetween() receives two measure values as input and returns the part of the given geometry that has M coordinate values between the two given measures. Note that for polygons, only the boundary of the polygon is used. Both functions use linear interpolation on line segments to produce the most accurate result.
Here are some possible applications of the M coordinates:
- When you are collecting information of the movement of a point over time, you can use the M coordinate to store the time information. Each point has its X, Y, and Z coordinates, which identify the physical location of the point on earth. The M coordinate can identify the time when an object, represented by the point, was at a particular physical location. Here are two examples:
- If you have points identifying the locations where a particular disease has shown up in the population, you can use the M coordinate to identify the date that the outbreak occurred in each location. In this case, the ST_FindMeasure() function is used to find the measure.
- If you are mapping a bus route, each bus stop is identified as a point, using X, Y, and Z coordinates. You can use an M coordinate to identify the time when the bus should arrive relative to the start of the route. In this case also, the ST_FindMeasure() function is used to find the measure.
- When you are collecting additional information about a point other than its location or area.
- If you are mapping the emergency call boxes on a freeway, you can use a linestring to model the freeway and store the information about the call box number in the M coordinates. If you want to get data about how many accidents occurred between call box 15 and call box 32, use the ST_MeasureBetween() function. If you want to collect information about a single point on the freeway, for example, the location of an accident on Highway 85 near call box 32, use the ST_FindMeasure() function.
16 June 2018