org.geotools.data.postgis
Class PostgisFeatureWriter

java.lang.Object
  extended byorg.geotools.data.jdbc.JDBCFeatureWriter
      extended byorg.geotools.data.jdbc.JDBCTextFeatureWriter
          extended byorg.geotools.data.postgis.PostgisFeatureWriter
All Implemented Interfaces:
FeatureWriter

public class PostgisFeatureWriter
extends JDBCTextFeatureWriter


Field Summary
protected static com.vividsolutions.jts.io.WKTWriter geometryWriter
          Well Known Text writer (from JTS).
 
Fields inherited from class org.geotools.data.jdbc.JDBCFeatureWriter
closed, current, fidAttributes, listenerManager, live, queryData, reader
 
Constructor Summary
PostgisFeatureWriter(FeatureReader fReader, QueryData queryData, boolean WKBEnabled, boolean byteaWKB, PostgisSQLBuilder sqlBuilder)
           
 
Method Summary
protected  java.lang.String encodeColumnName(java.lang.String colName)
          Encodes the colName, default just calls encodeName(String).
protected  java.lang.String encodeName(java.lang.String tableName)
          DJB: this is the javadoc from the superclass, but this wasnt being done.
protected  java.lang.String getGeometryInsertText(com.vividsolutions.jts.geom.Geometry geom, int srid)
          Turns a geometry into the textual version needed for the sql statement
 boolean isWKBEnabled()
          Returns true if the WKB format is used to transfer geometries, false otherwise
 void setWKBEnabled(boolean enabled)
          If turned on, WKB will be used to transfer geometry data instead of WKT
 
Methods inherited from class org.geotools.data.jdbc.JDBCTextFeatureWriter
addQuotes, doInsert, doUpdate, makeDeleteSql, makeInsertSql, makeUpdateSql, remove, useQueryDataForInsert
 
Methods inherited from class org.geotools.data.jdbc.JDBCFeatureWriter
close, getFeatureType, hasNext, next, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

geometryWriter

protected static com.vividsolutions.jts.io.WKTWriter geometryWriter
Well Known Text writer (from JTS).

Constructor Detail

PostgisFeatureWriter

public PostgisFeatureWriter(FeatureReader fReader,
                            QueryData queryData,
                            boolean WKBEnabled,
                            boolean byteaWKB,
                            PostgisSQLBuilder sqlBuilder)
                     throws java.io.IOException
Parameters:
fReader -
queryData -
WKBEnabled -
byteaWKB - -- true if you're using postgis 1.0+. they changed how to do wkb writing.
Throws:
java.io.IOException
Method Detail

getGeometryInsertText

protected java.lang.String getGeometryInsertText(com.vividsolutions.jts.geom.Geometry geom,
                                                 int srid)
                                          throws java.io.IOException
Description copied from class: JDBCTextFeatureWriter
Turns a geometry into the textual version needed for the sql statement

Specified by:
getGeometryInsertText in class JDBCTextFeatureWriter
Parameters:
geom -
srid -
Returns:
Throws:
java.io.IOException

isWKBEnabled

public boolean isWKBEnabled()
Returns true if the WKB format is used to transfer geometries, false otherwise

Returns:

setWKBEnabled

public void setWKBEnabled(boolean enabled)
If turned on, WKB will be used to transfer geometry data instead of WKT

Parameters:
enabled -

encodeName

protected java.lang.String encodeName(java.lang.String tableName)
DJB: this is the javadoc from the superclass, but this wasnt being done. Encodes the tableName, default is to do nothing, but postgis will override and put double quotes around the tablename.

Overrides:
encodeName in class JDBCTextFeatureWriter

encodeColumnName

protected java.lang.String encodeColumnName(java.lang.String colName)
Description copied from class: JDBCTextFeatureWriter
Encodes the colName, default just calls JDBCTextFeatureWriter.encodeName(String).

Overrides:
encodeColumnName in class JDBCTextFeatureWriter


Copyright © GeoTools. All Rights Reserved.