Maps API for JavaScript Developer's Guide

H.geo.Strip

Class Summary

Extends: H.geo.AbstractGeometry

A Strip is a geometry of connected line segments in geographic space. This class is deprecated, please use H.geo.LineString.
Deprecated:
since 3.0.15.0

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

pushLatLngAlt (lat, lng, alt)

This method pushes a lat, lng, alt to the end of this Strip.

spliceLatLngAlts (index, opt_nRemove, opt_latLngAlts) : {Array<number>}

This method splices the Strip at the provided index, removing the specified number of items at that index and inserting the lat, lng, alt array.

insertLatLngAlt (index, lat, lng, alt)

This method inserts one set of lat, lng, alt values into the Strip at the specified index.

removeLatLngAlt (index)

This method removes one set of lat, lng, alt values from the Strip at the specified index.

pushPoint (geoPoint)

This method pushes the lat, lng, alt values of a H.geo.Point to the end of this Strip.

insertPoint (pointIndex, geoPoint)

This method inserts the lat, lng, alt values of a H.geo.Point into the list at the specified index.

removePoint (pointIndex)

This method removes one set of lat, lng, alt values from this Strip at the virtual point index specified.

extractPoint (pointIndex, opt_out) : {H.geo.Point}

This method extracts a H.geo.Point from this Strip at the virtual point index. If the extracted point has an alt value, the Strip's altitude context will be supplied to the point.

eachLatLngAlt (eachFn, opt_start, opt_end)

A utility method to iterate over points of a strip.

static isDBC (lng1, lng2) : {boolean}

This method checks whether two longitudes form a leg which crosses the date border.

getDBCs (opt_closed) : {number}

This method returns the number of times that legs in this Strip cross the date border.

getPointCount () : {number}

This method return the number of points stored in this Strip.

getLatLngAltArray () : {Array<number>}

Returns the vertices of the line segments as an array of alternating latitude, longitude and altitude coordinates. The returned array must be treated as read-only to not violate the integrity of the strip.

getBounds () : {?H.geo.Rect}

This method returns the bounding box of this Strip.

static fromLatLngArray (latLngs) : {H.geo.Strip}

This method initializes a new Strip with an array of lat, lng values. Arrays are expected to have an even length with the format [lat, lng, lat, lng, ...].

equals (other) : {boolean}

Checks whether the geometry is equal to the geometry supplied by the caller. Two geometries are considered as equal if they represent the same geometry type and have equal coordinate values.

toString () : {!string}

To obtain a Well-Known-Text (WKT) representation of the geometry.

Class Description

A Strip is a geometry of connected line segments in geographic space. This class is deprecated, please use H.geo.LineString.

Constructor Details

H.geo.Strip(opt_latLngAlts, opt_ctx)

Parameters:
 
opt_latLngAlts:
{Array<number>=} [optional]
 
An optional array of latitude, longitude and altitude triples to initialize the Strip with.
opt_ctx:
{H.geo.AltitudeContext=} [optional]
 
An optional altitude context for all altitudes contained in this Strip.
Throws:
 
{H.lang.InvalidArgumentError}
 
in case of invalid lat, lng, alt values

Method Details

pushLatLngAlt (lat, lng, alt)

This method pushes a lat, lng, alt to the end of this Strip.

Parameters:
 
lat:
{H.geo.Latitude}
 
lng:
{H.geo.Longitude}
 
alt:
{H.geo.Altitude}
 
Throws:
 
{H.lang.InvalidArgumentError}
 
in case of invalid lat, lng, alt values

spliceLatLngAlts (index, opt_nRemove, opt_latLngAlts) : {Array<number>}

This method splices the Strip at the provided index, removing the specified number of items at that index and inserting the lat, lng, alt array.

Parameters:
 
index:
{number}
 
The index at which to splice
opt_nRemove:
{number=} [optional]
 
The number of lat, lng, alt values to remove
opt_latLngAlts:
{Array<number>=} [optional]
 
The lat, lng, alt values to add
Returns:
 
{Array<number>}
An array of removed elements
Throws:
 
{H.lang.InvalidArgumentError}
 
in case of invalid opt_latLngAlts argument

insertLatLngAlt (index, lat, lng, alt)

This method inserts one set of lat, lng, alt values into the Strip at the specified index.

Parameters:
 
index:
{number}
 
the index at which to add the element
lat:
{H.geo.Latitude}
 
the latitude to insert
lng:
{H.geo.Longitude}
 
the longitude to insert
alt:
{H.geo.Altitude}
 
