Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Database Engine
Development
 LineString
SQL Server 2008 Books Online (August 2008)
LineString

A LineString is a one-dimensional object representing a sequence of points and the line segments connecting them. A LineString instance must be formed of at least two distinct points, and can also be empty.

The illustration below shows examples of LineString instances.

Examples of geometry LineString instances

As shown in the illustration:

  • Figure 1 is a simple, nonclosed LineString instance.
  • Figure 2 is a nonsimple, nonclosed LineString instance.
  • Figure 3 is a closed, simple LineString instance, and therefore is a ring.
  • Figure 4 is a closed, nonsimple LineString instance, and therefore is not a ring.

The following example shows how to create a geometry LineString instance with three points and an SRID of 0:

DECLARE @g geometry;
SET @g = geometry::STGeomFromText('LINESTRING(1 1, 2 4, 3 9)', 0);

Each point in the LineString instance may contain Z (elevation) and M (measure) values. This example adds M values to the LineString instance created in the example above. M and Z can be null values.

DECLARE @g geometry;
SET @g = geometry::STGeomFromText('LINESTRING(1 1 NULL 0, 2 4 NULL 12.3, 3 9 NULL 24.5)', 0);
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker