org.deegree.gml.geometry
Class GML2GeometryReader

java.lang.Object
  extended by org.deegree.gml.geometry.GML2GeometryReader
All Implemented Interfaces:
GMLGeometryReader

public class GML2GeometryReader
extends Object
implements GMLGeometryReader

The GML2GeometryReader parses the geometry elements in GML 2.1 documents. The following geometries are supported:

Version:
$Revision: 31639 $, $Date: 2011-08-24 21:02:10 +0200 (Wed, 24 Aug 2011) $
Author:
Andrei Ionita, last edited by: $Author: mschneider $

Constructor Summary
GML2GeometryReader()
           
GML2GeometryReader(GeometryFactory geomFac, GMLDocumentIdContext idContext)
           
 
Method Summary
 GMLDocumentIdContext getDocumentIdContext()
          Returns the GMLDocumentIdContext that keeps track of objects, identifieres and references.
 boolean isGeometryElement(QName elName)
          Returns whether the given element name denotes a GML 2... geometry element (a concrete element substitutable for "gml:_Geometry").
 boolean isGeometryElement(XMLStreamReader reader)
           
 boolean isGeometryOrEnvelopeElement(XMLStreamReader reader)
           
 Geometry parse(XMLStreamReaderWrapper xmlStream)
           
 Geometry parse(XMLStreamReaderWrapper xmlStream, ICRS defaultCRS)
           
protected  double[] parseCoordType(XMLStreamReaderWrapper xmlStream)
           
 Envelope parseEnvelope(XMLStreamReaderWrapper xmlStream)
           
 Envelope parseEnvelope(XMLStreamReaderWrapper xmlStream, ICRS defaultCRS)
           
 Geometry parseGeometryOrBox(XMLStreamReaderWrapper xmlStream)
          Parse the current geometry or bbox, the given stream is pointing to.
 Geometry parseGeometryOrBox(XMLStreamReaderWrapper xmlStream, CRS defaultCRS)
           
 Geometry parseGeometryOrEnvelope(XMLStreamReaderWrapper xmlStream)
          Parse the current geometry or bbox, the given stream is pointing to.
 Geometry parseGeometryOrEnvelope(XMLStreamReaderWrapper xmlStream, ICRS defaultCRS)
          Parse the current geometry or envelope the given stream is pointing to.
 Ring parseLinearRing(XMLStreamReaderWrapper xmlStream)
           
 Ring parseLinearRing(XMLStreamReaderWrapper xmlStream, ICRS defaultCRS)
           
 LineString parseLineString(XMLStreamReaderWrapper xmlStream)
           
 LineString parseLineString(XMLStreamReaderWrapper xmlStream, ICRS defaultCRS)
           
 MultiGeometry<Geometry> parseMultiGeometry(XMLStreamReaderWrapper xmlStream)
           
 MultiGeometry<Geometry> parseMultiGeometry(XMLStreamReaderWrapper xmlStream, ICRS defaultCRS)
           
 MultiLineString parseMultiLineString(XMLStreamReaderWrapper xmlStream)
           
 MultiLineString parseMultiLineString(XMLStreamReaderWrapper xmlStream, ICRS defaultCRS)
           
 MultiPoint parseMultiPoint(XMLStreamReaderWrapper xmlStream)
           
 MultiPoint parseMultiPoint(XMLStreamReaderWrapper xmlStream, ICRS defaultCRS)
           
 MultiPolygon parseMultiPolygon(XMLStreamReaderWrapper xmlStream)
           
 MultiPolygon parseMultiPolygon(XMLStreamReaderWrapper xmlStream, ICRS defaultCRS)
           
 Point parsePoint(XMLStreamReaderWrapper xmlStream)
           
 Point parsePoint(XMLStreamReaderWrapper xmlStream, ICRS defaultCRS)
           
 Polygon parsePolygon(XMLStreamReaderWrapper xmlStream)
           
 Polygon parsePolygon(XMLStreamReaderWrapper xmlStream, ICRS defaultCRS)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GML2GeometryReader

public GML2GeometryReader()

GML2GeometryReader

public GML2GeometryReader(GeometryFactory geomFac,
                          GMLDocumentIdContext idContext)
