Show:

An encapsulation of a LineString's points.

Methods

add
(
  • point(s)
)

Adds point(s) to the line string. Also accepts any object with an x and y property.

Parameters:

Example:

lineString.points.add(new gdal.Point(1, 2));
lineString.points.add([
    new gdal.Point(1, 2)
    new gdal.Point(3, 4)
]);`
count () Integer

Returns the number of points that are part of the line string.

Returns:

Integer
forEach
(
  • callback
)

Defined in lib/gdal.js:354

Iterates through all points using a callback function.

Parameters:

  • callback Function

    The callback to be called with each Point

Example:

lineString.points.forEach(function(point, i) { ... });`
get
(
  • index
)
gdal.Point

Returns the point at the specified index.

Parameters:

  • index Integer

    0-based index

Returns:

map
(
  • callback
)

Defined in lib/gdal.js:338

Iterates through all rings using a callback function and builds an array of the returned values.

Parameters:

  • callback Function

    The callback to be called with each LineString

Example:

var result = polygon.rings.map(function(ring, i) {
    return value;
});`
map
(
  • callback
)

Defined in lib/gdal.js:367

Iterates through all points using a callback function and builds an array of the returned values.

Parameters:

  • callback Function

    The callback to be called with each Point

Example:

var result = lineString.points.map(function(point, i) {
    return value;
});`
resize
(
  • count
)

Adjusts the number of points that make up the line string.

Parameters:

  • count Integer
reverse ()

Reverses the order of all the points.

set
(
  • index
  • point
)

Sets the point at the specified index.

Parameters:

Example:

lineString.points.set(0, new gdal.Point(1, 2));`
toArray () Array

Defined in lib/gdal.js:479

Outputs all points as a regular javascript array.

Returns:

Array:

List of Point instances.