Geomajas, Geomajas server: Main - commands 1.15.1

org.geomajas.command.dto
Class SearchByLocationRequest

java.lang.Object
  extended by org.geomajas.command.dto.SearchByLocationRequest
All Implemented Interfaces:
Serializable, CommandRequest

@Api(allMethods=true)
public class SearchByLocationRequest
extends Object
implements CommandRequest

Request object for SearchByLocationCommand.

Since:
1.6.0
Author:
Joachim Van der Auwera, Oliver May, An Buyle
See Also:
Serialized Form

Field Summary
static String COMMAND
          Command name for this request.
static int QUERY_CONTAINS
          Use contains query.
static int QUERY_INTERSECTS
          Use an intersects query.
static int QUERY_TOUCHES
          Use touches query.
static int QUERY_WITHIN
          Use within query.
static int SEARCH_ALL_LAYERS
          Search type in which all layers are searched for a result, and more than one result may be returned.
static int SEARCH_FIRST_LAYER
          Search type in which the layers are searched from the beginning to the end of the array until a result is found.
 
Constructor Summary
SearchByLocationRequest()
           
 
Method Summary
 void addLayerWithFilter(String resultTag, String serverLayerId, String filter)
          Add a layer with an optional filter expression which should be applied on the given layer.
 double getBuffer()
          Get the optional buffer that should be added around the location before executing the search.
 String getCrs()
          Get the coordinate reference space which should be used for the returned geometries.
 int getFeatureIncludes()
          Get which data should be included in the features.
 String getFilter()
          Get the global filter expression which should be applied on all layers.
 String getFilter(String resultTag)
          Get the filter expression which should be applied on the layer for the specified result tag (e.g.
 String[] getLayerIds()
          Get the result tags for layer specific filtering (e.g.
 Geometry getLocation()
          The geometric description of the location to search features at.
 int getQueryType()
           Type of geometric query to be executed.
 float getRatio()
          This option can only be used in case of an intersects query.
 int getSearchType()
          Get the type of search.
 String getServerLayerId(String resultTag)
          Get the server layer id for the specified result tag (e.g.
 void setBuffer(double buffer)
          Set a buffer that should be added to the location before executing the search.
 void setCrs(String crs)
          Set the coordinate reference space which should be used for the returned geometries.
 void setFeatureIncludes(int featureIncludes)
          Set the data to include in the features which are returned.
 void setFilter(String filter)
          Set the global filter expression which should be applied.
 void setFilter(String serverLayerId, String filter)
          Deprecated. use addLayerWithFilter(String, String, String).
 void setLayerIds(String[] serverLayerIds)
          Set the server layer ids.
 void setLocation(Geometry location)
          Set the geometry to use as search location.
 void setQueryType(int queryType)
           Type of geometric query to be executed.
 void setRatio(float ratio)
          This option can only be used in case of an intersects query.
 void setSearchType(int searchType)
          Set a new type of search.
 String toString()
          Build string representation of object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMMAND

public static final String COMMAND
Command name for this request.

Since:
1.9.0
See Also:
Constant Field Values

SEARCH_FIRST_LAYER

public static final int SEARCH_FIRST_LAYER
Search type in which the layers are searched from the beginning to the end of the array until a result is found. In other words when a layer returns a successful result, the command will look no further.

See Also:
Constant Field Values

SEARCH_ALL_LAYERS

public static final int SEARCH_ALL_LAYERS
Search type in which all layers are searched for a result, and more than one result may be returned.

See Also:
Constant Field Values

QUERY_INTERSECTS

public static final int QUERY_INTERSECTS
Use an intersects query. If ratio is between 0 and 1, it will accept geometries that intersects partially with the given location. (depending on the value of the ratio).

See Also:
Constant Field Values

QUERY_TOUCHES

public static final int QUERY_TOUCHES
Use touches query.

See Also:
Constant Field Values

QUERY_WITHIN

public static final int QUERY_WITHIN
Use within query.

See Also:
Constant Field Values

QUERY_CONTAINS

public static final int QUERY_CONTAINS
Use contains query.

See Also:
Constant Field Values
Constructor Detail

SearchByLocationRequest

public SearchByLocationRequest()
Method Detail

getLocation

public Geometry getLocation()
The geometric description of the location to search features at.

Returns:
location

setLocation

public void setLocation(Geometry location)
Set the geometry to use as search location.

Parameters:
location - location

getQueryType

public int getQueryType()

Type of geometric query to be executed. Default is "QUERY_INTERSECTS". All options are:

Returns:
query type

setQueryType

public void setQueryType(int queryType)

Type of geometric query to be executed. Default is "QUERY_INTERSECTS". All options are:

Parameters:
queryType - The new type of query

getRatio

public float getRatio()
This option can only be used in case of an intersects query. It accepts features whose geometry intersect with the given geometry for at least the given ratio. This number must always be a value between 0 and 1.

Returns:
minimum match ratio

setRatio

public void setRatio(float ratio)
This option can only be used in case of an intersects query. It accepts features whose geometry intersect with the given geometry for at least the given ratio. This number must always be a value between 0 and 1.

Parameters:
ratio - The new ratio

getCrs

public String getCrs()
Get the coordinate reference space which should be used for the returned geometries.

Returns:
The map's coordinate reference system.

setCrs

public void setCrs(String crs)
Set the coordinate reference space which should be used for the returned geometries.

Parameters:
crs - The map's coordinate reference system.

getSearchType

public int getSearchType()
Get the type of search. Can be either 1 (=SEARCH_FIRST_LAYER), or 2 (=SEARCH_ALL_LAYERS).

Returns:
search type

setSearchType

public void setSearchType(int searchType)
Set a new type of search. Can be either 1 (=SEARCH_FIRST_LAYER), or 2 (=SEARCH_ALL_LAYERS).

Parameters:
searchType - search type

getBuffer

public double getBuffer()
Get the optional buffer that should be added around the location before executing the search.

Returns:
buffer size

setBuffer

public void setBuffer(double buffer)
Set a buffer that should be added to the location before executing the search.

Parameters:
buffer - buffer size

getFeatureIncludes

public int getFeatureIncludes()
Get which data should be included in the features. For possible values, see VectorLayerService.

Returns:
what to include

setFeatureIncludes

public void setFeatureIncludes(int featureIncludes)
Set the data to include in the features which are returned. For possible values, see VectorLayerService.

Parameters:
featureIncludes - what the include

addLayerWithFilter

public void addLayerWithFilter(String resultTag,
                               String serverLayerId,
                               String filter)
Add a layer with an optional filter expression which should be applied on the given layer.

If the filter contains a geometry, then this needs to be in layer CRS, it is not converted!

Parameters:
resultTag - tag to make the distinction in the response object between the features for the same serverLayerId but a different filter (e.g. client layer id)
serverLayerId - server layerId layer to set this filter on
filter - filter expression for the specified layer, can be null (==true filter)no client layer specific filtering
Since:
1.10.0

setFilter

@Deprecated
public void setFilter(String serverLayerId,
                                 String filter)
Deprecated. use addLayerWithFilter(String, String, String).

Set the filter expression which should be applied on the given server layer. If there has already been specified a filter for that server layer, it will be overwritten.

If the filter contains a geometry, then this needs to be in layer CRS, it is not converted!

Parameters:
serverLayerId - server layer to set this filter on
filter - filter expression
Since:
1.9.0

getFilter

public String getFilter(String resultTag)
Get the filter expression which should be applied on the layer for the specified result tag (e.g. client layer id) as specified in the filters map.

Parameters:
resultTag - result tag for the layer filter specification
Returns:
filter expression, which can be null if no layer specific filter needs to be applied (=true filter)
Since:
1.9.0

getServerLayerId

public String getServerLayerId(String resultTag)
Get the server layer id for the specified result tag (e.g. client layer id).

Parameters:
resultTag - result tag for the layer filter specification (e.g. client layer id)
Returns:
server layer id
Since:
1.10.0

getLayerIds

public String[] getLayerIds()
Get the result tags for layer specific filtering (e.g. client layer id's).

Returns:
result tags for layer specific filtering (e.g. client layer id's)
Since:
1.10.0

setLayerIds

public void setLayerIds(String[] serverLayerIds)
Set the server layer ids.

Note: use addLayerWithFilter(String, String, String) to specify filter expressions

Parameters:
serverLayerIds - server layer ids
Since:
1.9.0

setFilter

public void setFilter(String filter)
Set the global filter expression which should be applied.

If the filter contains a geometry, then this needs to be in layer CRS, it is not converted! Note that this is a global filter that will be applied to all layers, when filtering on attributes these must be set on all layers. To add filters to individual layers use setFilter(String layerId, String filter).

Parameters:
filter - filter expression
Since:
1.8.0

getFilter

public String getFilter()
Get the global filter expression which should be applied on all layers.

If the filter contains a geometry, then this needs to be in layer CRS, it is not converted! Note that this is a global filter that will be applied to all layers, when filtering on attributes these must be set on all layers. To add filters to individual layers use setFilter(String layerId, String filter).

Returns:
filter expression
Since:
1.8.0

toString

public String toString()
Build string representation of object.

Overrides:
toString in class Object
Returns:
string
Since:
1.8.0

Geomajas, Geomajas server: Main - commands 1.15.1

Copyright © 2014 Geosparc. All Rights Reserved.