|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.askgeo.dbl.base.PolygonData
public class PolygonData
Represents the raw polygonal data of a geographic shape on a map. The PolygonData is the only form of geographic data that can be queried from the subclasses of GeneralMap, so if you are wanting to work with the raw shapes, this is the class that you will be interfacing with.
Geographic shapes in AskGeo are described as complex polygons. By this, we mean the union of multiple closed polygonal chains of latitude and longitude vertexes. Counter-clockwise polygonal chains count as positive area, adding to the shape. Clockwise polygonal chains count as negative area, subtracting from positive areas to create cut-outs. PolygonData objects are not intended to be created by the user. Rather, they are created by a Multigon as an internal operation in constructing a subclass of ResultBase. So to access a PolygonData object, you should query a map with findResult(), which will return a subclass of ResultBase, which has an accessor getPolygonData that will return the corresponding shape's PolygonData. The subclasses of GeneralMap also expose the method getAllResults(), which returns a Vector of all the possible results. If you wish to iterate over the shapes in a map, that is the method you will want to use.
Constructor Summary | |
---|---|
PolygonData(double[][] shapeLatsArr,
double[][] shapeLonsArr,
double[] bbox)
Constructs a new PolygonData object from latitude and longitude arrays, the shape's bounding box, and the shapes area. |
Method Summary | |
---|---|
double |
computeAreaSqKm()
Computes the area in square kilometers. |
double |
getMaxLatitudeDeg()
Returns the upper bound latitude in degrees from the bounding box. |
double |
getMaxLongitudeDeg()
Returns the upper bound longitude in degrees from the bounding box. |
double |
getMinLatitudeDeg()
Returns the lower bound latitude in degrees from the bounding box. |
double |
getMinLongitudeDeg()
Returns the lower bound longitude in degrees from the bounding box. |
int |
getNumNodes()
Returns a count of the total number of nodes (vertexes) in this shape. |
int |
getNumParts()
Returns the number of parts in the polygon data. |
int |
getNumVertexes(int partIndex)
Returns the number of vertexes in the given part. |
double |
getVertexLatitudeDeg(int partIndex,
int vertexIndex)
Returns the latitude in degrees of the given vertex. |
double |
getVertexLongitudeDeg(int partIndex,
int vertexIndex)
Returns the longitude in degrees of the given vertex. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PolygonData(double[][] shapeLatsArr, double[][] shapeLonsArr, double[] bbox)
shapeLatsArr
- the array of latitude values, in radians.shapeLonsArr
- the array of longitude values, in radians.bbox
- the bounding box of the shape.Method Detail |
---|
public int getNumNodes()
public double getMinLatitudeDeg()
public double getMaxLatitudeDeg()
public double getMinLongitudeDeg()
public double getMaxLongitudeDeg()
public int getNumParts()
public int getNumVertexes(int partIndex)
partIndex
- the index of the part.
public double getVertexLatitudeDeg(int partIndex, int vertexIndex)
partIndex
- the part index.vertexIndex
- the vertex index within that part.
public double getVertexLongitudeDeg(int partIndex, int vertexIndex)
partIndex
- the part index.vertexIndex
- the vertex index within that part.
public double computeAreaSqKm()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |