blob: 7f6c0b75a78a8f31d59500c05b1894fc125084e9 [file] [log] [blame]
drop dataverse test if exists;
create dataverse test;
use dataverse test;
create type MyRecord as open {
id: int32,
point: point,
kwds: string
}
create external dataset MyData(MyRecord)
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
write output to nc1:"rttest/spatial_spatial-area.adm";
let $polygonArea := spatial-area(create-polygon(create-point(1.0,1.0),create-point(1.0,4.0),create-point(3.0,4.0),create-point(3.0,1.0)))
let $circleArea := spatial-area(create-circle(create-point(0.0,0.0), 1.0))
let $rectangleArea := spatial-area(create-rectangle(create-point(0.0,5.0), create-point(8.0,8.0)))
return {"polygonArea":$polygonArea, "circleArea":$circleArea, "rectangleArea":$rectangleArea}