no.uio.edd.utils.geoutils
Class GeoPoint

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

public class GeoPoint
extends GeoFeature

Class for storing any geographical point. Currently 2d only.

Author:
oeide

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
GeoPoint(double x, double y)
          Create a new geographical point object given the coordinate for it.
GeoPoint(org.w3c.dom.Node rootNode, java.lang.String offsetMapType, java.lang.String id)
          Create a new geographical point object based on an XML node
 
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.
 GeoPoint getMidpoint()
           
 double getX()
           
 double getY()
           
 GeoPoint moveMe(double offsetX, double offsetY)
           
 double setX(double x)
           
 double setY(double y)
           
static GeoPoint[] toGeoPointArr(ExtendableObjectList objList)
          Convert an ExtendableObjectList containing GeoPoint objects to a GeoPoint array, removing null elements.
 java.lang.String toString()
           
 
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, wait, wait, wait
 

Constructor Detail

GeoPoint

public GeoPoint(double x,
                double y)
Create a new geographical point object given the coordinate for it.

Parameters:
x -
y -

GeoPoint

public GeoPoint(org.w3c.dom.Node rootNode,
                java.lang.String offsetMapType,
                java.lang.String id)
         throws GeoLocationException
Create a new geographical point object based on an XML node

Parameters:
rootNode - The node including the XML describing the ordinates.
offsetMapType - A string describing a map with a different zero meridian than Greenwich. If empty, Greenwich is assumed.
id - A string ID for this object.
Throws:
GeoLocationException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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.

asCoordList

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

getX

public double getX()

getY

public double getY()

setX

public double setX(double x)

setY

public double setY(double y)

toGeoPointArr

public static GeoPoint[] toGeoPointArr(ExtendableObjectList objList)
Convert an ExtendableObjectList containing GeoPoint objects to a GeoPoint array, removing null elements.

Parameters:
objList - The object list.
Returns:
The array.

getMidpoint

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

moveMe

public GeoPoint moveMe(double offsetX,
                       double offsetY)