Parameters:
geomFac -
idContext -
Method Detail

getDocumentIdContext

public GMLDocumentIdContext getDocumentIdContext()
Returns the GMLDocumentIdContext that keeps track of objects, identifieres and references.

Returns:
the GMLDocumentIdContext, never null

parse

public Geometry parse(XMLStreamReaderWrapper xmlStream)
               throws XMLStreamException
Specified by:
parse in interface GMLGeometryReader
Parameters:
xmlStream -
Returns:
Throws:
XMLStreamException

isGeometryElement

public boolean isGeometryElement(XMLStreamReader reader)
Specified by:
isGeometryElement in interface GMLGeometryReader
Returns:
true if stream's event is an XMLStreamConstants.START_ELEMENT && the current element's name is a known geometry.

isGeometryOrEnvelopeElement

public boolean isGeometryOrEnvelopeElement(XMLStreamReader reader)
Specified by:
isGeometryOrEnvelopeElement in interface GMLGeometryReader
Returns:
true if stream's event is an XMLStreamConstants.START_ELEMENT && the current element's name is an envelope.

isGeometryElement

public boolean isGeometryElement(QName elName)
Returns whether the given element name denotes a GML 2... geometry element (a concrete element substitutable for "gml:_Geometry").

Parameters:
elName - qualified element name to check
Returns:
true, if the element is a GML 2.y.z. geometry element, false otherwise

parse

public Geometry parse(XMLStreamReaderWrapper xmlStream,
                      ICRS defaultCRS)
               throws XMLStreamException
Specified by:
parse in interface GMLGeometryReader
Parameters:
xmlStream -
defaultCRS -
Returns:
Throws:
XMLStreamException

parseGeometryOrEnvelope

public Geometry parseGeometryOrEnvelope(XMLStreamReaderWrapper xmlStream)
                                 throws XMLParsingException,
                                        XMLStreamException,
                                        UnknownCRSException
Parse the current geometry or bbox, the given stream is pointing to.

Parameters:
xmlStream -
Returns:
the Geometry (or Envelope) the given stream is pointing to.
Throws:
XMLParsingException
XMLStreamException
UnknownCRSException

parseGeometryOrBox

public Geometry parseGeometryOrBox(XMLStreamReaderWrapper xmlStream)
                            throws XMLParsingException,
                                   XMLStreamException,
                                   UnknownCRSException
Parse the current geometry or bbox, the given stream is pointing to.

Parameters:
xmlStream -
Returns:
the Geometry (or Envelope) the given stream is pointing to.
Throws:
XMLParsingException
XMLStreamException
UnknownCRSException

parseGeometryOrBox

public Geometry parseGeometryOrBox(XMLStreamReaderWrapper xmlStream,
                                   CRS defaultCRS)
                            throws XMLParsingException,
                                   XMLStreamException,
                                   UnknownCRSException
Parameters:
xmlStream -
defaultCRS -
Returns:
Throws:
XMLParsingException
XMLStreamException
UnknownCRSException

parseGeometryOrEnvelope

public Geometry parseGeometryOrEnvelope(XMLStreamReaderWrapper xmlStream,
                                        ICRS defaultCRS)
                                 throws XMLParsingException,
                                        XMLStreamException,
                                        UnknownCRSException
Description copied from interface: GMLGeometryReader
Parse the current geometry or envelope the given stream is pointing to.

Specified by:
parseGeometryOrEnvelope in interface GMLGeometryReader
Returns:
the Geometry (or Envelope) the given stream is pointing to.
Throws:
XMLParsingException
XMLStreamException
UnknownCRSException

parseMultiPolygon

public MultiPolygon parseMultiPolygon(XMLStreamReaderWrapper xmlStream)
                               throws XMLStreamException
Parameters:
xmlStream -
Returns:
Throws:
XMLStreamException

parseMultiPolygon

public MultiPolygon parseMultiPolygon(XMLStreamReaderWrapper xmlStream,
                                      ICRS defaultCRS)
                               throws XMLStreamException
Parameters:
xmlStream -
defaultCRS -
Returns:
Throws:
XMLStreamException

parseMultiLineString

