|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.aims.mtier.model.map.layer.query.Filter
public class Filter
The Filter object contains all methods and properties needed to
perform queries, spatial queries, and buffers against a specific
ArcIMS service.
Most of the time, applying a Filer object on a FeatureLayer will cause the Java
Connector to send a GET_FEATURES request, the returned ArcXML response will be
parsed and assigned to the Recordset property of this FeatureLayer. If a map
is wanted with the Filter information, call Map.sendImageRequest();
An important note:
By default, isCheckesc() returns false, which means, if there are special characters
in the ArcXML response, e.g. "<", ">", the spatial server will return them as
"it is". Java Connector will discard records with such characters, so the records
in the Recordset will be fewer than actually returned. Call setCheckesc(true);
to make the spatial server escape the special characters. KB article 23879 discusses this problem.
Field Summary | |
---|---|
static String |
AREA_INTERSECTION
|
static String |
ATTRIBUTEFIRST
|
static String |
DECIMAL_DEGREES
|
static String |
ENVELOPE_INTERSECTION
|
static String |
FEET
|
static String |
KILOMETERS
|
static String |
METERS
|
static String |
MILES
|
static String |
OPTIMIZE
|
static String |
SPATIALFIRST
|
Constructor Summary | |
---|---|
Filter()
|
Method Summary | |
---|---|
void |
addSubField(String value)
Add fields of the features that will be returned for a GET_FEATURES request. |
void |
clearSpatialObjects()
Clears the spatial object added via methods setSpatialShape() and setSpatialObject(). |
void |
clearSubFields()
Clears all the fields added via method addSubField(), the result is same as method addSubField() has never been called. |
double |
getAccuracy()
Returns the accuracy value set by method setAccuracy() . |
long |
getBeginRecord()
Returns the beginrecord value. |
Buffer |
getBufferObject()
Returns the Filter object's assigned Buffer object. |
Buffer |
getEnvelopeBuffer()
Returns the Filter object's assigned buffer (with envelope or Spatial Object). |
FeatureCoordSys |
getFeatureCoordSys()
Returns the FeatureCoordSys object. |
long |
getFeatureLimit()
Returns the featurelimit value. |
FilterCoordSys |
getFilterCoordSys()
Returns the FilterCoordSys associated with this Filter . |
String |
getJoinExpression()
Returns the join expression associated with the Filter object. |
String |
getJoinTable()
Returns the table name for the table join. |
String |
getOrderBy()
Returns the order by attribute value. |
String |
getRelation()
Returns the filter relation string. |
String |
getSearchOrder()
Returns the search order string associated with the Filter object. |
Object |
getSpatialObject()
Deprecated. As of ArcIMS 4.0.1 Java Connector, replaced by getSpatialShape() . |
Shape |
getSpatialShape()
Returns Shape(Points,Line,Polygon and Envelope) specified in a spatial filter |
String |
getSubField(int index)
Returns the subfields string associated with this Filter object. |
int |
getSubFieldsCount()
Returns the count of all subfields values from the subfields collection. |
String |
getWhereExpression()
Returns the Filter objects 'Where' expression. |
boolean |
isBoundingEnvelope()
Returns 'True', if the setBoundingEnvelope method was set to 'True'. |
boolean |
isCheckesc()
Returns 'True', if inclusion of escaped characters have been enabled. |
boolean |
isGlobalEnvelope()
Returns 'True', if the setGlobalEnvelope method is set to 'True'. |
boolean |
isSkipFeatures()
Returns the boolean value "true" or "false". |
Object |
removeSubField(int index)
Removes a subfields string at given index from the subfields collection. |
void |
setAccuracy(double value)
Sets the accuracy for the Filter object. |
void |
setBeginRecord(long value)
Set the beginrecord value for the filter object. |
void |
setBoundingEnvelope(boolean value)
Specifies the option to return the bounding envelope for each returned feature. |
void |
setBufferObject(Buffer obj)
Assigns a Buffer object to the Filter object. |
void |
setCheckesc(boolean value)
Enables the returned data to include escaped characters for ampersand, single quote, double quote, less than, and greater than. |
void |
setEnvelopeBuffer(Buffer obj)
Sets a Buffer object to this Filter object. |
void |
setFeatureCoordSys(FeatureCoordSys obj)
Assigns the given FeatureCoordSys to this Filter . |
void |
setFeatureLimit(long value)
Sets the featurelimit value for the filter object. |
void |
setFilterCoordSys(FilterCoordSys obj)
Assigns a FilterCoordSys to this Filter . |
void |
setGlobalEnvelope(boolean value)
Specifies the generation of the global envelope. |
void |
setJoinExpression(String value)
Sets the given join expression for the Filter object. |
void |
setJoinTable(String tableName)
Sets the table name for the table to join to. |
void |
setOrderBy(String orderBy)
Sets the order by attribute value for spatial query. |
void |
setRelation(String value)
Sets the given filter relation for the Filter object. |
void |
setSearchOrder(String value)
Sets the given search order for the Filter object. |
void |
setSkipFeatures(boolean value)
Set this to return only the count of features without including any information on individual features. |
void |
setSpatialObject(Object obj)
Deprecated. As of ArcIMS 4.0.1 Java Connector, replaced by setSpatialShape(com.esri.aims.mtier.model.acetate.Shape) . |
void |
setSpatialShape(Shape newShape)
Sets Shape(Points, Line, Polygon, Envelope)for a spatial filter To pass a single Point as the filter create a Points object with only one Point. |
void |
setWhereExpression(String value)
Sets the Filter objects 'Where' expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DECIMAL_DEGREES
public static final String FEET
public static final String METERS
public static final String KILOMETERS
public static final String MILES
public static final String OPTIMIZE
public static final String SPATIALFIRST
public static final String ATTRIBUTEFIRST
public static final String AREA_INTERSECTION
public static final String ENVELOPE_INTERSECTION
Constructor Detail |
---|
public Filter()
Method Detail |
---|
public void setAccuracy(double value)
Filter
object.
The accuracy value sets the value of the attribute "accuracy" in the
SPATIALQUERY element in an ArcXML request. Please refer to ArcXML Programmer's Reference Guide for more information.
filter.setAccuracy(1.0);
value
- default value is 0.0.getAccuracy()
public double getAccuracy()
setAccuracy()
.
double accuracy = filter.getAccuracy();
setAccuracy(double)
public void setFeatureLimit(long value)
filter.setFeatureLimit(25);
value
- the featurelimit value.getFeatureLimit()
public long getFeatureLimit()
long featureLimit = filter.getFeatureLimit();
setFeatureLimit(long)
public void setBeginRecord(long value)
filter.setBeginRecord(5);
value
- the beginrecord valuegetBeginRecord()
public long getBeginRecord()
long beginRecord = filter.getBeginRecord();
setBeginRecord(long)
public void setSkipFeatures(boolean value)
Recordset.getCount()
for more information.
filter.setSkipFeatures(true);
value
- if "true" returns only the count of featuresisSkipFeatures()
public boolean isSkipFeatures()
if(filter.isSkipFeatures() == true){
filter.setSkipFeatures(false);
}
setSkipFeatures(boolean)
public void setJoinExpression(String value)
Filter
object.
This method sets the attribute "joinexpression" in the
SPATIALQUERY element in an ArcXML request.
Please refer to ArcXML Programmer's Reference Guide for more information.
filter.setJoinExpression("To=[counties.FIPS],From=[countyinfo.FIPS],Type=[scan]");
value
- the join expression.public String getJoinExpression()
Filter
object.
String joinExpression = filter.getJoinExpression();
public void setSearchOrder(String value)
Filter
object.
This method sets the attribute "searchorder" in the
SPATIALQUERY element in an ArcXML request.
Please refer to ArcXML Programmer's Reference Guide for more information.
filter.setSearchOrder(filter.OPTIMIZE);
value
- the search order string.public String getSearchOrder()
Filter
object.
String searchorder = filter.getSearchOrder();
public void addSubField(String value)
TableDesc
of the Recordset
property of the FeatureLayer still saves ALL the
fields. Please see KB article 24050 for more information.
filter.addSubField("COUNTRY_NAME");
value
- the subfields string.public String getSubField(int index)
Filter
object.
String subfield = filter.getSubField(1);
index
- the subfield to return.
public int getSubFieldsCount()
int count = filter.getSubFieldsCount();
public void clearSubFields()
filter.clearSubFields();
public Object removeSubField(int index)
java.lang.Object subField = filter.removeSubField(1);
index
- the subfield by index.
clearSubFields()
public void setWhereExpression(String value)
Filter
objects 'Where' expression.
filter.setWhereExpression("NAME='NINEMILE'");
value
- the where expression string.public String getWhereExpression()
Filter
objects 'Where' expression.
String where = filter.getWhereExpression();
public void setJoinTable(String tableName)
filter.setJoinTable("DISTRICTS");
tableName
- the first table.getJoinTable()
public String getJoinTable()
String joinTable = filter.getJoinTable();
setJoinTable(java.lang.String)
public void setSpatialObject(Object obj)
setSpatialShape(com.esri.aims.mtier.model.acetate.Shape)
.
Envelope env = new Envelope();
env.setMinX(-129.00);
env.setMaxX(-100.00);
env.setMaxY(45.0);
env.setMinY(35.0);
filter.setSpatialObject(env);
obj
- the spatial object.public void setSpatialShape(Shape newShape)
public void clearSpatialObjects()
filter.clearSpatialObjects();
public Object getSpatialObject()
getSpatialShape()
.
Envelope env = (Envelope)filter.getSpatialObject();
public Shape getSpatialShape()
public void setRelation(String value)
Filter
object.
This method sets the attribute "relation" in the
SPATIALFILTER element in an ArcXML request.
Please refer to ArcXML Programmer's Reference Guide for more information.
filter.setRelation(filter.AREA_INTERSECTION);
value
- the relation value.public String getRelation()
String relation = filter.getRelation();
public void setFeatureCoordSys(FeatureCoordSys obj)
FeatureCoordSys
to this Filter
.
This method set the element FEATURECOORDSYS.
Please refer to ArcXML Programmer's Reference Guide for more information.
FeatureCoordSys featureCoordSys = new FeatureCoordSys();
featureCoordSys.setID(4326);
filter.setFeatureCoordSys(featureCoordSys);
obj
- the FeatureCoordSys object.public FeatureCoordSys getFeatureCoordSys()
FeatureCoordSys
object.
FeatureCoordSys featureCoordSys = filter.getFeatureCoordSys();
public void setFilterCoordSys(FilterCoordSys obj)
FilterCoordSys
to this Filter
.
This method sets the element FILTERCOORDSYS.
Please refer to ArcXML Programmer's Reference Guide for more information.
FilterCoordSys filterCoordSys = new FilterCoordSys();
filterCoordSys.setID(4326);
filter.setFilterCoordSys(filterCoordSys);
obj
- the FilterCoordSys object.public FilterCoordSys getFilterCoordSys()
FilterCoordSys
associated with this Filter
.
FilterCoordSys filterCoordSys = filter.getFilterCoordSys();
FilterCoordSys
object.public void setBoundingEnvelope(boolean value)
filter.setBoundingEnvelope(true);
value
- the envelope value.isBoundingEnvelope()
public boolean isBoundingEnvelope()
setBoundingEnvelope
method was set to 'True'. If set to
'True', bounding envelopes will be generated for each feature.
if(filter.isBoundingEnvelope() == true){
filter.setBoundingEnvelope(false);
}
setBoundingEnvelope(boolean)
public void setGlobalEnvelope(boolean value)
filter.setGlobalEnvelope(false);
value
- the global envelope value - a boolean.isGlobalEnvelope()
public boolean isGlobalEnvelope()
setGlobalEnvelope
method is set to 'True'. If
'True' is returned, global envelope will be created.
if(filter.isGlobalEnvelope() == true){
filter.setGlobalEnvelope(false);
}
setGlobalEnvelope(boolean)
public void setCheckesc(boolean value)
filter.setCheckesc(true);
value
- enables inclusion of escaped characters.isCheckesc()
public boolean isCheckesc()
if(filter.isCheckesc() == true){
filter.setCheckesc(false);
}
setCheckesc(boolean)
public void setBufferObject(Buffer obj)
setEnvelopeBuffer
for Buffer without target
layer. This method can work with both setWhereExpression
and
setSpatialShape
.
FeatureLayer fLayer = (FeatureLayer)map.getLayers().item(5); //city layer
FeatureLayer tLayer = new FeatureLayer(fLayer.getID(),fLayer.getMaxScale(),fLayer.getMinScale());
tLayer.setRecordset(fLayer.getRecordset());
...
buffer.setBufferTargetLayer(tLayer);
filter.setBufferObject(buffer);
fLayer.setFilterObject(filter);
KB article 26255 discusses this issue.
obj
- the Buffer object to assigngetBufferObject()
,
setEnvelopeBuffer(com.esri.aims.mtier.model.map.layer.query.Buffer)
public Buffer getBufferObject()
Buffer buffer = filter.getBufferObject();
setBufferObject(com.esri.aims.mtier.model.map.layer.query.Buffer)
public void setEnvelopeBuffer(Buffer obj)
setEnvelopeBuffer
and setBufferObject
is that the Buffer object in setEnvelopeBuffer
has no target layer.
This method works with setSpatialShape
.
Example:
Aobve code will build a buffer around the envelope and select features in the "featureLayer"
that fall within the buffer.
Although this method is called
Envelope env = new Envelope();
env.setMaxX(-121.823);
env.setMaxY(37.265);
env.setMinX(-121.98);
env.setMinY(37.398);
filter.setSpatialShape(env);
Buffer buffer = new Buffer();
buffer.setBufferDistance(25.0);
filter.setEnvelopeBuffer(buffer);
featureLayer.setFilterObject(filter);
setEnvelopeBuffer
, setSpatialShape
takes more than Envelope, you can pass Points, Line, and Polygon, but not Point. To pass a single Point as the filter
create a Points object with only one Point.
obj
- the Buffer object to assigngetEnvelopeBuffer()
,
setBufferObject(com.esri.aims.mtier.model.map.layer.query.Buffer)
public Buffer getEnvelopeBuffer()
Buffer buffer = filter.getEnvelopeBuffer();
setEnvelopeBuffer(com.esri.aims.mtier.model.map.layer.query.Buffer)
public void setOrderBy(String orderBy)
orderBy
- the order by valuepublic String getOrderBy()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |