deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io.shpapi.shape_new
Class ShapeFile

java.lang.Object
  extended by org.deegree.io.shpapi.shape_new.ShapeFile

public class ShapeFile
extends java.lang.Object

ShapeFile encapsulates and provides access to data and properties of a shapefile. Please note that writing will probably fail if the data was read by shapefile.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
Author:
Andreas Schmitz, last edited by: $Author: mschneider $

Field Summary
static int FILETYPE
          The file type number.
static int MULTIPATCH
          The multipatch shape.
static int MULTIPOINT
          The normal multipoint.
static int MULTIPOINTM
          The multipoint with measures.
static int MULTIPOINTZ
          The multipoint with z coordinates.
static int NULL
          The NULL shape.
static int POINT
          The normal point.
static int POINTM
          The point with measure.
static int POINTZ
          The point with z coordinates.
static int POLYGON
          The normal polygon.
static int POLYGONM
          The polygon with measures.
static int POLYGONZ
          The polygon with z coordinates.
static int POLYLINE
          The normal polyline.
static int POLYLINEM
          The polyline with measures.
static int POLYLINEZ
          The polyline with z coordinates.
static int VERSION
          The shape file version.
 
Constructor Summary
ShapeFile(FeatureCollection fc, java.lang.String baseName)
          Creates shapefile datastructures from the feature collection.
ShapeFile(java.util.LinkedList<Shape> shapes, ShapeEnvelope envelope, DBaseFile dbf, java.lang.String baseName)
           
 
Method Summary
 java.lang.String getBaseName()
           
 ShapeEnvelope getEnvelope()
           
 FeatureCollection getFeatureCollection()
          This method destroys the internal list of shapes and the associated .dbf structure!
 java.util.List<Shape> getShapes()
           
 int getShapeType()
           
 int getSize()
           
 void writeDBF()
          This writes the DBF file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILETYPE

public static final int FILETYPE
The file type number.

See Also:
Constant Field Values

VERSION

public static final int VERSION
The shape file version.

See Also:
Constant Field Values

NULL

public static final int NULL
The NULL shape.

See Also:
Constant Field Values

POINT

public static final int POINT
The normal point.

See Also:
Constant Field Values

POLYLINE

public static final int POLYLINE
The normal polyline.

See Also:
Constant Field Values

POLYGON

public static final int POLYGON
The normal polygon.

See Also:
Constant Field Values

MULTIPOINT

public static final int MULTIPOINT
The normal multipoint.

See Also:
Constant Field Values

POINTZ

public static final int POINTZ
The point with z coordinates.

See Also:
Constant Field Values

POLYLINEZ

public static final int POLYLINEZ
The polyline with z coordinates.

See Also:
Constant Field Values

POLYGONZ

public static final int POLYGONZ
The polygon with z coordinates.

See Also:
Constant Field Values

MULTIPOINTZ

public static final int MULTIPOINTZ
The multipoint with z coordinates.

See Also:
Constant Field Values

POINTM

public static final int POINTM
The point with measure.

See Also:
Constant Field Values

POLYLINEM

public static final int POLYLINEM
The polyline with measures.

See Also:
Constant Field Values

POLYGONM

public static final int POLYGONM
The polygon with measures.

See Also:
Constant Field Values

MULTIPOINTM

public static final int MULTIPOINTM
The multipoint with measures.

See Also:
Constant Field Values

MULTIPATCH

public static final int MULTIPATCH
The multipatch shape.

See Also:
Constant Field Values
Constructor Detail

ShapeFile

public ShapeFile(java.util.LinkedList<Shape> shapes,
                 ShapeEnvelope envelope,
                 DBaseFile dbf,
                 java.lang.String baseName)
Parameters:
shapes - the shapes that this shapefile consists of
envelope - the envelope of all the shapes
dbf - the associated DBase file
baseName - the base name

ShapeFile

public ShapeFile(FeatureCollection fc,
                 java.lang.String baseName)
          throws DBaseException,
                 GeometryException
Creates shapefile datastructures from the feature collection.

Parameters:
fc -
baseName - necessary for DBF creation, base filename without .dbf extension
Throws:
DBaseException
GeometryException
Method Detail

getShapes

public java.util.List<Shape> getShapes()
Returns:
the list of shapes contained within this shape file

getShapeType

public int getShapeType()
Returns:
just the type of the first shape

getSize

public int getSize()
Returns:
the sum of all shape sizes plus record header lengths, in bytes

getEnvelope

public ShapeEnvelope getEnvelope()
Returns:
the envelope of the shapes.

writeDBF

public void writeDBF()
              throws java.io.IOException,
                     DBaseException
This writes the DBF file.

Throws:
java.io.IOException
DBaseException

getFeatureCollection

public FeatureCollection getFeatureCollection()
                                       throws DBaseException
This method destroys the internal list of shapes and the associated .dbf structure!

Returns:
a feature collection with all shapes
Throws:
DBaseException

getBaseName

public java.lang.String getBaseName()
Returns:
the base name of this shape file

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org