|
deegree 2.2 (2008/12/22 11:33 build-3038-official) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.deegree.model.spatialschema.GMLGeometryAdapter
public class GMLGeometryAdapter
Adapter class for converting GML geometries to deegree geometries and vice versa. Some logical
problems results from the fact that an envelope isn't a geometry according to ISO 19107 (where
the deegree geometry model is based on) but according to GML2/3 specification it is.
So if the wrap(..) method is called with an envelope a Surface will be returned
representing the envelops shape. To export an Envelope to a GML box/envelope two
specialized export methods are available.
The export method(s) doesn't return a DOM element as one may expect but a StringBuffer.
This is done because the transformation from deegree geometries to GML mainly is required when a
GML representation of a geometry shall be serialized to a file or to a network connection. For
both cases the string representation is required and it is simply faster to create the string
directly instead of first creating a DOM tree that after this must be serialized to a string.
In future version geometries will be serialized to a stream.
| Constructor Summary | |
|---|---|
GMLGeometryAdapter()
|
|
| Method Summary | |
|---|---|
static StringBuffer |
export(Geometry geometry)
Creates a GML representation from the passed Geometry. |
static PrintWriter |
export(Geometry geometry,
OutputStream target)
Creates a GML representation from the passed Geometry |
static StringBuffer |
exportAsBox(Envelope envelope)
creates a GML representation from the passed Envelope. |
static StringBuffer |
exportAsEnvelope(Envelope envelope)
creates a GML representation from the passed Envelope. |
static Geometry |
wrap(Element gml)
Deprecated. this method cannot provide default SRS information, please use wrap(Element,String) instead |
static Geometry |
wrap(Element element,
String srsName)
Converts the given DOM representation of a GML geometry to a corresponding Geometry. |
static Geometry |
wrap(String gml)
Deprecated. this method cannot provide default SRS information, please use wrap(String,String) instead |
static Geometry |
wrap(String gml,
String srsName)
Converts the given string representation of a GML geometry object to a corresponding Geometry. |
static Envelope |
wrapBox(Element element)
Deprecated. this method cannot provide default SRS information, please use wrapBox(Element,String) instead |
static Envelope |
wrapBox(Element element,
String srsName)
Returns an instance of Envelope created from the passed gml:Box or
gml:Envelope element. |
protected static Curve |
wrapCurveAsCurve(Element element,
String srsName)
Returns an instance of Curve created from the passed gml:Curve
element. |
protected static MultiCurve |
wrapMultiCurveAsMultiCurve(Element element,
String srsName)
Returns an instance of MultiCurve created from the passed gml:MultiCurve
element. |
protected static MultiSurface |
wrapMultiSurfaceAsMultiSurface(Element element,
String srsName)
Returns an instance of MultiSurface created from the passed
gml:MultiSurface element. |
protected static Surface |
wrapSurfaceAsSurface(Element element,
String srsName)
Returns an instance of Surface created from the passed gml:Surface
element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GMLGeometryAdapter()
| Method Detail |
|---|
public static Geometry wrap(String gml,
String srsName)
throws GeometryException,
XMLParsingException
Geometry. Notice that GML Boxes will be converted to Surfaces because in ISO
19107 Envelopes are no geometries.
gml - srsName - default SRS for the geometry (may be overwritten in geometry elements)
GeometryException
XMLParsingException
public static Geometry wrap(Element element,
String srsName)
throws GeometryException
Geometry. Notice that GML Boxes will be converted to Surfaces because in ISO
19107 Envelopes are no geometries.
Currently, the following conversions are supported:
element - srsName - default SRS for the geometry
Geometry instance
GeometryException - if type unsupported or conversion failed
public static Envelope wrapBox(Element element,
String srsName)
throws XMLParsingException,
InvalidGMLException,
UnknownCRSException
Envelope created from the passed gml:Box or
gml:Envelope element.
element - gml:Box or gml:Envelope elementsrsName - default SRS for the geometry
Envelope
XMLParsingException
InvalidGMLException
UnknownCRSException
protected static Curve wrapCurveAsCurve(Element element,
String srsName)
throws XMLParsingException,
GeometryException,
UnknownCRSException
Curve created from the passed gml:Curve
element.
element - gml:Curve elementsrsName - default SRS for the geometry
XMLParsingException
GeometryException
UnknownCRSException
protected static MultiCurve wrapMultiCurveAsMultiCurve(Element element,
String srsName)
throws XMLParsingException,
GeometryException,
UnknownCRSException,
InvalidGMLException
MultiCurve created from the passed gml:MultiCurve
element.
element - gml:MultiCurve elementsrsName - default SRS for the geometry
MultiCurve instance
XMLParsingException
GeometryException
UnknownCRSException
InvalidGMLException
protected static Surface wrapSurfaceAsSurface(Element element,
String srsName)
throws XMLParsingException,
GeometryException,
UnknownCRSException
Surface created from the passed gml:Surface
element.
element - srsName - default SRS for the geometry
XMLParsingException
GeometryException
UnknownCRSException
protected static MultiSurface wrapMultiSurfaceAsMultiSurface(Element element,
String srsName)
throws XMLParsingException,
GeometryException,
InvalidGMLException,
UnknownCRSException
MultiSurface created from the passed
gml:MultiSurface element.
element - gml:MultiSurface elementsrsName - default SRS for the geometry
XMLParsingException
GeometryException
InvalidGMLException
UnknownCRSException
public static PrintWriter export(Geometry geometry,
OutputStream target)
throws GeometryException
Geometry
- Parameters:
geometry - target -
- Throws:
GeometryException
public static StringBuffer export(Geometry geometry)
throws GeometryException
Geometry.
geometry -
GeometryExceptionpublic static StringBuffer exportAsBox(Envelope envelope)
envelope -
GeometryExceptionpublic static StringBuffer exportAsEnvelope(Envelope envelope)
envelope -
GeometryException
@Deprecated
public static Geometry wrap(String gml)
throws GeometryException,
XMLParsingException
wrap(String,String) instead
Geometry. Notice that GML Boxes will be converted to Surfaces because in ISO
19107 Envelopes are no geometries.
gml -
GeometryException
XMLParsingException
@Deprecated
public static Geometry wrap(Element gml)
throws GeometryException
wrap(Element,String) instead
Currently, the following conversions are supported:
gml -
GeometryException - if type unsupported or conversion failed
@Deprecated
public static Envelope wrapBox(Element element)
throws XMLParsingException,
InvalidGMLException,
UnknownCRSException
wrapBox(Element,String) instead
element - XMLParsingException
InvalidGMLException
UnknownCRSException
|
deegree 2.2 (2008/12/22 11:33 build-3038-official) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net