Search in sources :

Example 1 with SvgRenderer

use of com.dexels.navajo.geo.renderer.SvgRenderer in project navajo by Dexels.

the class KMLMap method getSvgData.

public Binary getSvgData() throws IOException {
    if (myKmzData == null) {
        getKmlData();
    }
    InputStream bis = myKmzData.getDataAsStream();
    ZipInputStream zis = new ZipInputStream(bis);
    ZipEntry ze = null;
    do {
        ze = zis.getNextEntry();
        if (ze != null && ze.getName().equals("doc.kml")) {
            SvgRenderer sr = new SvgRenderer();
            mySvgData = sr.renderToBinary(zis);
            FormatDescription fd = new FormatDescription();
            fd.addFileExtension("svg");
            fd.addMimeType("image/svg");
            myKmzData.setMimeType("image/svg");
            zis.close();
            return mySvgData;
        }
    } while (ze != null);
    zis.close();
    return null;
}
Also used : ZipInputStream(java.util.zip.ZipInputStream) SvgRenderer(com.dexels.navajo.geo.renderer.SvgRenderer) ZipInputStream(java.util.zip.ZipInputStream) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) ZipEntry(java.util.zip.ZipEntry) FormatDescription(com.dexels.navajo.document.metadata.FormatDescription)

Aggregations

FormatDescription (com.dexels.navajo.document.metadata.FormatDescription)1 SvgRenderer (com.dexels.navajo.geo.renderer.SvgRenderer)1 FileInputStream (java.io.FileInputStream)1 InputStream (java.io.InputStream)1 ZipEntry (java.util.zip.ZipEntry)1 ZipInputStream (java.util.zip.ZipInputStream)1