Package org.geotools.styling

Examples of org.geotools.styling.SLDParser.readXML()


    @Override
    protected Object read(InputStream in) throws IOException {
        SLDParser parser
            = new SLDParser( CommonFactoryFinder.getStyleFactory(null), in );
      
        Style[] styles = parser.readXML();
        if ( styles.length > 0 ) {
            return styles[0];
        }
        return null;
    }
View Full Code Here


                    if ( styleFile == null ){
                        throw new IOException( "No such file: " + info.getFilename());
                    }
                   
                    SLDParser stylereader = new SLDParser(styleFactory, styleFile);
                    style = stylereader.readXML()[0];
                    //set the name of the style to be the name of hte style metadata
                    // remove this when wms works off style info
                    style.setName( info.getName() );
                    styleCache.put( info, style );
                }
View Full Code Here

        file = new File(PathUtil.fakePathToReal(fakeFilePath));
      }
      if (file.exists() && file.isFile()) {
        StyleFactory styleFactory = new StyleFactoryImpl();
        SLDParser sldParser = new SLDParser(styleFactory, file);
        Style[] styles = sldParser.readXML();
        style = styles[0];
      }
    }

    return style;
View Full Code Here

      } else {
        InputStream stream = DefaultStyleManager.class
            .getResourceAsStream(key + ".sld");
        StyleFactory styleFactory = new StyleFactoryImpl();
        SLDParser sldParser = new SLDParser(styleFactory, stream);
        Style[] styles = sldParser.readXML();
        result = styles[0];
        defaultFeatureStyles.put(key, result);
      }
    }
View Full Code Here

        try {
            reader = charSource.openBufferedStream();

            final SLDParser sldParser = new SLDParser(CommonFactoryFinder.getStyleFactory());
            sldParser.setInput(reader);
            styles = sldParser.readXML();

        } catch (Throwable e) {
            return Optional.absent();
        } finally {
            Closeables.close(reader, true);
View Full Code Here

        StyleFactory factory = CommonFactoryFinder.getStyleFactory(null);

        java.net.URL surl = TestData.getResource(loader, sldFilename);
        SLDParser stylereader = new SLDParser(factory, surl);

        Style style = stylereader.readXML()[0];
        return style;
    }
   
    /**
     * Load a Symbology Encoding style from the test-data directory associated with the object.
View Full Code Here

        StyleFactory factory = StyleFactoryFinder.createStyleFactory();

        java.net.URL surl = TestData.getResource(this, sldFilename);
        SLDParser stylereader = new SLDParser(factory, surl);

        Style style = stylereader.readXML()[0];
        return style;
  }

  private SimpleFeatureCollection createPointFeatureCollection() throws Exception {
    AttributeDescriptor[] types = new AttributeDescriptor[2];
View Full Code Here

        StyleFactory factory = CommonFactoryFinder.getStyleFactory(null);

        java.net.URL surl = TestData.getResource(loader, sldFilename);
        SLDParser stylereader = new SLDParser(factory, surl);

        Style style = stylereader.readXML()[0];
        return style;
    }
}
View Full Code Here

     * Create a Style object from a definition in a SLD document
     */
    private Style createFromSLD(File sld) {
        try {
            SLDParser stylereader = new SLDParser(styleFactory, sld.toURI().toURL());
            Style[] style = stylereader.readXML();
            return style[0];
           
        } catch (Exception e) {
            JExceptionReporter.showDialog(e, "Problem creating style");
        }
View Full Code Here

        StyleFactory factory = CommonFactoryFinder.getStyleFactory(null);
        URL styleURL = TestData.getResource(this, "raster.sld");

        SLDParser stylereader = new SLDParser(factory, styleURL);

        Style style = stylereader.readXML()[0];

        OpacityFinder opacityFinder = new OpacityFinder(new Class[] { RasterSymbolizer.class });

        style.accept(opacityFinder);
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.