org.deegree.gml.feature
Class GMLFeatureWriter

java.lang.Object
  extended by org.deegree.gml.feature.GMLFeatureWriter

public class GMLFeatureWriter
extends Object

Stream-based writer for GML-encoded features and feature collections.

Version:
$Revision:$, $Date:$
Author:
Markus Schneider, Andrei Ionita, last edited by: $Author:$

Constructor Summary
GMLFeatureWriter(GMLVersion version, XMLStreamWriter writer, ICRS outputCRS, CoordinateFormatter formatter, String remoteXlinkTemplate, ProjectionClause[] projections, int traverseXlinkDepth, int traverseXlinkExpiry, boolean exportSfGeometries, boolean outputGeometries, Map<String,String> prefixToNs, GMLForwardReferenceHandler additionalObjectHandler, boolean exportExtraProps)
          Creates a new GMLFeatureWriter instance.
 
Method Summary
 void export(Feature feature)
          Exports the given Feature (or FeatureCollection).
 void export(FeatureCollection fc, String noNamespaceSchemaLocation, Map<String,String> bindings)
          TODO merge with other schema location possibilities
 void export(Feature feature, int level)
           
 void export(TypedObjectNode node, int currentLevel, int maxInlineLevels)
           
 boolean isExported(String fid)
          Returns whether the specified feature has already been written.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GMLFeatureWriter

public GMLFeatureWriter(GMLVersion version,
                        XMLStreamWriter writer,
                        ICRS outputCRS,
                        CoordinateFormatter formatter,
                        String remoteXlinkTemplate,
                        ProjectionClause[] projections,
                        int traverseXlinkDepth,
                        int traverseXlinkExpiry,
                        boolean exportSfGeometries,
                        boolean outputGeometries,
                        Map<String,String> prefixToNs,
                        GMLForwardReferenceHandler additionalObjectHandler,
                        boolean exportExtraProps)
Creates a new GMLFeatureWriter instance.

Parameters:
version - GML version of the output, must not be null
writer - xml stream to write to, must not be null
outputCRS - crs used for exported geometries, may be null (in this case, the original crs of the geometries is used)
formatter - formatter to use for exporting coordinates, e.g. to limit the number of decimal places, may be null (fallback to default DecimalCoordinateFormatter)
remoteXlinkTemplate - URI template used to create references to subfeatures that will not be included in the document, e.g. #{}, substring {} is replaced by the object id
projections - controls the properties to be exported, may be null (export all properties)
traverseXlinkDepth - number of subfeature levels to export (0...) or -1 (unlimited)
traverseXlinkExpiry - timeout for resolving remote feature references (currently unsupported)
exportSfGeometries - if true, geometries are exported as SFS geometries (only applies to complex geometries)
outputGeometries - if false, geometry properties are omitted from the output
prefixToNs - namespace bindings to use, may be null
additionalObjectHandler - handler that is invoked when a feature property has to be expanded, may be null
exportExtraProps - if true, ExtraProps associated with features are exported as property elements
Method Detail

export

public void export(Feature feature)
            throws XMLStreamException,
                   UnknownCRSException,
                   TransformationException
Exports the given Feature (or FeatureCollection).

Parameters:
feature - feature to be exported, must not be null
Throws:
XMLStreamException
UnknownCRSException
TransformationException

export

public void export(Feature feature,
                   int level)
            throws XMLStreamException,
                   UnknownCRSException,
                   TransformationException
Throws:
XMLStreamException
UnknownCRSException
TransformationException

export

public void export(FeatureCollection fc,
                   String noNamespaceSchemaLocation,
                   Map<String,String> bindings)
            throws XMLStreamException,
                   UnknownCRSException,
                   TransformationException
TODO merge with other schema location possibilities

Parameters:
fc -
noNamespaceSchemaLocation - may be null
bindings - optional additional schema locations
Throws:
XMLStreamException
TransformationException
UnknownCRSException

isExported

public boolean isExported(String fid)
Returns whether the specified feature has already been written.

Parameters:
fid - feature id, must not be null
Returns:
true, if the feature has been exported, false otherwise

export

public void export(TypedObjectNode node,
                   int currentLevel,
                   int maxInlineLevels)
            throws XMLStreamException,
                   UnknownCRSException,
                   TransformationException
Throws:
XMLStreamException
UnknownCRSException
TransformationException


Copyright © 2011. All Rights Reserved.