01: package com.vividsolutions.jump.datastore;
02:
03: import com.vividsolutions.jts.geom.*;
04:
05: /**
06: * A spatial filter {@link Query} on a {@link DataStoreConnection}.
07: */
08: public class FilterQuery implements Query {
09:
10: private String datasetName;
11: private String[] propertyNames;
12: private Geometry geom;
13: private String condition;
14: /**
15: * Not all query processors need this.
16: */
17: private String geomAttrName = null;
18: /**
19: * For those query processors which need a CRS
20: */
21: private SpatialReferenceSystemID srid = new SpatialReferenceSystemID();
22:
23: public FilterQuery() {
24: }
25:
26: public void setDatasetName(String datasetName) {
27: this .datasetName = datasetName;
28: }
29:
30: public String getDatasetName() {
31: return datasetName;
32: }
33:
34: public void setPropertyNames(String[] propertyNames) {
35: this .propertyNames = propertyNames;
36: }
37:
38: public String[] getPropertyNames() {
39: return propertyNames;
40: }
41:
42: public void setFilterGeometry(Geometry geom) {
43: this .geom = geom;
44: }
45:
46: public Geometry getFilterGeometry() {
47: return geom;
48: }
49:
50: public void setCondition(String condition) {
51: this .condition = condition;
52: }
53:
54: public String getCondition() {
55: return condition;
56: }
57:
58: public void setGeometryAttributeName(String geomAttrName) {
59: this .geomAttrName = geomAttrName;
60: }
61:
62: public String getGeometryAttributeName() {
63: return geomAttrName;
64: }
65:
66: /**
67: * Sets the SpatialReferenceSystem for a query.
68: * This is optional; whether it is required depends on the datastore implemention.
69: * Datastore drivers may set this themselves
70: * and override any user settings.
71: *
72: * @param srid the SpatialReferenceSystem ID
73: */
74: public void setSRSName(SpatialReferenceSystemID srid) {
75: this .srid = srid;
76: }
77:
78: public SpatialReferenceSystemID getSRSName() {
79: return srid;
80: }
81: }
|