/** * writes null bounds to the output * * @throws RuntimeException if it is thorwn while writing the element or coordinates */ public void writeNullBounds() { try { String boundedBy = geometryTranslator.getDefaultPrefix() + ":boundedBy"; String nullBox = geometryTranslator.getDefaultPrefix() + ":null"; contentHandler.startElement("", "", boundedBy, NULL_ATTS); contentHandler.startElement("", "", nullBox, NULL_ATTS); contentHandler.characters("unknown".toCharArray(), 0, "unknown".length()); contentHandler.endElement("", "", nullBox); contentHandler.endElement("", "", boundedBy); } catch (SAXException se) { throw new RuntimeException(se); } }
/** * writes the <code>gml:boundedBy</code> element to output based on <code>fc.getBounds() * </code> * * @param bounds * @throws RuntimeException if it is thorwn while writing the element or coordinates */ public void writeBounds(BoundingBox bounds) { try { String boundedBy = geometryTranslator.getDefaultPrefix() + ":" + "boundedBy"; contentHandler.startElement("", "", boundedBy, NULL_ATTS); Envelope env = null; if (bounds != null) { env = new Envelope( new Coordinate(bounds.getMinX(), bounds.getMinY()), new Coordinate(bounds.getMaxX(), bounds.getMaxY())); } geometryTranslator.encode(env, srsName); contentHandler.endElement("", "", boundedBy); } catch (SAXException se) { throw new RuntimeException(se); } }
/** * writes null bounds to the output * * @throws RuntimeException if it is thorwn while writing the element * or coordinates */ public void writeNullBounds() { try { String boundedBy = geometryTranslator.getDefaultPrefix() + ":boundedBy"; String nullBox = geometryTranslator.getDefaultPrefix() + ":null"; contentHandler.startElement("", "", boundedBy, NULL_ATTS); contentHandler.startElement("", "", nullBox, NULL_ATTS); contentHandler.characters("unknown".toCharArray(), 0, "unknown".length()); contentHandler.endElement("", "", nullBox); contentHandler.endElement("", "", boundedBy); } catch (SAXException se) { throw new RuntimeException(se); } }
/** * writes the <code>gml:boundedBy</code> element to output based on * <code>fc.getBounds()</code> * * @param bounds * * @throws RuntimeException if it is thorwn while writing the element * or coordinates */ public void writeBounds(BoundingBox bounds) { try { String boundedBy = geometryTranslator.getDefaultPrefix() + ":" + "boundedBy"; contentHandler.startElement("", "", boundedBy, NULL_ATTS); Envelope env = null; if (bounds != null){ env = new Envelope(new Coordinate(bounds.getMinX(), bounds.getMinY()),new Coordinate(bounds.getMaxX(), bounds.getMaxY())); } geometryTranslator.encode(env, srsName); contentHandler.endElement("", "", boundedBy); } catch (SAXException se) { throw new RuntimeException(se); } }
/** * Constructor with handler. * * @param handler the handler to use. * @param prefix DOCUMENT ME! * @param ns DOCUMENT ME! * @param types DOCUMENT ME! * @param schemaLoc DOCUMENT ME! */ public FeatureTranslator(ContentHandler handler, String prefix, String ns, FeatureTypeNamespaces types, SchemaLocationSupport schemaLoc) { super(handler, prefix, ns, schemaLoc); geometryTranslator = createGeometryTranslator( handler ); this.types = types; this.handler = handler; getNamespaceSupport().declarePrefix(geometryTranslator .getDefaultPrefix(), geometryTranslator.getDefaultNamespace()); memberString = geometryTranslator.getDefaultPrefix() + ":featureMember"; }
/** * writes the <code>gml:boundedBy</code> element to output based on * <code>fc.getBounds()</code> * * @param bounds * * @throws RuntimeException if it is thorwn while writing the element * or coordinates */ public void writeBounds(Envelope bounds) { try { String boundedBy = geometryTranslator.getDefaultPrefix() + ":" + "boundedBy"; contentHandler.startElement("", "", boundedBy, NULL_ATTS); geometryTranslator.encode(bounds, srsName); contentHandler.endElement("", "", boundedBy); } catch (SAXException se) { throw new RuntimeException(se); } }
/** * Constructor with handler. * * @param handler the handler to use. * @param prefix prefix * @param ns namespace * @param types Capture namespace and prefix information for types * @param schemaLoc Schema location information */ public FeatureTranslator(ContentHandler handler, String prefix, String ns, FeatureTypeNamespaces types, SchemaLocationSupport schemaLoc) { super(handler, prefix, ns, schemaLoc); geometryTranslator = createGeometryTranslator( handler ); this.types = types; this.handler = handler; getNamespaceSupport().declarePrefix(geometryTranslator .getDefaultPrefix(), geometryTranslator.getDefaultNamespace()); memberString = geometryTranslator.getDefaultPrefix() + ":featureMember"; }
/** * Constructor with handler. * * @param handler the handler to use. * @param prefix prefix * @param ns namespace * @param types Capture namespace and prefix information for types * @param schemaLoc Schema location information */ public FeatureTranslator( ContentHandler handler, String prefix, String ns, FeatureTypeNamespaces types, SchemaLocationSupport schemaLoc) { super(handler, prefix, ns, schemaLoc); geometryTranslator = createGeometryTranslator(handler); this.types = types; this.handler = handler; getNamespaceSupport() .declarePrefix( geometryTranslator.getDefaultPrefix(), geometryTranslator.getDefaultNamespace()); memberString = geometryTranslator.getDefaultPrefix() + ":featureMember"; }