blob: 19df2dbbf675a94243b674d41947fd3253f39bb0 [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001drop dataverse test if exists;
2create dataverse test;
3use dataverse test;
4
5create type MyRecord as closed {
6 id: int32,
7 point: point,
8 kwds: string,
9 line1: line,
10 line2: line,
11 poly1: polygon,
12 poly2: polygon,
salsubaiee@gmail.com2a0d8172012-11-11 22:31:52 +000013 rec: rectangle,
14 circle: circle
vinayakb38b7ca42012-03-05 05:44:15 +000015}
16
vinayakb38b7ca42012-03-05 05:44:15 +000017create dataset MyData(MyRecord)
ramangrover29669d8f62013-02-11 06:03:32 +000018 primary key id;
vinayakb38b7ca42012-03-05 05:44:15 +000019
20load dataset MyData
21using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
22(("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
23
24create index rtree_index_point on MyData(point) type rtree;
25
alexander.behmc576c602012-07-06 02:41:15 +000026write output to nc1:"rttest/index-selection_rtree-secondary-index.adm";
vinayakb38b7ca42012-03-05 05:44:15 +000027
28for $o in dataset('MyData')
29where spatial-intersect($o.point, create-polygon(create-point(4.0,1.0), create-point(4.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0)))
30order by $o.id
31return {"id":$o.id}