rgeo 0.1.18 → 0.1.19
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 +17 -30
- data/Version +1 -1
- data/ext/geos_c_impl/factory.c +4 -9
- data/ext/geos_c_impl/factory.h +8 -8
- data/ext/geos_c_impl/geometry.c +19 -2
- data/ext/geos_c_impl/geometry_collection.c +1 -1
- data/ext/geos_c_impl/polygon.c +2 -2
- data/lib/active_record/connection_adapters/mysql2spatial_adapter.rb +8 -6
- data/lib/active_record/connection_adapters/mysqlspatial_adapter.rb +8 -6
- data/lib/rgeo/active_record/arel_modifications.rb +4 -0
- data/lib/rgeo/active_record/base_modifications.rb +37 -2
- data/lib/rgeo/active_record/mysql_common.rb +2 -2
- data/lib/rgeo/cartesian.rb +6 -22
- data/lib/rgeo/cartesian/analysis.rb +3 -0
- data/lib/rgeo/cartesian/bounding_box.rb +337 -0
- data/lib/rgeo/cartesian/feature_classes.rb +11 -11
- data/lib/rgeo/cartesian/feature_methods.rb +5 -0
- data/lib/rgeo/cartesian/interface.rb +21 -4
- data/lib/rgeo/features/geometry.rb +0 -15
- data/lib/rgeo/geography/interface.rb +33 -6
- data/lib/rgeo/geography/simple_mercator/feature_classes.rb +30 -17
- data/lib/rgeo/geography/simple_mercator/feature_methods.rb +1 -1
- data/lib/rgeo/geography/simple_spherical/feature_classes.rb +38 -11
- data/lib/rgeo/geos.rb +2 -0
- data/lib/rgeo/geos/factory.rb +37 -21
- data/lib/rgeo/geos/impl_additions.rb +20 -0
- data/lib/rgeo/geos/interface.rb +17 -8
- data/lib/rgeo/geos/zm_factory.rb +241 -0
- data/lib/rgeo/geos/zm_impl.rb +432 -0
- data/lib/rgeo/impl_helpers/basic_geometry_collection_methods.rb +39 -0
- data/lib/rgeo/impl_helpers/basic_geometry_methods.rb +0 -5
- data/lib/rgeo/impl_helpers/basic_line_string_methods.rb +10 -1
- data/lib/rgeo/impl_helpers/basic_point_methods.rb +1 -13
- data/lib/rgeo/impl_helpers/basic_polygon_methods.rb +10 -0
- data/tests/common/geometry_collection_tests.rb +16 -0
- data/tests/common/point_tests.rb +27 -1
- data/tests/geos/tc_point.rb +2 -0
- data/tests/geos/tc_zmfactory.rb +85 -0
- data/tests/simple_cartesian/tc_geometry_collection.rb +1 -0
- data/tests/simple_cartesian/tc_point.rb +2 -1
- data/tests/simple_mercator/tc_point.rb +2 -0
- data/tests/simple_spherical/tc_geometry_collection.rb +2 -0
- data/tests/simple_spherical/tc_point.rb +2 -1
- data/tests/tc_oneoff.rb +0 -1
- data/tests/wkrep/tc_wkb_generator.rb +4 -4
- data/tests/wkrep/tc_wkb_parser.rb +2 -2
- data/tests/wkrep/tc_wkt_generator.rb +4 -4
- data/tests/wkrep/tc_wkt_parser.rb +5 -5
- metadata +23 -3
@@ -135,6 +135,28 @@ module RGeo
|
|
135
135
|
end
|
136
136
|
|
137
137
|
|
138
|
+
def _add_boundary(hash_, point_) # :nodoc:
|
139
|
+
hval_ = [point_.x, point_.y].hash
|
140
|
+
(hash_[hval_] ||= [point_, 0])[1] += 1
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
def boundary
|
145
|
+
hash_ = {}
|
146
|
+
@elements.each do |line_|
|
147
|
+
if !line_.is_empty? && !line_.is_closed?
|
148
|
+
_add_boundary(hash_, line_.start_point)
|
149
|
+
_add_boundary(hash_, line_.end_point)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
array_ = []
|
153
|
+
hash_.each do |hval_, data_|
|
154
|
+
array_ << data_[0] if data_[1] % 2 == 1
|
155
|
+
end
|
156
|
+
factory.multi_point([array_])
|
157
|
+
end
|
158
|
+
|
159
|
+
|
138
160
|
end
|
139
161
|
|
140
162
|
|
@@ -159,6 +181,11 @@ module RGeo
|
|
159
181
|
end
|
160
182
|
|
161
183
|
|
184
|
+
def boundary
|
185
|
+
factory.collection([])
|
186
|
+
end
|
187
|
+
|
188
|
+
|
162
189
|
end
|
163
190
|
|
164
191
|
|
@@ -188,6 +215,18 @@ module RGeo
|
|
188
215
|
end
|
189
216
|
|
190
217
|
|
218
|
+
def boundary
|
219
|
+
array_ = []
|
220
|
+
@elements.each do |poly_|
|
221
|
+
unless poly_.is_empty?
|
222
|
+
array_ << poly_.exterior_ring
|
223
|
+
end
|
224
|
+
array_.concat(poly_.interior_rings)
|
225
|
+
end
|
226
|
+
factory.multi_line_string(array_)
|
227
|
+
end
|
228
|
+
|
229
|
+
|
191
230
|
end
|
192
231
|
|
193
232
|
|
@@ -101,6 +101,15 @@ module RGeo
|
|
101
101
|
end
|
102
102
|
|
103
103
|
|
104
|
+
def boundary
|
105
|
+
array_ = []
|
106
|
+
if !is_empty? && !is_closed?
|
107
|
+
array_ << @points.first << @points.last
|
108
|
+
end
|
109
|
+
factory.multi_point([array_])
|
110
|
+
end
|
111
|
+
|
112
|
+
|
104
113
|
def start_point
|
105
114
|
@points.first
|
106
115
|
end
|
@@ -112,7 +121,7 @@ module RGeo
|
|
112
121
|
|
113
122
|
|
114
123
|
def is_closed?
|
115
|
-
|
124
|
+
unless defined?(@is_closed)
|
116
125
|
@is_closed = @points.size > 2 && @points.first == @points.last
|
117
126
|
end
|
118
127
|
@is_closed
|
@@ -119,13 +119,7 @@ module RGeo
|
|
119
119
|
return false unless rhs_.is_a?(self.class) && rhs_.factory == self.factory
|
120
120
|
case rhs_
|
121
121
|
when Features::Point
|
122
|
-
|
123
|
-
rhs_.y == 90
|
124
|
-
elsif @y == -90
|
125
|
-
rhs_.y == -90
|
126
|
-
else
|
127
|
-
rhs_.x == @x && rhs_.y == @y
|
128
|
-
end
|
122
|
+
rhs_.x == @x && rhs_.y == @y
|
129
123
|
when Features::LineString
|
130
124
|
rhs_.num_points > 0 && rhs_.points.all?{ |elem_| equals?(elem_) }
|
131
125
|
when Features::GeometryCollection
|
@@ -136,12 +130,6 @@ module RGeo
|
|
136
130
|
end
|
137
131
|
|
138
132
|
|
139
|
-
alias_method :longitude, :x
|
140
|
-
alias_method :lon, :x
|
141
|
-
alias_method :latitude, :y
|
142
|
-
alias_method :lat, :y
|
143
|
-
|
144
|
-
|
145
133
|
end
|
146
134
|
|
147
135
|
|
@@ -103,6 +103,16 @@ module RGeo
|
|
103
103
|
end
|
104
104
|
|
105
105
|
|
106
|
+
def boundary
|
107
|
+
array_ = []
|
108
|
+
unless @exterior_ring.is_empty?
|
109
|
+
array_ << @exterior_ring
|
110
|
+
end
|
111
|
+
array_.concat(@interior_rings)
|
112
|
+
factory.multi_line_string(array_)
|
113
|
+
end
|
114
|
+
|
115
|
+
|
106
116
|
end
|
107
117
|
|
108
118
|
|
@@ -215,6 +215,22 @@ module RGeo
|
|
215
215
|
end
|
216
216
|
|
217
217
|
|
218
|
+
def test_empty_collection_envelope
|
219
|
+
empty_ = @factory.collection([])
|
220
|
+
envelope_ = empty_.envelope
|
221
|
+
assert_equal(Features::GeometryCollection, envelope_.geometry_type)
|
222
|
+
assert_equal(0, envelope_.num_geometries)
|
223
|
+
end
|
224
|
+
|
225
|
+
|
226
|
+
def test_empty_collection_boundary
|
227
|
+
empty_ = @factory.collection([])
|
228
|
+
boundary_ = empty_.boundary
|
229
|
+
assert_equal(Features::GeometryCollection, boundary_.geometry_type)
|
230
|
+
assert_equal(0, boundary_.num_geometries)
|
231
|
+
end
|
232
|
+
|
233
|
+
|
218
234
|
end
|
219
235
|
|
220
236
|
end
|
data/tests/common/point_tests.rb
CHANGED
@@ -272,7 +272,7 @@ module RGeo
|
|
272
272
|
end
|
273
273
|
|
274
274
|
|
275
|
-
def
|
275
|
+
def test_3dz_creation
|
276
276
|
point_ = @zfactory.point(11, 12, 13)
|
277
277
|
assert_equal(11, point_.x)
|
278
278
|
assert_equal(12, point_.y)
|
@@ -284,6 +284,32 @@ module RGeo
|
|
284
284
|
end
|
285
285
|
|
286
286
|
|
287
|
+
def test_3dm_creation
|
288
|
+
point_ = @mfactory.point(11, 12, 13)
|
289
|
+
assert_equal(11, point_.x)
|
290
|
+
assert_equal(12, point_.y)
|
291
|
+
assert_equal(13, point_.m)
|
292
|
+
point2_ = @mfactory.point(21, 22)
|
293
|
+
assert_equal(21, point2_.x)
|
294
|
+
assert_equal(22, point2_.y)
|
295
|
+
assert_equal(0, point2_.m)
|
296
|
+
end
|
297
|
+
|
298
|
+
|
299
|
+
def test_4d_creation
|
300
|
+
point_ = @zmfactory.point(11, 12, 13, 14)
|
301
|
+
assert_equal(11, point_.x)
|
302
|
+
assert_equal(12, point_.y)
|
303
|
+
assert_equal(13, point_.z)
|
304
|
+
assert_equal(14, point_.m)
|
305
|
+
point2_ = @zmfactory.point(21, 22)
|
306
|
+
assert_equal(21, point2_.x)
|
307
|
+
assert_equal(22, point2_.y)
|
308
|
+
assert_equal(0, point2_.z)
|
309
|
+
assert_equal(0, point2_.m)
|
310
|
+
end
|
311
|
+
|
312
|
+
|
287
313
|
def test_wkt_creation_3d
|
288
314
|
point2_ = @zfactory.parse_wkt('POINT(11 12 13)')
|
289
315
|
assert_equal(11, point2_.x)
|
data/tests/geos/tc_point.rb
CHANGED
@@ -50,6 +50,8 @@ module RGeo
|
|
50
50
|
def setup
|
51
51
|
@factory = ::RGeo::Geos.factory
|
52
52
|
@zfactory = ::RGeo::Geos.factory(:support_z_coordinate => true)
|
53
|
+
@mfactory = ::RGeo::Geos.factory(:support_m_coordinate => true)
|
54
|
+
@zmfactory = ::RGeo::Geos.factory(:support_z_coordinate => true, :support_m_coordinate => true)
|
53
55
|
end
|
54
56
|
|
55
57
|
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# -----------------------------------------------------------------------------
|
2
|
+
#
|
3
|
+
# Tests for the GEOS point implementation
|
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 Geos
|
44
|
+
|
45
|
+
class TestZMFactory < ::Test::Unit::TestCase # :nodoc:
|
46
|
+
|
47
|
+
|
48
|
+
def setup
|
49
|
+
@factory = ::RGeo::Geos.factory(:support_z_coordinate => true, :support_m_coordinate => true, :srid => 1000, :buffer_resolution => 2)
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
def test_factory_parts
|
54
|
+
assert_equal(1000, @factory.srid)
|
55
|
+
assert_equal(1000, @factory.z_factory.srid)
|
56
|
+
assert_equal(1000, @factory.m_factory.srid)
|
57
|
+
assert_equal(2, @factory.buffer_resolution)
|
58
|
+
assert_equal(2, @factory.z_factory.buffer_resolution)
|
59
|
+
assert_equal(2, @factory.m_factory.buffer_resolution)
|
60
|
+
assert(@factory.has_capability?(:z_coordinate))
|
61
|
+
assert(@factory.has_capability?(:m_coordinate))
|
62
|
+
assert(@factory.z_factory.has_capability?(:z_coordinate))
|
63
|
+
assert(!@factory.z_factory.has_capability?(:m_coordinate))
|
64
|
+
assert(!@factory.m_factory.has_capability?(:z_coordinate))
|
65
|
+
assert(@factory.m_factory.has_capability?(:m_coordinate))
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
def test_4d_point
|
70
|
+
point_ = @factory.point(1, 2, 3, 4)
|
71
|
+
assert_equal(Features::Point, point_.geometry_type)
|
72
|
+
assert_equal(3, point_.z)
|
73
|
+
assert_equal(4, point_.m)
|
74
|
+
assert_equal(3, point_.z_geometry.z)
|
75
|
+
assert_nil(point_.z_geometry.m)
|
76
|
+
assert_nil(point_.m_geometry.z)
|
77
|
+
assert_equal(4, point_.m_geometry.m)
|
78
|
+
end
|
79
|
+
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -50,6 +50,8 @@ module RGeo
|
|
50
50
|
def setup
|
51
51
|
@factory = ::RGeo::Cartesian.simple_factory(:srid => 1)
|
52
52
|
@zfactory = ::RGeo::Cartesian.simple_factory(:srid => 1, :support_z_coordinate => true)
|
53
|
+
@mfactory = ::RGeo::Cartesian.simple_factory(:srid => 1, :support_m_coordinate => true)
|
54
|
+
@zmfactory = ::RGeo::Cartesian.simple_factory(:srid => 1, :support_z_coordinate => true, :support_m_coordinate => true)
|
53
55
|
end
|
54
56
|
|
55
57
|
|
@@ -76,7 +78,6 @@ module RGeo
|
|
76
78
|
undef_method :test_within
|
77
79
|
undef_method :test_contains
|
78
80
|
undef_method :test_overlaps
|
79
|
-
undef_method :test_convex_hull
|
80
81
|
undef_method :test_intersection
|
81
82
|
undef_method :test_union
|
82
83
|
undef_method :test_difference
|
@@ -50,6 +50,8 @@ module RGeo
|
|
50
50
|
def setup
|
51
51
|
@factory = ::RGeo::Geography.simple_mercator
|
52
52
|
@zfactory = ::RGeo::Geography.simple_mercator(:support_z_coordinate => true)
|
53
|
+
@mfactory = ::RGeo::Geography.simple_mercator(:support_m_coordinate => true)
|
54
|
+
@zmfactory = ::RGeo::Geography.simple_mercator(:support_z_coordinate => true, :support_m_coordinate => true)
|
53
55
|
end
|
54
56
|
|
55
57
|
|
@@ -50,6 +50,8 @@ module RGeo
|
|
50
50
|
def setup
|
51
51
|
@factory = ::RGeo::Geography.simple_spherical
|
52
52
|
@zfactory = ::RGeo::Geography.simple_spherical(:support_z_coordinate => true)
|
53
|
+
@mfactory = ::RGeo::Geography.simple_spherical(:support_m_coordinate => true)
|
54
|
+
@zmfactory = ::RGeo::Geography.simple_spherical(:support_z_coordinate => true, :support_m_coordinate => true)
|
53
55
|
end
|
54
56
|
|
55
57
|
|
@@ -85,7 +87,6 @@ module RGeo
|
|
85
87
|
undef_method :test_within
|
86
88
|
undef_method :test_contains
|
87
89
|
undef_method :test_overlaps
|
88
|
-
undef_method :test_convex_hull
|
89
90
|
undef_method :test_intersection
|
90
91
|
undef_method :test_union
|
91
92
|
undef_method :test_difference
|
data/tests/tc_oneoff.rb
CHANGED
@@ -46,10 +46,10 @@ module RGeo
|
|
46
46
|
|
47
47
|
|
48
48
|
def setup
|
49
|
-
@factory = ::RGeo::Cartesian.
|
50
|
-
@factoryz = ::RGeo::Cartesian.
|
51
|
-
@factorym = ::RGeo::Cartesian.
|
52
|
-
@factoryzm = ::RGeo::Cartesian.
|
49
|
+
@factory = ::RGeo::Cartesian.preferred_factory(:srid => 1000)
|
50
|
+
@factoryz = ::RGeo::Cartesian.preferred_factory(:srid => 1000, :support_z_coordinate => true)
|
51
|
+
@factorym = ::RGeo::Cartesian.preferred_factory(:srid => 1000, :support_m_coordinate => true)
|
52
|
+
@factoryzm = ::RGeo::Cartesian.preferred_factory(:srid => 1000, :support_z_coordinate => true, :support_m_coordinate => true)
|
53
53
|
end
|
54
54
|
|
55
55
|
|
@@ -84,7 +84,7 @@ module RGeo
|
|
84
84
|
|
85
85
|
|
86
86
|
def test_point_with_ewkb_zm
|
87
|
-
factory_ = ::RGeo::Cartesian.
|
87
|
+
factory_ = ::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true, :support_m_coordinate => true)
|
88
88
|
parser_ = ::RGeo::WKRep::WKBParser.new(:default_factory => factory_, :support_ewkb => true)
|
89
89
|
obj_ = parser_.parse_hex('00c00000013ff0000000000000400000000000000040080000000000004010000000000000')
|
90
90
|
assert_equal(::RGeo::Features::Point, obj_.geometry_type)
|
@@ -114,7 +114,7 @@ module RGeo
|
|
114
114
|
|
115
115
|
|
116
116
|
def test_point_with_wkb12_zm
|
117
|
-
factory_ = ::RGeo::Cartesian.
|
117
|
+
factory_ = ::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true, :support_m_coordinate => true)
|
118
118
|
parser_ = ::RGeo::WKRep::WKBParser.new(:default_factory => factory_, :support_wkb12 => true)
|
119
119
|
obj_ = parser_.parse_hex('0000000bb93ff0000000000000400000000000000040080000000000004010000000000000')
|
120
120
|
assert_equal(::RGeo::Features::Point, obj_.geometry_type)
|
@@ -46,10 +46,10 @@ module RGeo
|
|
46
46
|
|
47
47
|
|
48
48
|
def setup
|
49
|
-
@factory = ::RGeo::Cartesian.
|
50
|
-
@factoryz = ::RGeo::Cartesian.
|
51
|
-
@factorym = ::RGeo::Cartesian.
|
52
|
-
@factoryzm = ::RGeo::Cartesian.
|
49
|
+
@factory = ::RGeo::Cartesian.preferred_factory(:srid => 1000)
|
50
|
+
@factoryz = ::RGeo::Cartesian.preferred_factory(:srid => 1000, :support_z_coordinate => true)
|
51
|
+
@factorym = ::RGeo::Cartesian.preferred_factory(:srid => 1000, :support_m_coordinate => true)
|
52
|
+
@factoryzm = ::RGeo::Cartesian.preferred_factory(:srid => 1000, :support_z_coordinate => true, :support_m_coordinate => true)
|
53
53
|
end
|
54
54
|
|
55
55
|
|
@@ -159,7 +159,7 @@ module RGeo
|
|
159
159
|
|
160
160
|
|
161
161
|
def test_point_wkt12_m_with_factory_zm
|
162
|
-
factory_ = ::RGeo::Cartesian.
|
162
|
+
factory_ = ::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true, :support_m_coordinate => true)
|
163
163
|
parser_ = ::RGeo::WKRep::WKTParser.new(:default_factory => factory_, :support_wkt12 => true)
|
164
164
|
obj_ = parser_.parse('POINT M(1 2 3)')
|
165
165
|
assert_equal(::RGeo::Features::Point, obj_.geometry_type)
|
@@ -178,7 +178,7 @@ module RGeo
|
|
178
178
|
|
179
179
|
|
180
180
|
def test_point_wkt12_zm
|
181
|
-
factory_ = ::RGeo::Cartesian.
|
181
|
+
factory_ = ::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true, :support_m_coordinate => true)
|
182
182
|
parser_ = ::RGeo::WKRep::WKTParser.new(:default_factory => factory_, :support_wkt12 => true)
|
183
183
|
obj_ = parser_.parse('POINT ZM(1 2 3 4)')
|
184
184
|
assert_equal(::RGeo::Features::Point, obj_.geometry_type)
|
@@ -188,7 +188,7 @@ module RGeo
|
|
188
188
|
|
189
189
|
|
190
190
|
def test_point_wkt12_zm_not_enough_coords
|
191
|
-
factory_ = ::RGeo::Cartesian.
|
191
|
+
factory_ = ::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true, :support_m_coordinate => true)
|
192
192
|
parser_ = ::RGeo::WKRep::WKTParser.new(:default_factory => factory_, :support_wkt12 => true)
|
193
193
|
assert_raise(::RGeo::Errors::ParseError) do
|
194
194
|
obj_ = parser_.parse('POINT ZM(1 2 3)')
|
@@ -290,7 +290,7 @@ module RGeo
|
|
290
290
|
|
291
291
|
|
292
292
|
def test_linestring_wkt12_m
|
293
|
-
factory_ = ::RGeo::Cartesian.
|
293
|
+
factory_ = ::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true, :support_m_coordinate => true)
|
294
294
|
parser_ = ::RGeo::WKRep::WKTParser.new(:default_factory => factory_, :support_wkt12 => true)
|
295
295
|
obj_ = parser_.parse('LINESTRING M(1 2 3,5 6 7)')
|
296
296
|
assert_equal(::RGeo::Features::LineString, obj_.geometry_type)
|
@@ -464,7 +464,7 @@ module RGeo
|
|
464
464
|
|
465
465
|
|
466
466
|
def test_collection_wkt12_type_mismatch
|
467
|
-
factory_ = ::RGeo::Cartesian.
|
467
|
+
factory_ = ::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true, :support_m_coordinate => true)
|
468
468
|
parser_ = ::RGeo::WKRep::WKTParser.new(:default_factory => factory_, :support_wkt12 => true)
|
469
469
|
assert_raise(::RGeo::Errors::ParseError) do
|
470
470
|
obj_ = parser_.parse('GEOMETRYCOLLECTION Z(POINT Z(-1 -2 0),LINESTRING M(1 2 0, 3 4 0, 5 6 0))')
|