HERE Android SDK Developer's Guide

CLE2PolygonGeometry

The class CLE2PolygonGeometry is a member of com.here.android.mpa.customlocation2 .

Class Summary

public final class CLE2PolygonGeometry

extends com.here.android.mpa.customlocation2.CLE2Geometry, java.lang.Object

Specifies a user-defined polygon geometry.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in CLE2PolygonGeometry
Constructors

CLE2PolygonGeometry (GeoPolygon outerRing, java.util.List <GeoPolygon> innerRings)

Creates a new polygon geometry with outer ring (shape) and inner rings (holes).

Method Summary

Table 2. Methods in CLE2PolygonGeometry
Methods

public java.util.List <GeoPolygon> getInnerRings ()

Gets the all inner ring of this geometry.

public GeoPolygon getOuterRing ()

Gets the outer ring GeoPolygon of this geometry.

public void setPolygon (GeoPolygon outerRing)

Sets the shape of this polygon to a solid one without any holes.

public void setPolygon (GeoPolygon outerRing, java.util.List <GeoPolygon> innerRings)

Sets the geometry of this polygon with outer ring (shape) and inner rings (holes).

Class Details

Specifies a user-defined polygon geometry. The polygon geometry represent a list of GeoPolygon

Note: The concept of polygon in WKT (Well Known Text) format consists of one outer ring/polygon, plus zero or more inner rings/polygons. We map the WKT concept here with a GeoPolygon outer ring object, and a list of GeoPolygon as the inner rings (if any).

Constructor Details

CLE2PolygonGeometry (GeoPolygon outerRing, java.util.List <GeoPolygon> innerRings)

Creates a new polygon geometry with outer ring (shape) and inner rings (holes). Input polygons can be "closed" (ie. having the same first and last vertex) or not, both options are valid.

Parameters:

  • outerRing

    the outer boundary of the polygon, defining its shape

  • innerRings

    list if inner rings of the polygon, defining holes in the main shape, will be ignored if null or empty

Throws:

  • IllegalArgumentException

    when outerRing is null or invalid, meaning it is not a polygon with an area greater than 0, or when innerRings contains null or invalid elements

Method Details

public java.util.List <GeoPolygon> getInnerRings ()

Gets the all inner ring of this geometry. The polygons returned by this method are always "closed", meaning that its last vertex is the same as the first one.

Returns:

a list of GeoPolygon defining holes in the polygon

public GeoPolygon getOuterRing ()

Gets the outer ring GeoPolygon of this geometry. The polygon returned by this method is always "closed", meaning that its last vertex is the same as the first one.

Returns:

GeoPolygon defining the shape of this polygon

public void setPolygon (GeoPolygon outerRing)

Sets the shape of this polygon to a solid one without any holes.

Parameters:

  • outerRing

    the outer boundary of the polygon, defining its shape

Throws:

  • IllegalArgumentException

    when outerRing is null or invalid, meaning it is not a polygon with an area greater than 0

public void setPolygon (GeoPolygon outerRing, java.util.List <GeoPolygon> innerRings)

Sets the geometry of this polygon with outer ring (shape) and inner rings (holes). Input polygons can be "closed" (ie. having the same first and last vertex) or not, both options are valid.

Parameters:

  • outerRing

    the outer boundary of the polygon, defining its shape

  • innerRings

    list if inner rings of the polygon, defining holes in the main shape, will be ignored if null or empty

Throws:

  • IllegalArgumentException

    when outerRing is null or invalid, meaning it is not a polygon with an area greater than 0, or when innerRings contains null or invalid elements

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.