Filter spatially the records in a spatial index using the Hadoop API

get

/spatialviewer/api/v1/filterByIndex

Note that you can use the service response as data source for the Map API to display the results on map. For example:

// Default http method when fetching remote geospatial contents
OM.gv.setHttpMethod("GET");

tweetsLayer = new OM.layer.VectorLayer("Result",
{
def:{
type:OM.layer.VectorLayer.TYPE_DATAPACK,
url:'http:// :8045/spatialviewer/api/v1/filterByIndex?indexName=TweetsJune&queryWindow={"type":"Rectangle","srid":8307,"coordinates":[-116.71875109864604,29.0139035635888,-59.06250208499334,50.80315612882312]}&heatMapResult=false&mbrFilter=true',
jsonp: true},
boundingTheme: true});

Request

Query Parameters
heatMapResult
Type: boolean
true if we want to get a heat map as result. If false then the data actual shape will be returned. False by default. Note that if the number of returned data is expected to be huge then it is recommended to set heatMapResult to true.
indexName
Type: string
Required: true
The index name.
Example: TweetsJune
mbrFilter
Type: boolean
If the parameter is true the results will be filtered only using the RTree data (that is data in a particular MBR). If the parameter is false then a second filtering is used. That is if the queryWindow is not an MBR then an extra filtering will be made to match the provided geometry. If possible and for better performance set mbrFilter to true. The parameter will be ignored if the result will be a heat map. False by default.
queryWindow
Type: string
Required: true
The queryWindow in GeoJSON format.
Note that the query window can be created using the Map API toolbar standard tools like the Rectangle tool:
var queryWindow = toolbar.getBuiltInTool(OM.control.ToolBar.BUILTIN_RECTANGLE).getGeometry().transform(8307).toString();

Example: {"type":"Rectangle","srid":8307,"coordinates":[-116.71875109864604,29.0139035635888,-59.06250208499334,50.80315612882312]}

Response

Supported Media Types
  • application/json
200 Response
successful request
Body
Root Schema : RecordsInfo
Type: object
Nested Schema : features
Type: array
Nested Schema : Feature
Type: object
Nested Schema : Geometry
Type: object
Nested Schema : coordinates
Type: array
Nested Schema : properties
Type: object
Extra fields of the filtered records (see 2.8.2.1 Spatial Indexing Class Structure). For example we can have extra fields named followers_count, friends_count, location and user_id