rgeo 0.1.21 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.rdoc +11 -0
- data/README.rdoc +1 -1
- data/Spatial_Programming_With_RGeo.rdoc +382 -0
- data/Version +1 -1
- data/lib/active_record/connection_adapters/postgis_adapter.rb +1 -1
- data/lib/rgeo.rb +4 -4
- data/lib/rgeo/active_record/base_modifications.rb +1 -1
- data/lib/rgeo/all.rb +1 -1
- data/lib/rgeo/cartesian/bounding_box.rb +2 -2
- data/lib/rgeo/cartesian/factory.rb +18 -11
- data/lib/rgeo/cartesian/interface.rb +4 -4
- data/lib/rgeo/coord_sys.rb +8 -1
- data/lib/rgeo/coord_sys/proj4.rb +4 -4
- data/lib/rgeo/feature/factory.rb +68 -49
- data/lib/rgeo/feature/factory_generator.rb +2 -2
- data/lib/rgeo/feature/types.rb +4 -4
- data/lib/rgeo/geo_json/coder.rb +5 -5
- data/lib/rgeo/{geography.rb → geographic.rb} +15 -15
- data/lib/rgeo/{geography → geographic}/factory.rb +27 -20
- data/lib/rgeo/{geography → geographic}/interface.rb +43 -29
- data/lib/rgeo/{geography → geographic}/proj4_projector.rb +2 -2
- data/lib/rgeo/{geography → geographic}/projected_feature_classes.rb +2 -2
- data/lib/rgeo/{geography → geographic}/projected_feature_methods.rb +2 -2
- data/lib/rgeo/{geography → geographic}/projected_window.rb +5 -5
- data/lib/rgeo/{geography → geographic}/simple_mercator_projector.rb +2 -2
- data/lib/rgeo/{geography → geographic}/spherical_feature_classes.rb +2 -2
- data/lib/rgeo/{geography → geographic}/spherical_feature_methods.rb +2 -2
- data/lib/rgeo/{geography → geographic}/spherical_math.rb +1 -1
- data/lib/rgeo/geos/factory.rb +22 -15
- data/lib/rgeo/geos/interface.rb +3 -3
- data/lib/rgeo/geos/zm_factory.rb +20 -6
- data/lib/rgeo/impl_helper/basic_point_methods.rb +2 -2
- data/lib/rgeo/shapefile/reader.rb +5 -5
- data/lib/rgeo/wkrep/wkb_generator.rb +2 -2
- data/lib/rgeo/wkrep/wkb_parser.rb +4 -4
- data/lib/rgeo/wkrep/wkt_generator.rb +2 -2
- data/lib/rgeo/wkrep/wkt_parser.rb +7 -7
- data/test/active_record/common_setup_methods.rb +1 -1
- data/test/geos/tc_point.rb +3 -3
- data/test/geos/tc_zmfactory.rb +7 -7
- data/test/{projected_geography → projected_geographic}/tc_geometry_collection.rb +2 -2
- data/test/{projected_geography → projected_geographic}/tc_line_string.rb +2 -2
- data/test/{projected_geography → projected_geographic}/tc_multi_line_string.rb +2 -2
- data/test/{projected_geography → projected_geographic}/tc_multi_point.rb +2 -2
- data/test/{projected_geography → projected_geographic}/tc_multi_polygon.rb +3 -3
- data/test/{projected_geography → projected_geographic}/tc_point.rb +5 -5
- data/test/{projected_geography → projected_geographic}/tc_polygon.rb +2 -2
- data/test/shapefile/tc_shapelib_tests.rb +10 -10
- data/test/simple_cartesian/tc_point.rb +3 -3
- data/test/simple_mercator/tc_geometry_collection.rb +1 -1
- data/test/simple_mercator/tc_line_string.rb +1 -1
- data/test/simple_mercator/tc_multi_line_string.rb +1 -1
- data/test/simple_mercator/tc_multi_point.rb +1 -1
- data/test/simple_mercator/tc_multi_polygon.rb +2 -2
- data/test/simple_mercator/tc_point.rb +4 -4
- data/test/simple_mercator/tc_polygon.rb +1 -1
- data/test/simple_mercator/tc_window.rb +39 -39
- data/test/spherical_geographic/tc_calculations.rb +203 -0
- data/test/{spherical_geography → spherical_geographic}/tc_geometry_collection.rb +2 -2
- data/test/{spherical_geography → spherical_geographic}/tc_line_string.rb +2 -2
- data/test/{spherical_geography → spherical_geographic}/tc_multi_line_string.rb +2 -2
- data/test/{spherical_geography → spherical_geographic}/tc_multi_point.rb +2 -2
- data/test/{spherical_geography → spherical_geographic}/tc_multi_polygon.rb +3 -3
- data/test/{spherical_geography → spherical_geographic}/tc_point.rb +6 -6
- data/test/{spherical_geography → spherical_geographic}/tc_polygon.rb +2 -2
- data/test/tc_geojson.rb +3 -3
- data/test/tc_oneoff.rb +5 -5
- data/test/wkrep/tc_wkb_generator.rb +3 -3
- data/test/wkrep/tc_wkb_parser.rb +16 -16
- data/test/wkrep/tc_wkt_generator.rb +3 -3
- data/test/wkrep/tc_wkt_parser.rb +21 -21
- metadata +46 -44
- data/test/spherical_geography/tc_calculations.rb +0 -203
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 22
|
9
|
+
version: 0.1.22
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Daniel Azuma
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-12-
|
17
|
+
date: 2010-12-06 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -117,6 +117,7 @@ extensions:
|
|
117
117
|
extra_rdoc_files:
|
118
118
|
- History.rdoc
|
119
119
|
- README.rdoc
|
120
|
+
- Spatial_Programming_With_RGeo.rdoc
|
120
121
|
files:
|
121
122
|
- lib/active_record/connection_adapters/mysql2spatial_adapter.rb
|
122
123
|
- lib/active_record/connection_adapters/mysqlspatial_adapter.rb
|
@@ -160,17 +161,17 @@ files:
|
|
160
161
|
- lib/rgeo/geo_json/entities.rb
|
161
162
|
- lib/rgeo/geo_json/interface.rb
|
162
163
|
- lib/rgeo/geo_json.rb
|
163
|
-
- lib/rgeo/
|
164
|
-
- lib/rgeo/
|
165
|
-
- lib/rgeo/
|
166
|
-
- lib/rgeo/
|
167
|
-
- lib/rgeo/
|
168
|
-
- lib/rgeo/
|
169
|
-
- lib/rgeo/
|
170
|
-
- lib/rgeo/
|
171
|
-
- lib/rgeo/
|
172
|
-
- lib/rgeo/
|
173
|
-
- lib/rgeo/
|
164
|
+
- lib/rgeo/geographic/factory.rb
|
165
|
+
- lib/rgeo/geographic/interface.rb
|
166
|
+
- lib/rgeo/geographic/proj4_projector.rb
|
167
|
+
- lib/rgeo/geographic/projected_feature_classes.rb
|
168
|
+
- lib/rgeo/geographic/projected_feature_methods.rb
|
169
|
+
- lib/rgeo/geographic/projected_window.rb
|
170
|
+
- lib/rgeo/geographic/simple_mercator_projector.rb
|
171
|
+
- lib/rgeo/geographic/spherical_feature_classes.rb
|
172
|
+
- lib/rgeo/geographic/spherical_feature_methods.rb
|
173
|
+
- lib/rgeo/geographic/spherical_math.rb
|
174
|
+
- lib/rgeo/geographic.rb
|
174
175
|
- lib/rgeo/geos/factory.rb
|
175
176
|
- lib/rgeo/geos/impl_additions.rb
|
176
177
|
- lib/rgeo/geos/interface.rb
|
@@ -195,6 +196,7 @@ files:
|
|
195
196
|
- lib/rgeo.rb
|
196
197
|
- History.rdoc
|
197
198
|
- README.rdoc
|
199
|
+
- Spatial_Programming_With_RGeo.rdoc
|
198
200
|
- test/active_record/common_setup_methods.rb
|
199
201
|
- test/active_record/tc_mysqlspatial.rb
|
200
202
|
- test/active_record/tc_postgis.rb
|
@@ -217,13 +219,13 @@ files:
|
|
217
219
|
- test/geos/tc_point.rb
|
218
220
|
- test/geos/tc_polygon.rb
|
219
221
|
- test/geos/tc_zmfactory.rb
|
220
|
-
- test/
|
221
|
-
- test/
|
222
|
-
- test/
|
223
|
-
- test/
|
224
|
-
- test/
|
225
|
-
- test/
|
226
|
-
- test/
|
222
|
+
- test/projected_geographic/tc_geometry_collection.rb
|
223
|
+
- test/projected_geographic/tc_line_string.rb
|
224
|
+
- test/projected_geographic/tc_multi_line_string.rb
|
225
|
+
- test/projected_geographic/tc_multi_point.rb
|
226
|
+
- test/projected_geographic/tc_multi_polygon.rb
|
227
|
+
- test/projected_geographic/tc_point.rb
|
228
|
+
- test/projected_geographic/tc_polygon.rb
|
227
229
|
- test/shapefile/tc_shapelib_tests.rb
|
228
230
|
- test/simple_cartesian/tc_calculations.rb
|
229
231
|
- test/simple_cartesian/tc_geometry_collection.rb
|
@@ -241,14 +243,14 @@ files:
|
|
241
243
|
- test/simple_mercator/tc_point.rb
|
242
244
|
- test/simple_mercator/tc_polygon.rb
|
243
245
|
- test/simple_mercator/tc_window.rb
|
244
|
-
- test/
|
245
|
-
- test/
|
246
|
-
- test/
|
247
|
-
- test/
|
248
|
-
- test/
|
249
|
-
- test/
|
250
|
-
- test/
|
251
|
-
- test/
|
246
|
+
- test/spherical_geographic/tc_calculations.rb
|
247
|
+
- test/spherical_geographic/tc_geometry_collection.rb
|
248
|
+
- test/spherical_geographic/tc_line_string.rb
|
249
|
+
- test/spherical_geographic/tc_multi_line_string.rb
|
250
|
+
- test/spherical_geographic/tc_multi_point.rb
|
251
|
+
- test/spherical_geographic/tc_multi_polygon.rb
|
252
|
+
- test/spherical_geographic/tc_point.rb
|
253
|
+
- test/spherical_geographic/tc_polygon.rb
|
252
254
|
- test/tc_cartesian_analysis.rb
|
253
255
|
- test/tc_geojson.rb
|
254
256
|
- test/tc_oneoff.rb
|
@@ -356,13 +358,13 @@ test_files:
|
|
356
358
|
- test/geos/tc_point.rb
|
357
359
|
- test/geos/tc_polygon.rb
|
358
360
|
- test/geos/tc_zmfactory.rb
|
359
|
-
- test/
|
360
|
-
- test/
|
361
|
-
- test/
|
362
|
-
- test/
|
363
|
-
- test/
|
364
|
-
- test/
|
365
|
-
- test/
|
361
|
+
- test/projected_geographic/tc_geometry_collection.rb
|
362
|
+
- test/projected_geographic/tc_line_string.rb
|
363
|
+
- test/projected_geographic/tc_multi_line_string.rb
|
364
|
+
- test/projected_geographic/tc_multi_point.rb
|
365
|
+
- test/projected_geographic/tc_multi_polygon.rb
|
366
|
+
- test/projected_geographic/tc_point.rb
|
367
|
+
- test/projected_geographic/tc_polygon.rb
|
366
368
|
- test/shapefile/tc_shapelib_tests.rb
|
367
369
|
- test/simple_cartesian/tc_calculations.rb
|
368
370
|
- test/simple_cartesian/tc_geometry_collection.rb
|
@@ -380,14 +382,14 @@ test_files:
|
|
380
382
|
- test/simple_mercator/tc_point.rb
|
381
383
|
- test/simple_mercator/tc_polygon.rb
|
382
384
|
- test/simple_mercator/tc_window.rb
|
383
|
-
- test/
|
384
|
-
- test/
|
385
|
-
- test/
|
386
|
-
- test/
|
387
|
-
- test/
|
388
|
-
- test/
|
389
|
-
- test/
|
390
|
-
- test/
|
385
|
+
- test/spherical_geographic/tc_calculations.rb
|
386
|
+
- test/spherical_geographic/tc_geometry_collection.rb
|
387
|
+
- test/spherical_geographic/tc_line_string.rb
|
388
|
+
- test/spherical_geographic/tc_multi_line_string.rb
|
389
|
+
- test/spherical_geographic/tc_multi_point.rb
|
390
|
+
- test/spherical_geographic/tc_multi_polygon.rb
|
391
|
+
- test/spherical_geographic/tc_point.rb
|
392
|
+
- test/spherical_geographic/tc_polygon.rb
|
391
393
|
- test/tc_cartesian_analysis.rb
|
392
394
|
- test/tc_geojson.rb
|
393
395
|
- test/tc_oneoff.rb
|
@@ -1,203 +0,0 @@
|
|
1
|
-
# -----------------------------------------------------------------------------
|
2
|
-
#
|
3
|
-
# Tests for the internal calculations for simple spherical
|
4
|
-
#
|
5
|
-
# -----------------------------------------------------------------------------
|
6
|
-
# Copyright 2010 Daniel Azuma
|
7
|
-
#
|
8
|
-
# All rights reserved.
|
9
|
-
#
|
10
|
-
# Redistribution and use in source and binary forms, with or without
|
11
|
-
# modification, are permitted provided that the following conditions are met:
|
12
|
-
#
|
13
|
-
# * Redistributions of source code must retain the above copyright notice,
|
14
|
-
# this list of conditions and the following disclaimer.
|
15
|
-
# * Redistributions in binary form must reproduce the above copyright notice,
|
16
|
-
# this list of conditions and the following disclaimer in the documentation
|
17
|
-
# and/or other materials provided with the distribution.
|
18
|
-
# * Neither the name of the copyright holder, nor the names of any other
|
19
|
-
# contributors to this software, may be used to endorse or promote products
|
20
|
-
# derived from this software without specific prior written permission.
|
21
|
-
#
|
22
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
|
-
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
|
-
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
25
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
26
|
-
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
27
|
-
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
28
|
-
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
29
|
-
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
30
|
-
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
31
|
-
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
32
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
33
|
-
# -----------------------------------------------------------------------------
|
34
|
-
;
|
35
|
-
|
36
|
-
|
37
|
-
require 'test/unit'
|
38
|
-
require 'rgeo'
|
39
|
-
|
40
|
-
|
41
|
-
module RGeo
|
42
|
-
module Tests # :nodoc:
|
43
|
-
module SphericalGeography # :nodoc:
|
44
|
-
|
45
|
-
class TestCalculations < ::Test::Unit::TestCase # :nodoc:
|
46
|
-
|
47
|
-
|
48
|
-
def assert_close_enough(v1_, v2_)
|
49
|
-
diff_ = (v1_ - v2_).abs
|
50
|
-
# denom_ = (v1_ + v2_).abs
|
51
|
-
# diff_ /= denom_ if denom_ > 0.01
|
52
|
-
assert(diff_ < 0.00000001, "#{v1_} is not close to #{v2_}")
|
53
|
-
end
|
54
|
-
|
55
|
-
|
56
|
-
def test_point_eql
|
57
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0, 0)
|
58
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0, 0)
|
59
|
-
assert_equal(point1_, point2_)
|
60
|
-
end
|
61
|
-
|
62
|
-
|
63
|
-
def test_point_from_latlng
|
64
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.from_latlon(45, -45)
|
65
|
-
assert_close_enough(0.5, point1_.x)
|
66
|
-
assert_close_enough(-0.5, point1_.y)
|
67
|
-
assert_close_enough(::Math.sqrt(2) * 0.5, point1_.z)
|
68
|
-
end
|
69
|
-
|
70
|
-
|
71
|
-
def test_point_dot_one
|
72
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 1, 1)
|
73
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 1, 1)
|
74
|
-
assert_close_enough(1.0, point1_ * point2_)
|
75
|
-
end
|
76
|
-
|
77
|
-
|
78
|
-
def test_point_dot_minusone
|
79
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 1, 1)
|
80
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(-1, -1, -1)
|
81
|
-
assert_close_enough(-1.0, point1_ * point2_)
|
82
|
-
end
|
83
|
-
|
84
|
-
|
85
|
-
def test_point_dot_zero
|
86
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 1, 0)
|
87
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, -1, 0)
|
88
|
-
assert_close_enough(0.0, point1_ * point2_)
|
89
|
-
end
|
90
|
-
|
91
|
-
|
92
|
-
def test_point_cross
|
93
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 1, 0)
|
94
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, -1, 0)
|
95
|
-
assert_close_enough(-1.0, (point1_ % point2_).z)
|
96
|
-
end
|
97
|
-
|
98
|
-
|
99
|
-
def test_point_cross_coincident
|
100
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0, 0)
|
101
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0, 0)
|
102
|
-
assert_nil(point1_ % point2_)
|
103
|
-
end
|
104
|
-
|
105
|
-
|
106
|
-
def test_point_cross_opposite
|
107
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0, 0)
|
108
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(-1, 0, 0)
|
109
|
-
assert_nil(point1_ % point2_)
|
110
|
-
end
|
111
|
-
|
112
|
-
|
113
|
-
def test_arc_axis
|
114
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 1, 0)
|
115
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, -1, 0)
|
116
|
-
arc1_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point1_, point2_)
|
117
|
-
assert_close_enough(-1.0, arc1_.axis.z)
|
118
|
-
end
|
119
|
-
|
120
|
-
|
121
|
-
def test_arc_axis2
|
122
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0, 0)
|
123
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0.000001, 0)
|
124
|
-
arc1_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point1_, point2_)
|
125
|
-
assert_close_enough(1.0, arc1_.axis.z)
|
126
|
-
end
|
127
|
-
|
128
|
-
|
129
|
-
def test_arc_intersects_point_off
|
130
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0, 0)
|
131
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0.000002, 0)
|
132
|
-
point3_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0.000001, 0.1)
|
133
|
-
arc1_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point1_, point2_)
|
134
|
-
assert_equal(false, arc1_.contains_point?(point3_))
|
135
|
-
end
|
136
|
-
|
137
|
-
|
138
|
-
def test_arc_intersects_point_between
|
139
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0, 0)
|
140
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0.000002, 0)
|
141
|
-
point3_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0.000001, 0)
|
142
|
-
arc1_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point1_, point2_)
|
143
|
-
assert_equal(true, arc1_.contains_point?(point3_))
|
144
|
-
end
|
145
|
-
|
146
|
-
|
147
|
-
def test_arc_intersects_point_endpoint
|
148
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0, 0)
|
149
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(1, 0.000002, 0)
|
150
|
-
arc1_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point1_, point2_)
|
151
|
-
assert_equal(true, arc1_.contains_point?(point1_))
|
152
|
-
end
|
153
|
-
|
154
|
-
|
155
|
-
def test_arc_intersects_arc_true
|
156
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0, 0.1, 1)
|
157
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0, -0.1, 1)
|
158
|
-
point3_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(-0.1, 0, 1)
|
159
|
-
point4_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0.1, 0, 1)
|
160
|
-
arc1_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point1_, point2_)
|
161
|
-
arc2_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point3_, point4_)
|
162
|
-
assert_equal(true, arc1_.intersects_arc?(arc2_))
|
163
|
-
end
|
164
|
-
|
165
|
-
|
166
|
-
def test_arc_intersects_arc_parallel
|
167
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0, 0.1, 1)
|
168
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0, -0.1, 1)
|
169
|
-
point3_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0.1, 0.1, 1)
|
170
|
-
point4_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0.1, -0.1, 1)
|
171
|
-
arc1_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point1_, point2_)
|
172
|
-
arc2_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point3_, point4_)
|
173
|
-
assert_equal(false, arc1_.intersects_arc?(arc2_))
|
174
|
-
end
|
175
|
-
|
176
|
-
|
177
|
-
def test_arc_intersects_arc_separated_tee
|
178
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0, 0.1, 1)
|
179
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0, -0.1, 1)
|
180
|
-
point3_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0.1, 0, 1)
|
181
|
-
point4_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0.2, 0, 1)
|
182
|
-
arc1_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point1_, point2_)
|
183
|
-
arc2_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point3_, point4_)
|
184
|
-
assert_equal(false, arc1_.intersects_arc?(arc2_))
|
185
|
-
end
|
186
|
-
|
187
|
-
|
188
|
-
def test_arc_intersects_arc_connected_tee
|
189
|
-
point1_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0, 0.1, 1)
|
190
|
-
point2_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0, -0.1, 1)
|
191
|
-
point3_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0, 0, 1)
|
192
|
-
point4_ = ::RGeo::Geography::SphericalMath::PointXYZ.new(0.1, 0, 1)
|
193
|
-
arc1_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point1_, point2_)
|
194
|
-
arc2_ = ::RGeo::Geography::SphericalMath::ArcXYZ.new(point3_, point4_)
|
195
|
-
assert_equal(true, arc1_.intersects_arc?(arc2_))
|
196
|
-
end
|
197
|
-
|
198
|
-
|
199
|
-
end
|
200
|
-
|
201
|
-
end
|
202
|
-
end
|
203
|
-
end
|