org.gbanga.api.geojson
Class Polygon

java.lang.Object
  extended by org.gbanga.api.geojson.Geometry
      extended by org.gbanga.api.geojson.Polygon

public class Polygon
extends Geometry

The polygon is a geometry object in the GeoJSON standard.

Author:
Matthias
See Also:
GeoJSON.org, polygon

Field Summary
 float[][][] coordinates
          Polygons consist of an array with one element (outer array) and linear rings (middle array) which consist of coordinates (inner arrays).
 java.lang.String type
          The named type of a GeoJSON polygon.
 
Constructor Summary
Polygon(java.util.Collection<Coordinates> ps)
          Creates a new Polygon with the given sequence of Coordinates.
 
Method Summary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

coordinates

public float[][][] coordinates

Polygons consist of an array with one element (outer array) and linear rings (middle array) which consist of coordinates (inner arrays).

Linear rings are used to describe holes for example

Example:

[  // outer array
   [     // linear ring
     [13.359375, 31.2890625],  // a coordinate 
     [0, 17.9296875], 
     [9.84375, 5.9765625], 
     [45.703125, 2.4609375], 
     [36.5625, 17.2265625], 
     [23.90625, 14.4140625], 
     [21.09375, 23.5546875], 
     [38.671875, 36.9140625], 
     [38.671875, 47.4609375], 
     [13.359375, 57.3046875], 
     [3.515625, 55.1953125], 
     [3.515625, 53.0859375], 
     [13.359375, 31.2890625]
   ]
 ]


type

public java.lang.String type
The named type of a GeoJSON polygon.

Constructor Detail

Polygon

public Polygon(java.util.Collection<Coordinates> ps)
Creates a new Polygon with the given sequence of Coordinates.

Parameters:
ps - a order-sensitive list of Coordinates