org.gicentre.io
Class ShapefileWriter

java.lang.Object
  extended by org.gicentre.io.ShapefileWriter

public class ShapefileWriter
extends java.lang.Object

Writes out a treemap as a collection of ESRI shapefiles. A shapefile consists of 3 separate files - name.shp containing the geometry; name.shx containing the file offsets for the components that make up the geometry; and name.dbf containing the attributes.

Version:
3.0, 24th February, 2011.
Author:
Jo Wood, giCentre.

Constructor Summary
ShapefileWriter()
          There should be no need to call the constructor explicitly since all methods are static.
 
Method Summary
protected static boolean writeDoubleLittleEndian(double value, java.io.OutputStream os)
          Writes a little-endian 8-byte double to the given output stream.
protected static boolean writeIntLittleEndian(int value, java.io.OutputStream os)
          Writes a 32 bit unsigned little-endian ('Intel') word of data to the given output stream.
static boolean writeNodes(TreeMapNode node, java.lang.String fileName)
          Writes a shapefile based on the supplied treemap node (and all of its decendents).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapefileWriter

public ShapefileWriter()
There should be no need to call the constructor explicitly since all methods are static.

Method Detail

writeNodes

public static boolean writeNodes(TreeMapNode node,
                                 java.lang.String fileName)
Writes a shapefile based on the supplied treemap node (and all of its decendents). The given fileName can be supplied with or without an extension, but this method will write three files with the same base and extensions .shp, .shx and .dbf.

Parameters:
node - Treemap node to write.
fileName - Name of core of the three files to create.
Returns:
True if written successfully.

writeIntLittleEndian

protected static boolean writeIntLittleEndian(int value,
                                              java.io.OutputStream os)
Writes a 32 bit unsigned little-endian ('Intel') word of data to the given output stream.

Parameters:
value - Value to write to output stream.
os - Output stream to process.
Returns:
True if written successfully.

writeDoubleLittleEndian

protected static boolean writeDoubleLittleEndian(double value,
                                                 java.io.OutputStream os)
Writes a little-endian 8-byte double to the given output stream.

Parameters:
value - Value to write to output stream.
os - Output stream.
Returns:
True if written successfully.


treeMappa V.3.0.1, API documentation generated 4th April, 2011