rgeo 0.3.7 → 0.3.8
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 +5 -0
- data/Version +1 -1
- data/lib/rgeo/cartesian/feature_methods.rb +1 -1
- data/lib/rgeo/feature/types.rb +1 -1
- data/lib/rgeo/geographic/spherical_feature_classes.rb +4 -2
- data/lib/rgeo/geographic/spherical_feature_methods.rb +1 -1
- data/lib/rgeo/geos/factory.rb +1 -1
- data/lib/rgeo/geos/ffi_factory.rb +0 -1
- data/lib/rgeo/geos/zm_factory.rb +1 -1
- data/lib/rgeo/geos/zm_impl.rb +0 -1
- data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +1 -1
- data/lib/rgeo/impl_helper/basic_geometry_methods.rb +0 -1
- data/lib/rgeo/wkrep/wkb_generator.rb +2 -1
- data/lib/rgeo/wkrep/wkt_generator.rb +2 -1
- data/lib/rgeo/wkrep/wkt_parser.rb +1 -1
- data/test/spherical_geographic/tc_point.rb +9 -0
- data/test/wkrep/tc_wkb_parser.rb +4 -4
- data/test/wkrep/tc_wkt_parser.rb +10 -10
- metadata +3 -3
data/History.rdoc
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
=== 0.3.8 / 2012-03-23
|
2
|
+
|
3
|
+
* When using the spherical factory, some negative longitudes might get perturbed slightly due to floating point errors. Fixed. (Reported by Pete Deffendol)
|
4
|
+
* Fixed a bunch of warnings, and turned on warnings during testing.
|
5
|
+
|
1
6
|
=== 0.3.7 / 2012-03-12
|
2
7
|
|
3
8
|
* Marshal and YAML serialization now fully implemented for geometries.
|
data/Version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.8
|
data/lib/rgeo/feature/types.rb
CHANGED
data/lib/rgeo/geos/factory.rb
CHANGED
@@ -431,7 +431,7 @@ module RGeo
|
|
431
431
|
def override_cast(original_, ntype_, flags_)
|
432
432
|
return nil unless Geos.supported?
|
433
433
|
keep_subtype_ = flags_[:keep_subtype]
|
434
|
-
force_new_ = flags_[:force_new]
|
434
|
+
#force_new_ = flags_[:force_new]
|
435
435
|
project_ = flags_[:project]
|
436
436
|
type_ = original_.geometry_type
|
437
437
|
ntype_ = type_ if keep_subtype_ && type_.include?(ntype_)
|
data/lib/rgeo/geos/zm_factory.rb
CHANGED
@@ -378,7 +378,7 @@ module RGeo
|
|
378
378
|
def override_cast(original_, ntype_, flags_)
|
379
379
|
return nil unless Geos.supported?
|
380
380
|
keep_subtype_ = flags_[:keep_subtype]
|
381
|
-
force_new_ = flags_[:force_new]
|
381
|
+
#force_new_ = flags_[:force_new]
|
382
382
|
project_ = flags_[:project]
|
383
383
|
type_ = original_.geometry_type
|
384
384
|
ntype_ = type_ if keep_subtype_ && type_.include?(ntype_)
|
data/lib/rgeo/geos/zm_impl.rb
CHANGED
@@ -94,7 +94,8 @@ module RGeo
|
|
94
94
|
|
95
95
|
def initialize(opts_={})
|
96
96
|
@type_format = opts_[:type_format] || :wkb11
|
97
|
-
@emit_ewkb_srid =
|
97
|
+
@emit_ewkb_srid = @type_format == :ewkb ?
|
98
|
+
(opts_[:emit_ewkb_srid] ? true : false) : nil
|
98
99
|
@hex_format = opts_[:hex_format] ? true : false
|
99
100
|
@little_endian = opts_[:little_endian] ? true : false
|
100
101
|
end
|
@@ -85,7 +85,8 @@ module RGeo
|
|
85
85
|
|
86
86
|
def initialize(opts_={})
|
87
87
|
@tag_format = opts_[:tag_format] || opts_[:type_format] || :wkt11
|
88
|
-
@emit_ewkt_srid =
|
88
|
+
@emit_ewkt_srid = @tag_format == :ewkt ?
|
89
|
+
(opts_[:emit_ewkt_srid] ? true : false) : nil
|
89
90
|
@square_brackets = opts_[:square_brackets] ? true : false
|
90
91
|
@convert_case = opts_[:convert_case]
|
91
92
|
end
|
@@ -228,7 +228,7 @@ module RGeo
|
|
228
228
|
expect_m_ = zm_[-1,1] == 'm' ? true : false
|
229
229
|
if @cur_expect_m.nil?
|
230
230
|
@cur_expect_m = expect_m_
|
231
|
-
|
231
|
+
elsif expect_m_ != @cur_expect_m
|
232
232
|
raise Error::ParseError, "Surrounding collection has M but contained geometry doesn't."
|
233
233
|
end
|
234
234
|
if creating_expectation_
|
@@ -80,6 +80,15 @@ module RGeo
|
|
80
80
|
end
|
81
81
|
|
82
82
|
|
83
|
+
def test_floating_point_perturbation
|
84
|
+
# A naive way of wrapping longitudes to [-180,180] might cause
|
85
|
+
# perturbation due to floating point errors. Make sure this
|
86
|
+
# doesn't happen.
|
87
|
+
point_ = @factory.point(-98.747534, 38.057583)
|
88
|
+
assert_equal(-98.747534, point_.x)
|
89
|
+
end
|
90
|
+
|
91
|
+
|
83
92
|
undef_method :test_disjoint
|
84
93
|
undef_method :test_intersects
|
85
94
|
undef_method :test_touches
|
data/test/wkrep/tc_wkb_parser.rb
CHANGED
@@ -136,7 +136,7 @@ module RGeo
|
|
136
136
|
factory_ = ::RGeo::Cartesian.preferred_factory(:has_z_coordinate => true)
|
137
137
|
parser_ = ::RGeo::WKRep::WKBParser.new(factory_)
|
138
138
|
assert_raise(::RGeo::Error::ParseError) do
|
139
|
-
|
139
|
+
parser_.parse('00000003e93ff000000000000040000000000000004008000000000000')
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
@@ -145,7 +145,7 @@ module RGeo
|
|
145
145
|
factory_ = ::RGeo::Cartesian.preferred_factory(:has_z_coordinate => true)
|
146
146
|
parser_ = ::RGeo::WKRep::WKBParser.new(factory_, :support_wkb12 => true)
|
147
147
|
assert_raise(::RGeo::Error::ParseError) do
|
148
|
-
|
148
|
+
parser_.parse('00000003e93ff00000000000004000000000000000')
|
149
149
|
end
|
150
150
|
end
|
151
151
|
|
@@ -273,7 +273,7 @@ module RGeo
|
|
273
273
|
factory_ = ::RGeo::Cartesian.preferred_factory(:has_z_coordinate => true)
|
274
274
|
parser_ = ::RGeo::WKRep::WKBParser.new(factory_, :support_ewkb => true)
|
275
275
|
assert_raise(::RGeo::Error::ParseError) do
|
276
|
-
|
276
|
+
parser_.parse('00800000040000000200800000013ff000000000000040000000000000004014000000000000000000000140080000000000004010000000000000')
|
277
277
|
end
|
278
278
|
end
|
279
279
|
|
@@ -299,7 +299,7 @@ module RGeo
|
|
299
299
|
def test_multilinestring_wrong_element_type
|
300
300
|
parser_ = ::RGeo::WKRep::WKBParser.new
|
301
301
|
assert_raise(::RGeo::Error::ParseError) do
|
302
|
-
|
302
|
+
parser_.parse('0000000005000000020000000002000000033ff00000000000004000000000000000400800000000000040100000000000004014000000000000401800000000000000000000013ff00000000000004000000000000000')
|
303
303
|
end
|
304
304
|
end
|
305
305
|
|
data/test/wkrep/tc_wkt_parser.rb
CHANGED
@@ -124,7 +124,7 @@ module RGeo
|
|
124
124
|
factory_ = ::RGeo::Cartesian.preferred_factory
|
125
125
|
parser_ = ::RGeo::WKRep::WKTParser.new(factory_)
|
126
126
|
assert_raise(::RGeo::Error::ParseError) do
|
127
|
-
|
127
|
+
parser_.parse('POINT(1 2 3)')
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
@@ -143,7 +143,7 @@ module RGeo
|
|
143
143
|
factory_ = ::RGeo::Cartesian.preferred_factory
|
144
144
|
parser_ = ::RGeo::WKRep::WKTParser.new(factory_, :support_wkt12 => true)
|
145
145
|
assert_raise(::RGeo::Error::ParseError) do
|
146
|
-
|
146
|
+
parser_.parse('POINT Z(1 2 3)')
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
@@ -172,7 +172,7 @@ module RGeo
|
|
172
172
|
factory_ = ::RGeo::Cartesian.preferred_factory(:has_m_coordinate => true)
|
173
173
|
parser_ = ::RGeo::WKRep::WKTParser.new(factory_, :support_wkt12 => true)
|
174
174
|
assert_raise(::RGeo::Error::ParseError) do
|
175
|
-
|
175
|
+
parser_.parse('POINT M(1 2 3 4)')
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
@@ -191,7 +191,7 @@ module RGeo
|
|
191
191
|
factory_ = ::RGeo::Cartesian.preferred_factory(:has_z_coordinate => true, :has_m_coordinate => true)
|
192
192
|
parser_ = ::RGeo::WKRep::WKTParser.new(factory_, :support_wkt12 => true)
|
193
193
|
assert_raise(::RGeo::Error::ParseError) do
|
194
|
-
|
194
|
+
parser_.parse('POINT ZM(1 2 3)')
|
195
195
|
end
|
196
196
|
end
|
197
197
|
|
@@ -230,7 +230,7 @@ module RGeo
|
|
230
230
|
factory_ = ::RGeo::Cartesian.preferred_factory(:has_m_coordinate => true)
|
231
231
|
parser_ = ::RGeo::WKRep::WKTParser.new(factory_, :support_ewkt => true)
|
232
232
|
assert_raise(::RGeo::Error::ParseError) do
|
233
|
-
|
233
|
+
parser_.parse('POINTM(1 2 3 4)')
|
234
234
|
end
|
235
235
|
end
|
236
236
|
|
@@ -239,7 +239,7 @@ module RGeo
|
|
239
239
|
factory_ = ::RGeo::Cartesian.preferred_factory(:has_z_coordinate => true)
|
240
240
|
parser_ = ::RGeo::WKRep::WKTParser.new(factory_, :strict_wkt11 => true)
|
241
241
|
assert_raise(::RGeo::Error::ParseError) do
|
242
|
-
|
242
|
+
parser_.parse('POINT(1 2 3)')
|
243
243
|
end
|
244
244
|
end
|
245
245
|
|
@@ -247,7 +247,7 @@ module RGeo
|
|
247
247
|
def test_point_non_ewkt_with_srid
|
248
248
|
parser_ = ::RGeo::WKRep::WKTParser.new(::RGeo::Cartesian.method(:preferred_factory))
|
249
249
|
assert_raise(::RGeo::Error::ParseError) do
|
250
|
-
|
250
|
+
parser_.parse('SRID=1000;POINT(1 2)')
|
251
251
|
end
|
252
252
|
end
|
253
253
|
|
@@ -278,7 +278,7 @@ module RGeo
|
|
278
278
|
factory_ = ::RGeo::Cartesian.preferred_factory(:has_z_coordinate => true)
|
279
279
|
parser_ = ::RGeo::WKRep::WKTParser.new(factory_)
|
280
280
|
assert_raise(::RGeo::Error::ParseError) do
|
281
|
-
|
281
|
+
parser_.parse('LINESTRING(1 2 3, 4 5,7 8 9)')
|
282
282
|
end
|
283
283
|
end
|
284
284
|
|
@@ -461,7 +461,7 @@ module RGeo
|
|
461
461
|
factory_ = ::RGeo::Cartesian.preferred_factory(:has_z_coordinate => true)
|
462
462
|
parser_ = ::RGeo::WKRep::WKTParser.new(factory_)
|
463
463
|
assert_raise(::RGeo::Error::ParseError) do
|
464
|
-
|
464
|
+
parser_.parse('GEOMETRYCOLLECTION(POINT(-1 -2),LINESTRING(1 2 0, 3 4 0, 5 6 0))')
|
465
465
|
end
|
466
466
|
end
|
467
467
|
|
@@ -470,7 +470,7 @@ module RGeo
|
|
470
470
|
factory_ = ::RGeo::Cartesian.preferred_factory(:has_z_coordinate => true, :has_m_coordinate => true)
|
471
471
|
parser_ = ::RGeo::WKRep::WKTParser.new(factory_, :support_wkt12 => true)
|
472
472
|
assert_raise(::RGeo::Error::ParseError) do
|
473
|
-
|
473
|
+
parser_.parse('GEOMETRYCOLLECTION Z(POINT Z(-1 -2 0),LINESTRING M(1 2 0, 3 4 0, 5 6 0))')
|
474
474
|
end
|
475
475
|
end
|
476
476
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgeo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-23 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: RGeo is a geospatial data library for Ruby. It provides an implementation
|
15
15
|
of the Open Geospatial Consortium's Simple Features Specification, used by most
|
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
219
|
version: 1.3.1
|
220
220
|
requirements: []
|
221
221
|
rubyforge_project: virtuoso
|
222
|
-
rubygems_version: 1.8.
|
222
|
+
rubygems_version: 1.8.19
|
223
223
|
signing_key:
|
224
224
|
specification_version: 3
|
225
225
|
summary: RGeo is a geospatial data library for Ruby.
|