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

get

/spatialviewer/api/v1/spark/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/spark/filterByIndex?indexPath=/user/oracle/spatialviewer/TweetsJune&queryWindow={"type":"Rectangle","srid":8307,"coordinates":[-116.71875109864604,29.0139035635888,-59.06250208499334,50.80315612882312]}',
jsonp: true},
boundingTheme: true});

Request

Query Parameters
indexPath
Type: string
Required: true
The index path in HDFS.
Example: /user/oracle/spatialviewer/TweetsJune
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