the altitude to insert

removeLatLngAlt (index)

This method removes one set of lat, lng, alt values from the Strip at the specified index.

Parameters:
 
index:
{number}
 

pushPoint (geoPoint)

This method pushes the lat, lng, alt values of a H.geo.Point to the end of this Strip.

Parameters:
 
geoPoint:
{H.geo.IPoint}
 
Throws:
 
{H.lang.InvalidArgumentError}
 
in case of invalid geoPoint argument

insertPoint (pointIndex, geoPoint)

This method inserts the lat, lng, alt values of a H.geo.Point into the list at the specified index.

Parameters:
 
pointIndex:
{number}
 
geoPoint:
{H.geo.IPoint}
 

removePoint (pointIndex)

This method removes one set of lat, lng, alt values from this Strip at the virtual point index specified.

Parameters:
 
pointIndex:
{number}
 
the virtual point index

extractPoint (pointIndex, opt_out) : {H.geo.Point}

This method extracts a H.geo.Point from this Strip at the virtual point index. If the extracted point has an alt value, the Strip's altitude context will be supplied to the point.

Parameters:
 
pointIndex:
{number}
 
the virtual point index in the Strip
opt_out:
{H.geo.Point=} [optional]
 
an optional point object to store the lat, lng, alt values
Returns:
 
{H.geo.Point}
Returns either the 'opt_out' point object or a new point object.

eachLatLngAlt (eachFn, opt_start, opt_end)

A utility method to iterate over points of a strip.

Example

// Log the coordinates for certain points of a strip
function eachFn(lat, lng, alt, idx) {
  console.log("point %i (%f, %f, %f)", idx, lat, lng, alt);
}
myStrip.eachLatLngAlt(eachFn, 1, 3);
Parameters:
 
eachFn:
{function(H.geo.Latitude, H.geo.Longitude, H.geo.Altitude, number)}
 
The function to invoke for every point. It gets the point's latitude, longitude, altitude and index as arguments.
opt_start:
{number=} [optional]
 
The point's start index (inclusive) to iterate from, defaults to 0.
opt_end:
{number=} [optional]
 
The point's end index (exclusive) to iterate to, defaults to Infinity.

static isDBC (lng1, lng2) : {boolean}

This method checks whether two longitudes form a leg which crosses the date border.

Parameters:
 
lng1:
{H.geo.Longitude}
 
the start longitude of the leg
lng2:
{H.geo.Longitude}
 
the end longitude of the leg
Returns:
 
{boolean}
true if the leg crosses the date border, otherwise false

getDBCs (opt_closed) : {number}

This method returns the number of times that legs in this Strip cross the date border.

Parameters:
 
opt_closed:
{boolean=} [optional]
 
indicates whether the Strip is closed (i.e. whether the Strip's last and first coordinates form the closing leg of a polygon)
Returns:
 
{number}
The amount of times this Strip crosses the date border.

getPointCount () : {number}

This method return the number of points stored in this Strip.

Returns:
 
{number}
The number of points in this Strip

getLatLngAltArray () : {Array<number>}

Returns the vertices of the line segments as an array of alternating latitude, longitude and altitude coordinates. The returned array must be treated as read-only to not violate the integrity of the strip.

Returns:
 
{Array<number>}
Returns the raw lat, lng, alt values of this Strip

getBounds () : {?H.geo.Rect}

This method returns the bounding box of this Strip.

Note: The Strip is treated as an open path. If the bounding rectangle for a closed shape is required, the closing leg must be merged in an extra step.

Returns:
 
{?H.geo.Rect}
This Strip's bounding rectangle

static fromLatLngArray (latLngs) : {H.geo.Strip}

This method initializes a new Strip with an array of lat, lng values. Arrays are expected to have an even length with the format [lat, lng, lat, lng, ...].

Parameters:
 
latLngs:
{Array<number>}
 
the array of lat, lng value.
Returns:
 
{H.geo.Strip}
The Strip containing the lat, lng values
Throws:
 
{H.lang.InvalidArgumentError}
 
throws an error in case the latLngs array has an odd length

equals (other) : {boolean}

Checks whether the geometry is equal to the geometry supplied by the caller. Two geometries are considered as equal if they represent the same geometry type and have equal coordinate values.

Parameters:
 
other:
{*}
 
The geometry to check against
Returns:
 
{boolean}
true if the two geometries are equal, otherwise false

toString () : {!string}

To obtain a Well-Known-Text (WKT) representation of the geometry.

Returns:
 
{!string}
the resulting WKT string

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.