Package org.geotools.styling

Examples of org.geotools.styling.SLDTransformer.transform()


            when(this.style.getFormat()).thenReturn("sld");
            ByteArrayOutputStream content = new ByteArrayOutputStream();
            SLDTransformer tx = new SLDTransformer();
            tx.setIndentation(2);
            try {
                tx.transform( style, content );
                resources.resource(Paths.path("workspaces",wsName,"styles",fileName), content.toString() );
            } catch (TransformerException e) {
                throw new RuntimeException(e);
            }
            return this;
View Full Code Here


    protected void print(Object styleObject) {
        try {
            SLDTransformer tx = new SLDTransformer();
            tx.setIndentation(2);
            System.out.println(tx.transform(styleObject));
        } catch (Exception e) {
            throw new RuntimeException("An error occurred while printing the style", e);
        }
    }
View Full Code Here

      return;
    }
    SLDTransformer aTransformer = new SLDTransformer();
    aTransformer.setIndentation(4);
    try {
      String document = aTransformer.transform(style);

      display(document, SLD_1_0);
    } catch (TransformerException e) {
      e.printStackTrace();
      return;
View Full Code Here

        sld.addStyledLayer(layer);
        layer.addUserStyle(style);

        SLDTransformer aTransformer = new SLDTransformer();
        aTransformer.setIndentation(4);
        String xml = aTransformer.transform(sld);
        return xml;
    }

    public Mode determineMode( SimpleFeatureType schema, boolean askUser ) {
        if (schema == null) {
View Full Code Here

        layer.setLayerFeatureConstraints(new FeatureTypeConstraint[]{null});
        sld.addStyledLayer(layer);
        layer.addUserStyle(style);

        SLDTransformer styleTransform = new SLDTransformer();
        String xml = styleTransform.transform(sld);

        return xml;
    }
   
    /**
 
View Full Code Here

    XMLSerializer xmlS = new XMLSerializer();

    SLDTransformer transform = new SLDTransformer();
    transform.setIndentation(2);
    try {
      xmlRule = transform.transform(rule);
      xmlS.setRemoveNamespacePrefixFromElements(true);
      xmlS.setSkipNamespaces(true);
      ruleSz = (JSONObject) xmlS.read(xmlRule);
    } catch (TransformerException e) {
      e.printStackTrace();
View Full Code Here

      nl
    });
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    final SLDTransformer writer = new SLDTransformer();
    try {
      writer.transform(
          sld,
          baos);
    }
    catch (final TransformerException e) {
      LOGGER.warn(
View Full Code Here

            Style style = translator.css2sld(rules);

            SLDTransformer tx = new org.geotools.styling.SLDTransformer();
            tx.setIndentation(2);
            StringWriter sldChars = new java.io.StringWriter();
            tx.transform(style, sldChars);
            return sldChars.toString();
        } catch (Exception e) {
            throw new WicketRuntimeException("Error while parsing stylesheet [" + css + "] : " + e);
        }
    }
View Full Code Here

    XMLSerializer xmlS = new XMLSerializer();

    SLDTransformer transform = new SLDTransformer();
    transform.setIndentation(2);
    try {
      xmlRule = transform.transform(rule);
      xmlS.setRemoveNamespacePrefixFromElements(true);
      xmlS.setSkipNamespaces(true);
      ruleSz = (JSONObject) xmlS.read(xmlRule);
    } catch (TransformerException e) {
      if (LOGGER.isLoggable(Level.FINE))
View Full Code Here

        StyledLayerDescriptor sld = (StyledLayerDescriptor) value;

        SLDTransformer tx = new SLDTransformer();
        try {
            tx.setIndentation(4);
            tx.transform(sld, output);
        } catch (TransformerException e) {
            throw new ServiceException(e);
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.