Examples of parseSLD()


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

        }
        // parse it up
        SLDParser parser = new SLDParser(styleFactory);
        try {
            parser.setInput(file);
            StyledLayerDescriptor sld = parser.parseSLD();
            return sld;
        } catch (FileNotFoundException e) {
            return null; // well that is unexpected since f.exists()
        }
    }
View Full Code Here

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

     * @return the styled layer descriptor.
     * @throws IOException
     */
    public static StyledLayerDescriptor readStyle( File file ) throws IOException {
        SLDParser stylereader = new SLDParser(sf, file);
        StyledLayerDescriptor sld = stylereader.parseSLD();
        return sld;
    }

    /**
     * Creates an image from a set of {@link RuleWrapper}s.
View Full Code Here

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

        //save changes to style object
        StyleFactory factory = StyleFactoryFinder.createStyleFactory();
        InputStream is = getXMLasInputStream(xml, encoding);
        if (is == null) return null;
        SLDParser stylereader = new SLDParser(factory, is);
        StyledLayerDescriptor sld = stylereader.parseSLD();
        return sld;
    }
   
    private InputStream getXMLasInputStream(String xml, String encoding) {
        InputStream is = null;
View Full Code Here

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

   
    @Override
    public Object importFrom( File file, IProgressMonitor monitor ) throws Exception {
        StyleFactory factory = CommonFactoryFinder.getStyleFactory( null );
        SLDParser stylereader = new SLDParser(factory, file);
        StyledLayerDescriptor newSLD = stylereader.parseSLD();
        //TODO: handle exceptions
        if (newSLD == null) {
            //exceptional!
            SLDPlugin.log("SLD Import returned null", null); //$NON-NLS-1$
            throw (IOException) new IOException("SLD import returned null"); //$NON-NLS-1$
View Full Code Here

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

                + getLayerId(MockData.BASIC_POLYGONS) + "&sldver=1.0.0");
       
        SLDParser parser = new SLDParser(CommonFactoryFinder.getStyleFactory(null));
        parser.setInput(stream);
       
        StyledLayerDescriptor sld = parser.parseSLD();
        assertEquals(1, sld.getStyledLayers().length);
       
        NamedLayer layer = (NamedLayer) sld.getStyledLayers()[0];
        assertEquals(getLayerId(MockData.BASIC_POLYGONS), layer.getName());
        assertEquals(1, layer.styles().size());
View Full Code Here

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

        InputStream stream = get("wms?service=WMS&version=1.1.0&request=GetStyles&layers=lakesGroup&sldver=1.0.0");
       
        SLDParser parser = new SLDParser(CommonFactoryFinder.getStyleFactory(null));
        parser.setInput(stream);
       
        StyledLayerDescriptor sld = parser.parseSLD();
        assertEquals(1, sld.getStyledLayers().length);
       
        NamedLayer layer = (NamedLayer) sld.getStyledLayers()[0];
        assertEquals("lakesGroup", layer.getName());
       
View Full Code Here

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

                + getLayerId(MockData.LAKES) + "&sldver=1.0.0");
       
        SLDParser parser = new SLDParser(CommonFactoryFinder.getStyleFactory(null));
        parser.setInput(stream);
       
        StyledLayerDescriptor sld = parser.parseSLD();
        assertEquals(1, sld.getStyledLayers().length);
       
        NamedLayer layer = (NamedLayer) sld.getStyledLayers()[0];
        assertEquals(getLayerId(MockData.LAKES), layer.getName());
        assertEquals(2, layer.styles().size());
View Full Code Here

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

            try {
                parser.setInput(getClass().getResource(styleName));
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            StyledLayerDescriptor sld = parser.parseSLD();
            UserLayer layer = (UserLayer) sld.getStyledLayers()[0];
            style = layer.getUserStyles()[0];
            STYLES.put(styleName, style);
        }
        return style;
View Full Code Here

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

     * Parses an sld document.
     */
    private StyledLayerDescriptor parseSld(InputStream input) {
        SLDParser parser = new SLDParser(styleFactory, input);

        return parser.parseSLD();
    }

    private void processSld(final GetMapRequest request, final List<?>requestedLayers, final StyledLayerDescriptor sld,
            final List styleNames) throws WmsException, IOException {
        if (requestedLayers.size() == 0) {
View Full Code Here

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

    //    - ChannelSelection: Gray {Contrast Enh: Histogram}
    //
    // ////////////////////////////////////////////////////////////////////
    java.net.URL surl = TestData.url(this, "1band_Float32_test1.sld");
    SLDParser stylereader = new SLDParser(sf, surl);
    StyledLayerDescriptor sld = stylereader.parseSLD();
    // the RasterSymbolizer Helper
    SubchainStyleVisitorCoverageProcessingAdapter rsh = new RasterSymbolizerHelper(gc, null);

    RasterSymbolizer rs_1 = extractRasterSymbolizer(sld);
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.