vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | drop dataverse test if exists; |
| 2 | create dataverse test; |
| 3 | use dataverse test; |
| 4 | |
| 5 | create 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.com | 2a0d817 | 2012-11-11 22:31:52 +0000 | [diff] [blame] | 13 | rec: rectangle, |
| 14 | circle: circle |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 15 | } |
| 16 | |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 17 | create dataset MyData(MyRecord) |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame^] | 18 | primary key id; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 19 | |
| 20 | load dataset MyData |
| 21 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 22 | (("path"="nc1://data/spatial/spatialData.json"),("format"="adm")); |
| 23 | |
| 24 | create index rtree_index_point on MyData(point) type rtree; |
| 25 | |
alexander.behm | c576c60 | 2012-07-06 02:41:15 +0000 | [diff] [blame] | 26 | write output to nc1:"rttest/index-selection_rtree-secondary-index.adm"; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 27 | |
| 28 | for $o in dataset('MyData') |
| 29 | where 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))) |
| 30 | order by $o.id |
| 31 | return {"id":$o.id} |