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});
// 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
- 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
- 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