public MultiLineString parseMultiLineString(XMLStreamReaderWrapper xmlStream)
                                     throws XMLStreamException
Parameters:
xmlStream -
Returns:
Throws:
XMLStreamException

parseMultiLineString

public MultiLineString parseMultiLineString(XMLStreamReaderWrapper xmlStream,
                                            ICRS defaultCRS)
                                     throws XMLStreamException
Parameters:
xmlStream -
defaultCRS -
Returns:
Throws:
XMLStreamException

parseMultiPoint

public MultiPoint parseMultiPoint(XMLStreamReaderWrapper xmlStream)
                           throws XMLStreamException
Parameters:
xmlStream -
Returns:
Throws:
XMLStreamException

parseMultiPoint

public MultiPoint parseMultiPoint(XMLStreamReaderWrapper xmlStream,
                                  ICRS defaultCRS)
                           throws XMLStreamException
Parameters:
xmlStream -
defaultCRS -
Returns:
Throws:
XMLStreamException

parseMultiGeometry

public MultiGeometry<Geometry> parseMultiGeometry(XMLStreamReaderWrapper xmlStream)
                                           throws XMLStreamException
Parameters:
xmlStream -
Returns:
Throws:
XMLStreamException

parseMultiGeometry

public MultiGeometry<Geometry> parseMultiGeometry(XMLStreamReaderWrapper xmlStream,
                                                  ICRS defaultCRS)
                                           throws XMLStreamException
Parameters:
xmlStream -
defaultCRS -
Returns:
Throws:
XMLStreamException

parseEnvelope

public Envelope parseEnvelope(XMLStreamReaderWrapper xmlStream)
                       throws XMLStreamException
Parameters:
xmlStream -
Returns:
Throws:
XMLStreamException

parseEnvelope

public Envelope parseEnvelope(XMLStreamReaderWrapper xmlStream,
                              ICRS defaultCRS)
                       throws XMLStreamException
Specified by:
parseEnvelope in interface GMLGeometryReader
Parameters:
xmlStream -
defaultCRS -
Returns:
Throws:
XMLStreamException

parseLineString

public LineString parseLineString(XMLStreamReaderWrapper xmlStream)
                           throws XMLStreamException
Parameters:
xmlStream -
Returns:
Throws:
XMLStreamException

parseLineString

public LineString parseLineString(XMLStreamReaderWrapper xmlStream,
                                  ICRS defaultCRS)
                           throws XMLStreamException
Parameters:
xmlStream -
defaultCRS -
Returns:
Throws:
XMLStreamException

parsePolygon

public Polygon parsePolygon(XMLStreamReaderWrapper xmlStream)
                     throws XMLStreamException
Parameters:
xmlStream -
Returns:
Throws:
XMLStreamException

parsePolygon

public Polygon parsePolygon(XMLStreamReaderWrapper xmlStream,
                            ICRS defaultCRS)
                     throws XMLStreamException
Parameters:
xmlStream -
defaultCRS -
Returns:
Throws:
XMLStreamException

parseLinearRing

public Ring parseLinearRing(XMLStreamReaderWrapper xmlStream)
                     throws XMLStreamException
Parameters:
xmlStream -
Returns:
Throws:
XMLStreamException

parseLinearRing

public Ring parseLinearRing(XMLStreamReaderWrapper xmlStream,
                            ICRS defaultCRS)
                     throws XMLStreamException
Parameters:
xmlStream -
defaultCRS -
Returns:
Throws:
XMLStreamException

parsePoint

public Point parsePoint(XMLStreamReaderWrapper xmlStream)
                 throws XMLStreamException
Parameters:
xmlStream -
Returns:
Throws:
XMLStreamException

parsePoint

public Point parsePoint(XMLStreamReaderWrapper xmlStream,
                        ICRS defaultCRS)
                 throws XMLStreamException
Parameters:
xmlStream -
defaultCRS -
Returns:
Throws:
XMLStreamException

parseCoordType

protected double[] parseCoordType(XMLStreamReaderWrapper xmlStream)
                           throws XMLStreamException
Parameters:
xmlStream -
Returns:
Throws:
XMLStreamException


Copyright © 2011. All Rights Reserved.