Examples of BlockOutputStream


Examples of crosby.binary.file.BlockOutputStream

    output.write(FileBlock.newInstance("OSMData", b2.build().toByteString(),null));
  }

 
  BuildTestFile(String name, String compress) throws IOException {
    output = new BlockOutputStream(new FileOutputStream(name));
    output.setCompress(compress);
    HeaderBlock.Builder b = HeaderBlock.newBuilder();
    b.addRequiredFeatures("OsmSchema-V0.6").addRequiredFeatures("DenseNodes").setSource("QuickBrownFox");
    output.write(FileBlock.newInstance("OSMHeader",b.build().toByteString(),null));
  }
View Full Code Here

Examples of org.openstreetmap.osmosis.osmbinary.file.BlockOutputStream

        Iterator<EntityContainer> nodes = getFeatures(ref + ":node");
        Iterator<EntityContainer> ways = getFeatures(ref + ":way");
        Iterator<EntityContainer> iterator = Iterators.concat(nodes, ways);
        if (file.getName().endsWith(".pbf")) {
            BlockOutputStream output = new BlockOutputStream(new FileOutputStream(file));
            OsmosisSerializer serializer = new OsmosisSerializer(output);
            while (iterator.hasNext()) {
                EntityContainer entity = iterator.next();
                serializer.process(entity);
            }
View Full Code Here

Examples of org.openstreetmap.osmosis.osmbinary.file.BlockOutputStream

    output.write(FileBlock.newInstance("OSMData", b2.build().toByteString(),null));
  }

 
  BuildTestFile(String name, String compress) throws IOException {
    output = new BlockOutputStream(new FileOutputStream(name));
    output.setCompress(compress);
    HeaderBlock.Builder b = HeaderBlock.newBuilder();
    b.addRequiredFeatures("OsmSchema-V0.6").addRequiredFeatures("DenseNodes").setSource("QuickBrownFox");
    output.write(FileBlock.newInstance("OSMHeader",b.build().toByteString(),null));
  }
View Full Code Here

Examples of org.openstreetmap.osmosis.osmbinary.file.BlockOutputStream

        // Create a file object from the file name provided.
        file = new File(fileName);

        // Build the task object.
        try {
            BlockOutputStream output = new BlockOutputStream(
                    new FileOutputStream(file));
            task = new OsmosisSerializer(output);
            task.configBatchLimit(this.getIntegerArgument(taskConfig,
                    "batchlimit", 8000));
            task.configOmit(this.getBooleanArgument(taskConfig, "omitmetadata",
                    false));
            task.setUseDense(this.getBooleanArgument(taskConfig, "usedense",
                true));
            task.configGranularity(this.getIntegerArgument(taskConfig,
                    "granularity", 100));

            output.setCompress(this.getStringArgument(taskConfig, "compress",
                    "deflate"));

        } catch (FileNotFoundException e) {
          throw new OsmosisRuntimeException("Failed to initialize Osmosis pbf serializer.", 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.