This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-zerotierone/ext/librethinkdbxx/test/upstream/geo/primitives.yaml
2017-11-02 07:05:11 -07:00

51 lines
3.7 KiB
YAML

desc: Test geometric primitive constructors
tests:
# Circle
- js: r.circle([0,0], 1, {num_vertices:3})
py: r.circle([0,0], 1, num_vertices=3)
rb: r.circle([0,0], 1, :num_vertices=>3)
ot: ({'$reql_type$':'GEOMETRY', 'coordinates':[[[0, -9.04369477050382e-06], [-7.779638566553426e-06, 4.5218473852518965e-06], [7.779638566553426e-06, 4.5218473852518965e-06], [0, -9.04369477050382e-06]]], 'type':'Polygon'})
- js: r.circle(r.point(0,0), 1, {num_vertices:3})
py: r.circle(r.point(0,0), 1, num_vertices=3)
rb: r.circle(r.point(0,0), 1, :num_vertices=>3)
ot: ({'$reql_type$':'GEOMETRY', 'coordinates':[[[0, -9.04369477050382e-06], [-7.779638566553426e-06, 4.5218473852518965e-06], [7.779638566553426e-06, 4.5218473852518965e-06], [0, -9.04369477050382e-06]]], 'type':'Polygon'})
- js: r.circle([0,0], 1, {num_vertices:3, fill:false})
py: r.circle([0,0], 1, num_vertices=3, fill=false)
rb: r.circle([0,0], 1, :num_vertices=>3, :fill=>false)
ot: ({'$reql_type$':'GEOMETRY', 'coordinates':[[0, -9.04369477050382e-06], [-7.779638566553426e-06, 4.5218473852518965e-06], [7.779638566553426e-06, 4.5218473852518965e-06], [0, -9.04369477050382e-06]], 'type':'LineString'})
- js: r.circle([0,0], 14000000, {num_vertices:3})
py: r.circle([0,0], 14000000, num_vertices=3)
rb: r.circle([0,0], 14000000, :num_vertices=>3)
ot: err('ReqlQueryLogicError', 'Radius must be smaller than a quarter of the circumference along the minor axis of the reference ellipsoid. Got 14000000m, but must be smaller than 9985163.1855612862855m.', [0])
- js: r.circle([0,0], 1, {num_vertices:3, geo_system:'WGS84'})
py: r.circle([0,0], 1, num_vertices=3, geo_system='WGS84')
rb: r.circle([0,0], 1, :num_vertices=>3, :geo_system=>'WGS84')
ot: ({'$reql_type$':'GEOMETRY', 'coordinates':[[[0, -9.04369477050382e-06], [-7.779638566553426e-06, 4.5218473852518965e-06], [7.779638566553426e-06, 4.5218473852518965e-06], [0, -9.04369477050382e-06]]], 'type':'Polygon'})
- js: r.circle([0,0], 2, {num_vertices:3, geo_system:'unit_'+'sphere'})
py: r.circle([0,0], 2, num_vertices=3, geo_system='unit_sphere')
rb: r.circle([0,0], 2, :num_vertices=>3, :geo_system=>'unit_sphere')
ot: err('ReqlQueryLogicError', 'Radius must be smaller than a quarter of the circumference along the minor axis of the reference ellipsoid. Got 2m, but must be smaller than 1.570796326794896558m.', [0])
- js: r.circle([0,0], 0.1, {num_vertices:3, geo_system:'unit_'+'sphere'})
py: r.circle([0,0], 0.1, num_vertices=3, geo_system='unit_sphere')
rb: r.circle([0,0], 0.1, :num_vertices=>3, :geo_system=>'unit_sphere')
ot: ({'$reql_type$':'GEOMETRY', 'coordinates':[[[0, -5.729577951308232], [-4.966092947444857, 2.861205754495701], [4.966092947444857, 2.861205754495701], [0, -5.729577951308232]]], 'type':'Polygon'})
testopts:
precision: 0.0000000000001
- js: r.circle([0,0], 1.0/1000.0, {num_vertices:3, unit:'km'})
py: r.circle([0,0], 1.0/1000.0, num_vertices=3, unit='km')
rb: r.circle([0,0], 1.0/1000.0, :num_vertices=>3, :unit=>'km')
ot: ({'$reql_type$':'GEOMETRY', 'coordinates':[[[0, -9.04369477050382e-06], [-7.779638566553426e-06, 4.5218473852518965e-06], [7.779638566553426e-06, 4.5218473852518965e-06], [0, -9.04369477050382e-06]]], 'type':'Polygon'})
- js: r.circle([0,0], 1.0/1609.344, {num_vertices:3, unit:'mi'})
py: r.circle([0,0], 1.0/1609.344, num_vertices=3, unit='mi')
rb: r.circle([0,0], 1.0/1609.344, :num_vertices=>3, :unit=>'mi')
ot: ({'$reql_type$':'GEOMETRY', 'coordinates':[[[0, -9.04369477050382e-06], [-7.779638566553426e-06, 4.5218473852518965e-06], [7.779638566553426e-06, 4.5218473852518965e-06], [0, -9.04369477050382e-06]]], 'type':'Polygon'})