| java.lang.Object org.deegree.model.spatialschema.GMLGeometryAdapter
GMLGeometryAdapter | public class GMLGeometryAdapter (Code) | | 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.
author: Andreas Poth author: last edited by: $Author: rbezema $ version: $Revision: 10287 $, $Date: 2008-02-25 09:00:04 -0800 (Mon, 25 Feb 2008) $ |
exportAsBox | public static StringBuffer exportAsBox(Envelope envelope)(Code) | | creates a GML representation from the passed Envelope. This method is required because in ISO 19107
Envelops are no geometries.
Parameters: envelope - throws: GeometryException - |
exportAsEnvelope | public static StringBuffer exportAsEnvelope(Envelope envelope)(Code) | | creates a GML representation from the passed Envelope. This method is required because in ISO 19107
Envelops are no geometries.
Parameters: envelope - throws: GeometryException - |
isGeometrieSupported | public static boolean isGeometrieSupported(String localName)(Code) | | Returns true if the given localName != null or empty and matches one of the following:
- Point
- Center
- LineString
- Polygon
- MultiPoint
- MultiLineString
- MultiPolygon
- Box
- Envelope
- Curve
- Surface
- MultiCurve
- MultiSurface
- CompositeSurface
Parameters: localName - to check. true if localName equal-ignore-case's one of the above strings. |
wrap | public static Geometry wrap(String gml, String srsName) throws GeometryException, XMLParsingException(Code) | | Converts the given string representation of a GML geometry object to a corresponding Geometry .
Notice that GML Boxes will be converted to Surfaces because in ISO 19107 Envelopes are no geometries.
Parameters: gml - Parameters: srsName - default SRS for the geometry (may be overwritten in geometry elements) corresponding geometry object throws: GeometryException - throws: XMLParsingException - |
wrap | public static Geometry wrap(Element element, String srsName) throws GeometryException(Code) | | Converts the given DOM representation of a GML geometry to a corresponding Geometry . Notice that
GML Boxes will be converted to Surfaces because in ISO 19107 Envelopes are no geometries.
Currently, the following conversions are supported:
- GML Point -> Point
- GML MultiPoint -> MultiPoint
- GML LineString -> Curve
- GML MultiLineString -> MultiCurve
- GML Polygon -> Surface
- GML MultiPolygon -> MultiSurface
- GML Box -> Surface
- GML Curve -> Curve
- GML Surface -> Surface
- GML MultiCurve -> MultiCurve
- GML MultiSurface -> MultiSurface
Parameters: element - Parameters: srsName - default SRS for the geometry corresponding Geometry instance throws: GeometryException - if type unsupported or conversion failed |
wrap | public static Geometry wrap(Element gml) throws GeometryException(Code) | | Converts a GML geometry object to a corresponding Geometry. Notice that GML Boxes will be converted
to Surfaces because in ISO 19107 Envelops are no geometries.
Currently, the following conversions are supported:
- GML Point -> Point
- GML MultiPoint -> MultiPoint
- GML LineString -> Curve
- GML MultiLineString -> MultiCurve
- GML Polygon -> Surface
- GML MultiPolygon -> MultiSurface
- GML Box -> Surface
- GML Curve -> Curve
- GML Surface -> Surface
- GML MultiCurve -> MultiCurve
- GML MultiSurface -> MultiSurface
Parameters: gml - the corresponding Geometry throws: GeometryException - if type unsupported or conversion failedGMLGeometryAdapter.wrap(Element,String) |
|
|