Package org.geotools.xml.transform

Examples of org.geotools.xml.transform.Translator


                    // delegate and use it; otherwise ignore it
                    final String prefix = this.nsSupport.getPrefix(ns);
                    if (prefix != null)
                        ftrax.getFeatureTypeNamespaces().declareNamespace(featureType, prefix, ns);
                }
                final Translator t = ftrax
                        .createTranslator(this.contentHandler);
                t.encode(fc);
            } catch (IOException ignored) {
            }
            end("InlineFeature");
        }
View Full Code Here


                    + "] distinct entries");
        }
    }

    public Translator createTranslator(ContentHandler handler) {
        Translator result = new SLDTranslator(handler);
        // add pre-configured namespace mappings
        if (!uri2prefix.isEmpty()) {
            for (Iterator it = uri2prefix.entrySet().iterator(); it.hasNext();) {
                Map.Entry e = (Entry) it.next();
                URI uri = (URI) e.getKey();
                if (uri != null) {
                    String prefix = (String) e.getValue();
                    // FIXME handle default namespace and possible clash with
                    // one already known to the namespace-support delegate; i.e.
                    // the entry with an empty prefix
                    String uriStr = String.valueOf(uri);
                    result.getNamespaceSupport().declarePrefix(prefix, uriStr);
                }
            }
        }
        return result;
    }
View Full Code Here

         * Encodes a KML Placemark LookAt
         */
        protected void encodePlacemarkLookAt(Envelope bounds, KMLLookAt lookAtOps) {
           
            KMLLookAtTransformer tr = new KMLLookAtTransformer(bounds, getIndentation(), getEncoding());
            Translator translator = tr.createTranslator(contentHandler);
            if(null == lookAtOps){
                lookAtOps = new KMLLookAt();
            }
            translator.encode(lookAtOps);
        }
View Full Code Here

            if(lookAtOpts != null){
                ReferencedEnvelope bounds = features.getBounds();
                if(bounds != null){
                    KMLLookAtTransformer tx;
                    tx = new KMLLookAtTransformer(bounds, getIndentation(), getEncoding());
                    Translator translator = tx.createTranslator(contentHandler);
                    translator.encode(lookAtOpts);
                }
            }
           
            String relLinks = (String) mapContent.getRequest().getFormatOptions().get("relLinks");
            // Add prev/next links if requested
View Full Code Here

            if (lookAtOpts != null) {
                if (box != null) {
                    KMLLookAtTransformer tx;
                    tx = new KMLLookAtTransformer(box, getIndentation(), getEncoding());
                    Translator translator = tx.createTranslator(contentHandler);
                    translator.encode(lookAtOpts);
                }
            }
           
            start("GroundOverlay");
            // element( "name", feature.getID() );
View Full Code Here

                lookAtEnvelope = bounds;
            }

            KMLLookAtTransformer tr;
            tr = new KMLLookAtTransformer(lookAtEnvelope, getIndentation(), getEncoding());
            Translator translator = tr.createTranslator(contentHandler);
            translator.encode(lookAt);
        }
View Full Code Here

TOP

Related Classes of org.geotools.xml.transform.Translator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.