org.wkb4j.engine
Class WKBReader

java.lang.Object
  |
  +--org.wkb4j.engine.WKBReader
All Implemented Interfaces:
WKBGeometryTypes

public class WKBReader
extends java.lang.Object
implements WKBGeometryTypes

Creation date: 3 juil. 2002 00:16:50

Version:
$Revision: 1.8 $ $Date: 2003/07/08 21:49:16 $
Author:
David Garnier

Field Summary
protected  java.lang.String[] emptyStringArray
           
protected static org.apache.log4j.Logger log
           
 
Fields inherited from interface org.wkb4j.engine.WKBGeometryTypes
linearRing, wkbGeometryCollection, wkbLineString, wkbMultiLineString, wkbMultiPoint, wkbMultiPolygon, wkbPoint, wkbPolygon
 
Constructor Summary
WKBReader()
          Constructor for WKBReader.
 
Method Summary
private  void invertInt(byte[] record, int offset)
           
private  void invertLong(byte[] record, int offset)
           
private  byte[] parseNDRRecord(byte[] record)
           
 void readData(java.sql.Connection dbConn, java.lang.String completeSQLQuery, java.util.List wordList, org.wkb4j.engine.WKBParser parser)
          Fetches the binary data from the database and pass each record to the WKBParser with the submitted WKBFactory.
 void readData(java.sql.Connection dbConn, java.lang.String completeSQLQuery, org.wkb4j.engine.WKBParser parser)
          Fetches the binary data from the database and pass each record to the WKBParser with the submitted WKBFactory.
 void readDataWithPartialQuery(java.sql.Connection dbConn, java.lang.String geocolumn, java.lang.String partialSQLQuery, org.wkb4j.engine.WKBParser parser)
          Fetches the binary data from the database and pass each record to the submitted WKBParser.
 void readDataWithWhereClause(java.sql.Connection dbConn, java.lang.String geocolumn, java.lang.String geotable, java.lang.String whereClause, org.wkb4j.engine.WKBParser parser)
          Fetches the binary data from the database and pass each record to the submitted WKBParser.
protected  java.lang.String[] sanitizeWords(java.util.List words)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log

emptyStringArray

protected java.lang.String[] emptyStringArray
Constructor Detail

WKBReader

public WKBReader()
Constructor for WKBReader.

Method Detail

sanitizeWords

protected java.lang.String[] sanitizeWords(java.util.List words)

readDataWithPartialQuery

public void readDataWithPartialQuery(java.sql.Connection dbConn,
                                     java.lang.String geocolumn,
                                     java.lang.String partialSQLQuery,
                                     org.wkb4j.engine.WKBParser parser)
Fetches the binary data from the database and pass each record to the submitted WKBParser. The partialSQLQuery should contain a partial SQL query. The data will be fetched from the geocolumn name.
Example of an correct value for partialSQLQuery: "FROM geotable WHERE id BETWEEN 125 AND 168"

Parameters:
dbConn -
partialSQLQuery -
parser -

readDataWithWhereClause

public void readDataWithWhereClause(java.sql.Connection dbConn,
                                    java.lang.String geocolumn,
                                    java.lang.String geotable,
                                    java.lang.String whereClause,
                                    org.wkb4j.engine.WKBParser parser)
Fetches the binary data from the database and pass each record to the submitted WKBParser. The whereClause should contain a valid SQL where clause, without the where at the beginning. If whereClause is null or empty, it is ignored, causing all the records in the specified geotable to be loaded. The data will be fetched from the geocolumn name.
Example of an correct value for partialSQLQuery: "FROM geotable WHERE id BETWEEN 125 AND 168"

Parameters:
dbConn -
parser -

readData

public void readData(java.sql.Connection dbConn,
                     java.lang.String completeSQLQuery,
                     java.util.List wordList,
                     org.wkb4j.engine.WKBParser parser)
Fetches the binary data from the database and pass each record to the WKBParser with the submitted WKBFactory. The submitted query must creates at least a column named "srid" holding the SRID and a column named "wkb" holding the WKB data.
Example of an correct value for completeSQLQuery: "SELECT srid(geocolumn) AS srid, asbinary(geocolumn,'XDR') AS wkb FROM geotable WHERE id BETWEEN 125 AND 168"

Parameters:
dbConn -
completeSQLQuery -
wordList -
parser -

readData

public void readData(java.sql.Connection dbConn,
                     java.lang.String completeSQLQuery,
                     org.wkb4j.engine.WKBParser parser)
Fetches the binary data from the database and pass each record to the WKBParser with the submitted WKBFactory. The submitted query must creates at least a column named "srid" holding the SRID and a column named "wkb" holding the WKB data.
Example: "SELECT srid(geocolumn) AS srid, asbinary(geocolumn,'XDR') AS wkb FROM geotable WHERE id BETWEEN 125 AND 168"

Parameters:
dbConn -
completeSQLQuery -
parser -

parseNDRRecord

private byte[] parseNDRRecord(byte[] record)

invertInt

private void invertInt(byte[] record,
                       int offset)

invertLong

private void invertLong(byte[] record,
                        int offset)


Copyright © 2002-2003 David Garnier. All Rights Reserved.