Home

LineString

LineString is a basic geometry type used in geographic information systems to represent linear features. It consists of an ordered sequence of points, and the line is formed by connecting each consecutive pair of points with straight segments. A LineString contains two or more points and is typically two-dimensional, though it may include a third coordinate for elevation. The geometry is not implicitly closed; if the first and last points coincide, the object may be treated as a LinearRing in polygonal contexts.

LineStrings exist in various coordinate reference systems and dimension options. They can be defined in two

LineStrings are encoded in formats such as WKT and GeoJSON. In WKT, a Linestring is written as

LineStrings are one-dimensional geometries used to represent features like roads, rivers, and utility lines. They have

dimensions
(x,
y)
or
in
three
dimensions
(x,
y,
z).
The
length
of
a
LineString
is
the
sum
of
the
distances
between
successive
points.
In
geographic
coordinates,
length
may
be
computed
geodetically
using
the
curvature
of
the
earth;
in
projected
coordinate
systems,
planar
distance
is
common.
LINESTRING
(x1
y1,
x2
y2,
...).
In
GeoJSON,
a
LineString
is
an
object
with
type
"LineString"
and
coordinates
as
an
array
of
positions,
e.g.,
[[x1,
y1],
[x2,
y2],
...]
(optionally
including
z).
no
area
but
can
participate
in
spatial
analyses
(length,
intersection,
buffering)
and
can
be
combined
into
collections
such
as
MultiLineString
or
used
within
network
datasets.