blob: e755aa9fb94a4050bde3e2f78ca96e139e7e8dbe [file] [log] [blame]
salsubaiee@gmail.com2a0d8172012-11-11 22:31:52 +00001/*
2 * Description : Create r-tree indexes for all spatial data types.
3 * Success : Yes
4 */
5
6
7drop dataverse test if exists;
8create dataverse test;
9use dataverse test;
10
11create type SpatialType as open {
12 id: int32,
13 point: point,
14 line1: line,
15 poly1: polygon,
16 rec: rectangle,
17 circle: circle
18}
19
20create dataset MyData(SpatialType) partitioned by key id;
21create index rtree_index1 on MyData(point) type rtree;
22create index rtree_index2 on MyData(line1) type rtree;
23create index rtree_index3 on MyData(poly1) type rtree;
24create index rtree_index5 on MyData(rec) type rtree;
25create index rtree_index4 on MyData(circle) type rtree;
26
27write output to nc1:"rttest/spatial_create-rtree-index.adm";
28
29load dataset MyData
30using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
31(("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
32
33for $a in dataset('MyData')
34return $a.id