Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.io.gml.geometry
Class GMLGeometryUtil

java.lang.Object
  extended by eu.esdihumboldt.hale.io.gml.geometry.GMLGeometryUtil

public abstract class GMLGeometryUtil
extends Object

Utility methods for reading GML geometries from an Instance model.

Author:
Simon Templer

Constructor Summary
GMLGeometryUtil()
           
 
Method Summary
static CRSDefinition findCRS(Instance instance)
          Find the CRS definition to be associated with the geometry contained in the given instance.
static com.vividsolutions.jts.geom.Coordinate parseCoord(Instance instance)
          Parse a coordinate from a GML CoordType instance.
static com.vividsolutions.jts.geom.Coordinate[] parseCoordinates(Instance coordinates)
          Parse coordinates from a GML CoordinatesType instance.
static com.vividsolutions.jts.geom.Coordinate parseDirectPosition(Instance directPosition)
          Parse a coordinate from a GML DirectPositionType instance.
static com.vividsolutions.jts.geom.Coordinate[] parsePosList(Instance posList, int srsDimension)
          Parse a coordinate from a GML PosList instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GMLGeometryUtil

public GMLGeometryUtil()
Method Detail

parseCoordinates

public static com.vividsolutions.jts.geom.Coordinate[] parseCoordinates(Instance coordinates)
                                                                 throws ParseException
Parse coordinates from a GML CoordinatesType instance.

Parameters:
coordinates - the coordinates instance
Returns:
the coordinates or null if the instances contains no coordinates
Throws:
ParseException - if parsing the coordinates fails

parseDirectPosition

public static com.vividsolutions.jts.geom.Coordinate parseDirectPosition(Instance directPosition)
                                                                  throws GeometryNotSupportedException
Parse a coordinate from a GML DirectPositionType instance.

Parameters:
directPosition - the direct position instance
Returns:
the coordinate or null if the instance contains not direct position
Throws:
GeometryNotSupportedException - if no valid coordinate could be created from the direct position

parsePosList

public static com.vividsolutions.jts.geom.Coordinate[] parsePosList(Instance posList,
                                                                    int srsDimension)
                                                             throws GeometryNotSupportedException
Parse a coordinate from a GML PosList instance.

Parameters:
posList - the PosList instance
srsDimension - the Dimension of the instance
Returns:
the array of the coordinates or null if the instance contains not a PosList
Throws:
GeometryNotSupportedException - if no valid coordinate could be created from the PosList

parseCoord

public static com.vividsolutions.jts.geom.Coordinate parseCoord(Instance instance)
                                                         throws GeometryNotSupportedException
Parse a coordinate from a GML CoordType instance.

Parameters:
instance - the coord instance
Returns:
the coordinate
Throws:
GeometryNotSupportedException - if a valid coordinate can't be created

findCRS

public static CRSDefinition findCRS(Instance instance)
Find the CRS definition to be associated with the geometry contained in the given instance.

Parameters:
instance - the given instance
Returns:
the CRS definition or null if none could be identified

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d