org.geotools.data.shapefile.indexed
Class ShapeFileIndexer

Object
  extended by ShapeFileIndexer
All Implemented Interfaces:
FileReader, FileWriter

public class ShapeFileIndexer
extends Object
implements FileWriter

Utility class for Shapefile spatial indexing

Author:
Tommaso Nolli
Module:
modules/plugin/shapefile (gt-shapefile.jar)

Constructor Summary
ShapeFileIndexer()
           
 
Method Summary
 String id()
          An id for the reader.
 int index(boolean verbose, ProgressListener listener)
          Index the shapefile denoted by setShapeFileName(String fileName) If when a thread starts, another thread is indexing the same file, this thread will wait that the first thread ends indexing; in this case zero is reurned as result of the indexing process.
static void main(String[] args)
           
 void setByteOrder(String byteOrder)
          DOCUMENT ME!
 void setMax(int i)
          For quad tree this is the max depth.
 void setShapeFileName(ShpFiles shpFiles)
          DOCUMENT ME!
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeFileIndexer

public ShapeFileIndexer()
Method Detail

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException

index

public int index(boolean verbose,
                 ProgressListener listener)
          throws MalformedURLException,
                 IOException,
                 TreeException,
                 StoreException,
                 LockTimeoutException
Index the shapefile denoted by setShapeFileName(String fileName) If when a thread starts, another thread is indexing the same file, this thread will wait that the first thread ends indexing; in this case zero is reurned as result of the indexing process.

Parameters:
verbose - enable/disable printing of dots every 500 indexed records
listener - DOCUMENT ME!
Returns:
The number of indexed records (or zero)
Throws:
MalformedURLException
IOException
TreeException
StoreException - DOCUMENT ME!
LockTimeoutException

setMax

public void setMax(int i)
For quad tree this is the max depth. I don't know what it is for RTree

Parameters:
i -

setShapeFileName

public void setShapeFileName(ShpFiles shpFiles)
DOCUMENT ME!

Parameters:
shpFiles -

setByteOrder

public void setByteOrder(String byteOrder)
DOCUMENT ME!

Parameters:
byteOrder - The byteOrder to set.

id

public String id()
Description copied from interface: FileReader
An id for the reader. This is only used for debugging.

Specified by:
id in interface FileReader
Specified by:
id in interface FileWriter
Returns:
id for the reader.


Copyright © 1996-2009 Geotools. All Rights Reserved.