Package org.geotools.kml.v22

Examples of org.geotools.kml.v22.KML


        this.context = context;
    }

    public Kml buildKMLDocument() {
        // prepare kml, document and folder
        Kml kml = new Kml();
        Document document = kml.createAndSetDocument();
        Map formatOptions = context.getRequest().getFormatOptions();
        String kmltitle = (String) formatOptions.get("kmltitle");
        if(kmltitle == null) {
            kmltitle = context.getMapContent().getTitle();
        }
View Full Code Here


     * @param context
     * @return
     */
    public Kml buildKMLDocument(KmlEncodingContext context) {
        // prepare kml, document and folder
        Kml kml = new Kml();
        Document document = kml.createAndSetDocument();
        String kmltitle = (String) context.getRequest().getFormatOptions().get("kmltitle");
        document.setName(kmltitle);

        // get the callbacks for the document and let them loose
        List<KmlDecorator> decorators = context.getDecoratorsForClass(Document.class);
View Full Code Here

    public KMLRawReader(InputStream inputStream, KMLRawReader.ReadType readType,
            SimpleFeatureType featureType) {
        if (KMLRawReader.ReadType.SCHEMA_AND_FEATURES.equals(readType)) {
            if (featureType == null) {
                parser = new PullParser(new KMLConfiguration(), inputStream, KML.Placemark,
                        KML.Schema);
            } else {
                parser = new PullParser(new KMLConfiguration(), inputStream, pullParserArgs(
                        featureTypeSchemaNames(featureType), KML.Placemark, KML.Schema));
            }
        } else if (KMLRawReader.ReadType.FEATURES.equals(readType)) {
            if (featureType == null) {
                parser = new PullParser(new KMLConfiguration(), inputStream, KML.Placemark);
            } else {
                parser = new PullParser(new KMLConfiguration(), inputStream, pullParserArgs(
                        featureTypeSchemaNames(featureType), KML.Placemark));
            }
        } else {
            throw new IllegalArgumentException("Unknown parse read type: " + readType.toString());
        }
View Full Code Here

        container.registerComponentInstance(styleBuilder);
        container.registerComponentInstance(new GeometryFactory());
        container.registerComponentInstance(CoordinateArraySequenceFactory.instance());
        container.registerComponentInstance(new StyleMap());
        container.registerComponentInstance(new FolderStack());
        container.registerComponentInstance(new SchemaRegistry());
    }
View Full Code Here

public class KmlFormatIT {
    @Test
    public void testReader() throws FileNotFoundException, JAXBException {
        Reader reader = new FileReader(TEST_PATH + "from20.kml");
        Kml kml = (Kml) newUnmarshaller20().unmarshal(reader);
        assertNotNull(kml);
        assertNotNull(kml.getFolder());
        assertEquals(3, kml.getFolder().getDocumentOrFolderOrGroundOverlay().size());
    }
View Full Code Here

    }

    @Test
    public void testInputStream() throws FileNotFoundException, JAXBException {
        InputStream in = new FileInputStream(TEST_PATH + "from20.kml");
        Kml kml = (Kml) newUnmarshaller20().unmarshal(in);
        assertNotNull(kml);
        assertNotNull(kml.getFolder());
        assertEquals(3, kml.getFolder().getDocumentOrFolderOrGroundOverlay().size());
    }
View Full Code Here

    }

    @Test
    public void testUnmarshal20() throws IOException, JAXBException {
        Reader reader = new FileReader(TEST_PATH + "from20.kml");
        Kml kml = unmarshal20(reader);
        assertNotNull(kml);
        assertNotNull(kml.getFolder());
        assertEquals(3, kml.getFolder().getDocumentOrFolderOrGroundOverlay().size());
    }
View Full Code Here

TOP

Related Classes of org.geotools.kml.v22.KML

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.