no.uio.edd.utils.geoutils
Class GeoPolygon

java.lang.Object
  extended by no.uio.edd.utils.geoutils.GeoFeature
      extended by no.uio.edd.utils.geoutils.GeoPolygon

public class GeoPolygon
extends GeoFeature


Nested Class Summary
 
Nested classes/interfaces inherited from class no.uio.edd.utils.geoutils.GeoFeature
GeoFeature.possibleForms
 
Field Summary
 
Fields inherited from class no.uio.edd.utils.geoutils.GeoFeature
coordSyst, coordSystNumeric, KOORD_NAME_GENERALSTABEN, KOORD_NAME_REKTANGEL, MAP_IDENT_GENERALSTABEN, MAP_IDENT_REKTANGEL, myId, OFFSET_CHRA, OFFSET_STHLM
 
Constructor Summary
GeoPolygon(double x1, double y1, double x2, double y2)
          The simplest possible polygon: rectangle parallel to x and y axis of coordinate system.
GeoPolygon(GeoPolyline inGeoPolyline)
           
 
Method Summary
 java.lang.String asCoordList()
           
 java.lang.String asGML()
          The GML fragment returned by this method should contain everything from the level of the specific geometry, that is, from gml:Point, gml:Polygon, etc.
 double changeMySize(double factorLeftDown, double factorRightTop)
          Only works for the simplest possible polygon.
 double getMaxX()
           
 double getMaxY()
           
 GeoPoint getMidpoint()
           
 double getMinX()
           
 double getMinY()
           
 double getMyArea()
           
 double getMyLength()
           
 GeoPolyline getMyLine()
           
 double getMyWidth()
           
 boolean isWithinMe(GeoPoint gp)
           
 boolean isWithinMe(GeoPolygon gp)
           
 boolean isWithinMe(GeoPolyline gp)
           
 GeoPolygon moveMe(double offsetX, double offsetY)
           
 
Methods inherited from class no.uio.edd.utils.geoutils.GeoFeature
getGmlFooter, getGmlHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoPolygon

public GeoPolygon(GeoPolyline inGeoPolyline)

GeoPolygon

public GeoPolygon(double x1,
                  double y1,
                  double x2,
                  double y2)
The simplest possible polygon: rectangle parallel to x and y axis of coordinate system.

Parameters:
x1 - Coordinate 1.
y1 - Coordinate 1.
x2 - Coordinate 2.
y2 - Coordinate 2.
Method Detail

asCoordList

public java.lang.String asCoordList()
Specified by:
asCoordList in class GeoFeature

asGML

public java.lang.String asGML()
Description copied from class: GeoFeature
The GML fragment returned by this method should contain everything from the level of the specific geometry, that is, from gml:Point, gml:Polygon, etc.

Specified by:
asGML in class GeoFeature
Returns:
An XML-GML fragment representing my vector geometry, if application; otherwise, return an empty string.

getMidpoint

public GeoPoint getMidpoint()
Specified by:
getMidpoint in class GeoFeature

moveMe

public GeoPolygon moveMe(double offsetX,
                         double offsetY)

getMyArea

public double getMyArea()

isWithinMe

public boolean isWithinMe(GeoPoint gp)

isWithinMe

public boolean isWithinMe(GeoPolyline gp)

isWithinMe

public boolean isWithinMe(GeoPolygon gp)

getMyLine

public GeoPolyline getMyLine()
Returns:
the myLine

changeMySize

public double changeMySize(double factorLeftDown,
                           double factorRightTop)
Only works for the simplest possible polygon.

Parameters:
factor -
Returns:

getMyLength

public double getMyLength()

getMyWidth

public double getMyWidth()

getMinX

public double getMinX()

getMinY

public double getMinY()

getMaxX

public double getMaxX()

getMaxY

public double getMaxY()