de.fhg.igd.earth.model.input.shapefile
Class ESRIPoly.ESRIFloatPoly

java.lang.Object
  extended byde.fhg.igd.earth.model.input.shapefile.ShapeUtils
      extended byde.fhg.igd.earth.model.input.shapefile.ESRIPoly
          extended byde.fhg.igd.earth.model.input.shapefile.ESRIPoly.ESRIFloatPoly
Enclosing class:
ESRIPoly

public static class ESRIPoly.ESRIFloatPoly
extends ESRIPoly

Poly with data stored in floating point format. This ESRIPoly has been optimized for reading data in the OpenMap environment. By default, The internal points are stored in y,x,y,x (lat,lon,...) order as radian values. There have been allowances made to allow internal coordinates to be stored as decimal degree values, but this is not the best way to do things. The projection libraries are tuned for polygons holding radian point coordinates.


Nested Class Summary
 
Nested classes inherited from class de.fhg.igd.earth.model.input.shapefile.ESRIPoly
ESRIPoly.ESRIFloatPoly
 
Field Summary
protected  boolean isRadians
          Flag noting if the internal representation of coordinates is in RADIANS, or DECIMAL_DEGREES.
protected  float[] radians
          A vector of vertices, stored as RADIAN y,x,y,x, (lat,lon,...).
 
Fields inherited from class de.fhg.igd.earth.model.input.shapefile.ESRIPoly
nPoints
 
Fields inherited from class de.fhg.igd.earth.model.input.shapefile.ShapeUtils
SHAPE_FILE_HEADER_LENGTH, SHAPE_FILE_HEADER_LENGTH_DB, SHAPE_FILE_RECORD_HEADER_LENGTH, SHAPE_TYPE_ARC, SHAPE_TYPE_MULTIPOINT, SHAPE_TYPE_NULL, SHAPE_TYPE_POINT, SHAPE_TYPE_POLYGON, SHAPE_TYPE_POLYLINE
 
Constructor Summary
ESRIPoly.ESRIFloatPoly(float[] radians)
          Construct an ESRIFloatPoly.
ESRIPoly.ESRIFloatPoly(float[] radians, boolean isRadians)
          Construct an ESRIFloatPoly.
ESRIPoly.ESRIFloatPoly(int nPts)
          Construct a poly with the given number of points.
 
Method Summary
 float[] getDecimalDegrees()
          Get the internal points array.
 float[] getRadians()
          Get the internal points array.
 float getX(int index)
          Returns the x coordinate of the indicated vertex.
 float getY(int index)
          Returns the y coordinate of the indicated vertex.
 int read(byte[] b, int off, boolean connect)
          Reads a polygon from the given buffer starting at the given offset.
 
Methods inherited from class de.fhg.igd.earth.model.input.shapefile.ShapeUtils
readBEInt, readBox, readLEDouble, readLEInt, readLEInt, readLELong, readPoint, writeBEInt, writeBox, writeLEDouble, writeLEInt, writeLELong, writePoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radians

protected float[] radians
A vector of vertices, stored as RADIAN y,x,y,x, (lat,lon,...). This is to allow for optimized processing by OpenMap.


isRadians

protected boolean isRadians
Flag noting if the internal representation of coordinates is in RADIANS, or DECIMAL_DEGREES. By default, the coordinates are in radians. But, a constructor is available to let them be noted as DECIMAL_DEGREES. Also, if you ask for the coordinates as radians, they get converted to radians internally, and this flag gets set accordingly. Likewise, if you as for recimal degrees coordinates, the coordinates internally will be changed to reflect that.

Constructor Detail

ESRIPoly.ESRIFloatPoly

public ESRIPoly.ESRIFloatPoly(int nPts)
Construct a poly with the given number of points. Remember to `+2' if you want all vertices for a polygon.

Parameters:
nPts - the number of (y,x) pairs

ESRIPoly.ESRIFloatPoly

public ESRIPoly.ESRIFloatPoly(float[] radians)
Construct an ESRIFloatPoly. Remember to `+2' if you want all vertices for a polygon.

Parameters:
radians - float[] coordinates: y,x,y,x,... (lat,lon) order in RADIANS!

ESRIPoly.ESRIFloatPoly

public ESRIPoly.ESRIFloatPoly(float[] radians,
                              boolean isRadians)
Construct an ESRIFloatPoly. Remember to `+2' if you want all vertices for a polygon.

Parameters:
radians - float[] coordinates: y,x,y,x,... (lat,lon) order in RADIANS!
Method Detail

getRadians

public float[] getRadians()
Get the internal points array. If the internal points are not presently stored as radians, they will be permanently converted.

Returns:
float[] RADIAN y,x,y,x,... (lat,lon)

getDecimalDegrees

public float[] getDecimalDegrees()
Get the internal points array. If the internal points are not presently stored as decimal degree values, the will be permanently.

Returns:
float[] DECIMAL_DEGREES y,x,y,x,... (lat,lon)

read

public int read(byte[] b,
                int off,
                boolean connect)
Reads a polygon from the given buffer starting at the given offset.

Specified by:
read in class ESRIPoly
Parameters:
b - the buffer
off - the offset
connect - connect the points (polygon)
Returns:
the number of bytes read

getX

public float getX(int index)
Returns the x coordinate of the indicated vertex.

Parameters:
index - the ordinal of the vertex of interest
Returns:
the x (longitude) coordinate in decimal degrees

getY

public float getY(int index)
Returns the y coordinate of the indicated vertex.

Parameters:
index - the ordinal of the vertex of interest
Returns:
the y (latitude) coordinate in decimal degrees


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.