HERE Android SDK Developer's Guide

GeoPolygon

The class GeoPolygon is a member of com.here.android.mpa.common .

Class Summary

public final class GeoPolygon

extends com.here.android.mpa.common.GeoPolyline, java.lang.Object

Represents a GeoPolygon a polygon object defined in terms of the geographic coordinates of its vertices.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in GeoPolygon
Constructors

GeoPolygon ()

Default Constructor

GeoPolygon (java.util.List <GeoCoordinate> points)

Constructor that creates a new instance of GeoPolygon from a list of points.

Method Summary

Table 2. Methods in GeoPolygon
Methods

public boolean equals (Object other)

Checks whether the given GeoPolygon object is equal to that supplied by the caller.

public int hashCode ()

Obtains the hash code for the given object.

Class Details

Represents a GeoPolygon a polygon object defined in terms of the geographic coordinates of its vertices.

The only difference between a GeoPolygon and a GeoPolyline is that the polygon represents a closed loop of points. The minimum number of points in a GeoPolygon must be three.

This class can be used with MapPolygon to render a polygon.

Constructor Details

GeoPolygon ()

Default Constructor

GeoPolygon (java.util.List <GeoCoordinate> points)

Constructor that creates a new instance of GeoPolygon from a list of points.

Parameters:

  • points

    A list of points to form the GeoPolygon.

See also:

MapPolygon

Method Details

public boolean equals (Object other)

Checks whether the given GeoPolygon object is equal to that supplied by the caller. Two objects are equal if they are both instances of GeoPolygon and the coordinates of their vertices are the same.

Parameters:

  • other

    A polygon object to compare to the given polygon.

Returns:

true if the polygons are equal, otherwise false.

public int hashCode ()

Obtains the hash code for the given object.

Returns:

A value representing the hash code.