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});
// 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://
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.false
- 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.false
- 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
- copyright
-
Type:
string
Example:Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
- features
-
Type:
array
features - geodetic
-
Type:
boolean
true if the geometries are geodetic, false otherwise.Example:true
- srs
-
Type:
integer
(int32
)SRID of the geometries.Example:8307
- type
-
Type:
string
Example:FeatureCollection
Nested Schema : Feature
Type:
object
- _id
-
Type:
string
Feature id.Example:1
- geometry
-
Type:
object
Geometry - type
-
Type:
string
Example:Feature
Nested Schema : Geometry
Type:
object
- coordinates
-
Type:
array
coordinates - properties
-
Type:
object
propertiesExtra 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 - type
-
Type:
string
Example:Point
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
- followers_count
-
Type:
string
Example:70
- friends_count
-
Type:
string
Example:51
- location
-
Type:
string
Example:Canada
- user_id
-
Type:
string
Example:5039703