|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.filter.SQLEncoder org.geotools.filter.SQLEncoderPostgis
Encodes a filter into a SQL WHERE statement for postgis. This class adds the ability to turn geometry filters into sql statements if they are bboxes.
Field Summary | |
protected boolean |
looseBbox
Whether the BBOX filter should be strict (using the exact geom), or loose (using the envelopes) |
Fields inherited from class org.geotools.filter.SQLEncoder |
mapper, out |
Constructor Summary | |
SQLEncoderPostgis()
Empty constructor TODO: rethink empty constructor, as BBOXes _need_ an SRID, must make client set it somehow. |
|
SQLEncoderPostgis(boolean looseBbox)
|
|
SQLEncoderPostgis(int srid)
Constructor with srid. |
Method Summary | |
protected FilterCapabilities |
createFilterCapabilities()
Sets the capabilities of this filter. |
boolean |
isLooseBbox()
Gets whether the Filter.BBOX query will be strict and use an intersects or 'loose' and just operate against the geometry envelopes. |
void |
setDefaultGeometry(java.lang.String name)
Sets the default geometry, so that filters with null for one of their expressions can assume that the default geometry is intended. |
void |
setLooseBbox(boolean isLooseBbox)
Sets whether the Filter.BBOX query should be 'loose', meaning that it should just doing a bounding box against the envelope. |
void |
setSRID(int srid)
Sets a spatial reference system ESPG number, so that the geometry can be properly encoded for postgis. |
void |
visit(GeometryFilter filter)
Turns a geometry filter into the postgis sql bbox statement. |
void |
visitLiteralGeometry(LiteralExpression expression)
Checks to see if the literal is a geometry, and encodes it if it is, if not just sends to the parent class. |
Methods inherited from class org.geotools.filter.SQLEncoder |
encode, encode, escapeName, getCapabilities, getColnameEscape, setColnameEscape, setFIDMapper, setSqlNameEscape, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.geotools.filter.FilterVisitor |
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit |
Field Detail |
protected boolean looseBbox
Constructor Detail |
public SQLEncoderPostgis()
public SQLEncoderPostgis(boolean looseBbox)
public SQLEncoderPostgis(int srid)
srid
- spatial reference id to encode geometries with.Method Detail |
protected FilterCapabilities createFilterCapabilities()
SQLEncoder
createFilterCapabilities
in class SQLEncoder
SQLEncoder.createFilterCapabilities()
public void setLooseBbox(boolean isLooseBbox)
isLooseBbox
- whether the bbox should be loose or strict.public boolean isLooseBbox()
public void setSRID(int srid)
srid
- the integer code for the EPSG spatial reference system.public void setDefaultGeometry(java.lang.String name)
name
- the name of the default geometry Attribute.public void visit(GeometryFilter filter) throws java.lang.RuntimeException
visit
in interface FilterVisitor
visit
in class SQLEncoder
filter
- the geometry filter to be encoded.
java.lang.RuntimeException
- for IO exception (need a better error)FilterVisitor.visit(org.geotools.filter.GeometryFilter)
public void visitLiteralGeometry(LiteralExpression expression) throws java.io.IOException
visitLiteralGeometry
in class SQLEncoder
expression
- the expression to visit and encode.
java.io.IOException
- for IO exception (need a better error)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |