|
deegree 2.2 (2008/12/22 11:33 build-3038-official) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.deegree.io.quadtree.DBQuadtreeManager<T>
T - the type of the quadtree. If unsure use the determineQuattreType() method to determine the type. Be
carefull though, if you use a wrong generic here (e.g. not Integer or String) while supplying another
types.Type to the constructor there is no way to check find the correct instance.public class DBQuadtreeManager<T>
Access control to a quadtree for managing spatial indizes stored in a usual database.
| Field Summary | |
|---|---|
protected String |
backend
|
protected String |
column
|
protected Envelope |
envelope
|
protected String |
indexName
|
protected JDBCConnection |
jdbc
|
protected int |
maxDepth
|
protected String |
owner
|
protected String |
table
|
| Constructor Summary | |
|---|---|
DBQuadtreeManager(JDBCConnection jdbc,
String table,
String column,
String owner,
int type)
initializes a QuadtreeManager to access an alread existing Quadtree |
|
DBQuadtreeManager(JDBCConnection jdbc,
String owner,
String indexName,
String table,
String column,
int maxDepth,
int type)
|
|
DBQuadtreeManager(String driver,
String logon,
String user,
String password,
String encoding,
String table,
String column,
String owner,
int type)
initializes a QuadtreeManager to access an alread existing Quadtree |
|
DBQuadtreeManager(String driver,
String logon,
String user,
String password,
String encoding,
String indexName,
String table,
String column,
String owner,
int maxDepth,
int type)
|
|
| Method Summary | |
|---|---|
void |
appendShape(String fileName)
appends the features of a shape to an existing datatable and inserts references into the assigned quadtree table. |
protected void |
createDataTable(String fileName,
String idType)
creates table the shape data shall be stored |
protected void |
createIndexTable(String indexTable,
String idType)
Creates actually two tables, an indextable, which will hold the actual quadtree and an index_item table which is a join-table between the dbNodes and the feature_ids. |
Object |
determineQuattreeType()
|
(package private) String |
getDatabaseType(int dataTypeCode)
returns the type name for a generic type code as used by SQLServer |
DBQuadtree<T> |
getQuadtree()
returns the current Quadtree |
void |
importShape(String fileName)
imports a shape into the database and builds a quadtree on it |
protected int |
initQuadtree(String fileName)
initializes a new Quadtree by adding a row into table TAB_QUADTREE and into TAB_QTNODE (-> root node) |
protected void |
initRootNode(String fileName)
initializes the root node of the quadtree |
void |
insertIndexMetadata(int fk_indexTree)
Inserts a row into the quadtree meta data structure 'TAB_DEEGREE_IDX', containing information on the table, geometry, indexname, owner and the foreign_key to the index table. |
protected int |
loadIndexMetadata()
loads the metadata of a Index from the TAB_DEEGREE_IDX table |
void |
setRootEnvelope(Envelope envelope)
before importing a shape a user may set an envelope for the quadtree to bee created that is different from the one of the shape by calling this method. |
protected void |
storeFeature(Feature feature,
T id,
JDBCConnection jdbc)
stores one feature into the defined table |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected JDBCConnection jdbc
protected String table
protected String column
protected String owner
protected String indexName
protected int maxDepth
protected Envelope envelope
protected String backend
| Constructor Detail |
|---|
public DBQuadtreeManager(JDBCConnection jdbc,
String owner,
String indexName,
String table,
String column,
int maxDepth,
int type)
jdbc - database connection infoowner - owner of the table (optional, database user will be used if set to null )indexName - this name will be used to create the table that stores the nodes of a specific quadtreetable - name of table the index shall be created forcolumn - name of column the index shall be created formaxDepth - max depth of the generated quadtree (default = 6 if a value < 2 will be passed)type - the type of the id of the quadtree, valid are Types.INTEGER and Types.VARCHAR. if unsure use
Intger.MIN_VALUE and call determineQuattreeType(), to get an instance of the Type.
public DBQuadtreeManager(String driver,
String logon,
String user,
String password,
String encoding,
String indexName,
String table,
String column,
String owner,
int maxDepth,
int type)
driver - database connection driverlogon - database connection logonuser - database userpassword - database user's passwordencoding - character encoding to be used (if possible)indexName - this name will be used to create the table that stores the nodes of a specific quadtreetable - name of table the index shall be created forcolumn - name of column the index shall be created forowner - owner of the table (optional, database user will be used if set to null )maxDepth - max depth of the generated quadtree (default = 6 if a value < 2 will be passed)type - the type of the id of the quadtree, valid are Types.INTEGER and Types.VARCHAR. if unsure use
Intger.MIN_VALUE and call determineQuattreeType(), to get an instance of the Type.
public DBQuadtreeManager(JDBCConnection jdbc,
String table,
String column,
String owner,
int type)
jdbc - database connection infotable - name of table the index shall be created forcolumn - name of column the index shall be created forowner - owner of the table (optional, database user will be used if set to null )type - the type of the id of the quadtree, valid are Types.INTEGER and Types.VARCHAR. if unsure use
Intger.MIN_VALUE and call determineQuattreeType(), to get an instance of the Type.
public DBQuadtreeManager(String driver,
String logon,
String user,
String password,
String encoding,
String table,
String column,
String owner,
int type)
driver - database connection driverlogon - database connection logonuser - database userpassword - database user's passwordencoding - character encoding to be used (if possible)table - name of table the index shall be created forcolumn - name of column the index shall be created forowner - owner of the table (optional, database user will be used if set to null )type - the type of the id of the quadtree, valid are Types.INTEGER and Types.VARCHAR. if unsure use
Intger.MIN_VALUE and call determineQuattreeType(), to get an instance of the Type.| Method Detail |
|---|
protected int loadIndexMetadata()
throws IndexException
IndexException
public DBQuadtree<T> getQuadtree()
throws IndexException
IndexException
public Object determineQuattreeType()
throws IndexException
String, Integer or null if the type could not be determined.
- Throws:
IndexException - if the type information could not be retrieved either because no connection was acquired or an error occurred while executing the select statement.
protected void storeFeature(Feature feature,
T id,
JDBCConnection jdbc)
throws IndexException
feature - the feature to insert into the 'table'id - of the feature to store in the database, currently String and Integer are supported. If it is neither,
the Object is saved as an object, which may result in inconsitencies.jdbc - the connection to the database.
IndexException - if the feature can not be inserted or a connection error occurrs.
protected void initRootNode(String fileName)
throws IndexException,
IOException
fileName -
IndexException
IOExceptionpublic void setRootEnvelope(Envelope envelope)
envelope - method.
protected int initQuadtree(String fileName)
throws IndexException,
IOException
fileName -
IndexException
IOException - if the shape file could not be read.
public void insertIndexMetadata(int fk_indexTree)
throws IndexException
fk_indexTree -
IndexException
protected void createDataTable(String fileName,
String idType)
throws IndexException,
IOException
fileName - idType - the type of the feature_id column, for example VARCHAR(50) or NUMBER.
IndexException
IOExceptionString getDatabaseType(int dataTypeCode)
dataTypeCode -
IndexException
public void importShape(String fileName)
throws IOException,
IndexException,
HasNoDBaseFileException,
DBaseException
fileName - of the shapefile.
IOException - if the shapefile could not be opened.
IndexException - if an error occurred while talking to the jdbc database.
DBaseException - if the connection to the shapefile could not be opened.
HasNoDBaseFileException - if the feature could not be read from shape file's database file.
public void appendShape(String fileName)
throws IOException,
IndexException
you have to consider that the quadtree is just valid for a defined area. if the features to append exceeds this area the quadtree has to be rebuilded.
fileName -
IOException - if the shape file cannot be read.
IndexException - if the quatree could not be read.
protected void createIndexTable(String indexTable,
String idType)
throws IndexException
indexTable - name of the index table.idType - the type of the feature_id column, for example VARCHAR(50) or NUMBER.
IndexException - if the table could not be created.
|
deegree 2.2 (2008/12/22 11:33 build-3038-official) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net