rgeo 0.1.16 → 0.1.17
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 +7 -0
- data/README.rdoc +24 -11
- data/Version +1 -1
- data/lib/active_record/connection_adapters/mysql2spatial_adapter.rb +124 -0
- data/lib/active_record/connection_adapters/mysqlspatial_adapter.rb +134 -0
- data/lib/rgeo/active_record/arel_modifications.rb +73 -0
- data/lib/rgeo/active_record/base_modifications.rb +72 -0
- data/lib/rgeo/active_record/common.rb +38 -0
- data/lib/rgeo/active_record/mysql_common.rb +187 -0
- data/lib/rgeo/features/factory.rb +11 -6
- data/lib/rgeo/features/factory_generator.rb +109 -0
- data/lib/rgeo/features/types.rb +1 -1
- data/lib/rgeo/geos/factory.rb +3 -1
- data/lib/rgeo/wkrep/wkb_parser.rb +24 -21
- data/lib/rgeo/wkrep/wkt_parser.rb +97 -64
- data/tests/active_record/readme.txt +33 -0
- data/tests/active_record/tc_mysqlspatial.rb +219 -0
- data/tests/wkrep/tc_wkb_parser.rb +4 -4
- data/tests/wkrep/tc_wkt_parser.rb +5 -7
- metadata +13 -3
@@ -144,8 +144,8 @@ module RGeo
|
|
144
144
|
def test_point_with_ewkb_z_and_srid
|
145
145
|
factory_ = ::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true)
|
146
146
|
parser_ = ::RGeo::WKRep::WKBParser.new(:default_factory => factory_, :support_ewkb => true)
|
147
|
-
parser_.
|
148
|
-
::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true, :srid =>
|
147
|
+
parser_.to_generate_factory do |config_|
|
148
|
+
::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true, :srid => config_[:srid])
|
149
149
|
end
|
150
150
|
obj_ = parser_.parse_hex('00a0000001000003e83ff000000000000040000000000000004008000000000000')
|
151
151
|
assert_equal(::RGeo::Features::Point, obj_.geometry_type)
|
@@ -179,8 +179,8 @@ module RGeo
|
|
179
179
|
def test_linestring_with_ewkb_z_and_srid
|
180
180
|
factory_ = ::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true)
|
181
181
|
parser_ = ::RGeo::WKRep::WKBParser.new(:default_factory => factory_, :support_ewkb => true)
|
182
|
-
parser_.
|
183
|
-
::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true, :srid =>
|
182
|
+
parser_.to_generate_factory do |config_|
|
183
|
+
::RGeo::Cartesian.preferred_factory(:support_z_coordinate => true, :srid => config_[:srid])
|
184
184
|
end
|
185
185
|
obj_ = parser_.parse_hex('00a0000002000003e8000000023ff000000000000040000000000000004008000000000000401000000000000040140000000000004018000000000000')
|
186
186
|
assert_equal(::RGeo::Features::LineString, obj_.geometry_type)
|
@@ -219,8 +219,8 @@ module RGeo
|
|
219
219
|
def test_point_ewkt_with_srid
|
220
220
|
factory_ = ::RGeo::Cartesian.preferred_factory(:support_m_coordinate => true)
|
221
221
|
parser_ = ::RGeo::WKRep::WKTParser.new(:default_factory => factory_, :support_ewkt => true)
|
222
|
-
parser_.
|
223
|
-
::RGeo::Cartesian.preferred_factory(:support_m_coordinate => true, :srid =>
|
222
|
+
parser_.to_generate_factory do |config_|
|
223
|
+
::RGeo::Cartesian.preferred_factory(:support_m_coordinate => true, :srid => config_[:srid])
|
224
224
|
end
|
225
225
|
obj_ = parser_.parse('SRID=1000;POINTM(1 2 3)')
|
226
226
|
assert_equal(::RGeo::Features::Point, obj_.geometry_type)
|
@@ -251,9 +251,7 @@ module RGeo
|
|
251
251
|
def test_point_non_ewkt_with_srid
|
252
252
|
factory_ = ::RGeo::Cartesian.preferred_factory
|
253
253
|
parser_ = ::RGeo::WKRep::WKTParser.new(:default_factory => factory_)
|
254
|
-
parser_.
|
255
|
-
::RGeo::Cartesian.preferred_factory(:srid => srid_)
|
256
|
-
end
|
254
|
+
parser_.factory_generator = ::RGeo::Cartesian.method(:preferred_factory)
|
257
255
|
assert_raise(::RGeo::Errors::ParseError) do
|
258
256
|
obj_ = parser_.parse('SRID=1000;POINT(1 2)')
|
259
257
|
end
|
@@ -307,8 +305,8 @@ module RGeo
|
|
307
305
|
def test_linestring_ewkt_with_srid
|
308
306
|
factory_ = ::RGeo::Cartesian.preferred_factory(:support_m_coordinate => true)
|
309
307
|
parser_ = ::RGeo::WKRep::WKTParser.new(:default_factory => factory_, :support_ewkt => true)
|
310
|
-
parser_.
|
311
|
-
::RGeo::Cartesian.preferred_factory(:support_m_coordinate => true, :srid =>
|
308
|
+
parser_.to_generate_factory do |config_|
|
309
|
+
::RGeo::Cartesian.preferred_factory(:support_m_coordinate => true, :srid => config_[:srid])
|
312
310
|
end
|
313
311
|
obj_ = parser_.parse('SRID=1000;LINESTRINGM(1 2 3, 4 5 6)')
|
314
312
|
assert_equal(::RGeo::Features::LineString, obj_.geometry_type)
|
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
|
+
- 17
|
9
|
+
version: 0.1.17
|
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-11-
|
17
|
+
date: 2010-11-20 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -28,6 +28,12 @@ extra_rdoc_files:
|
|
28
28
|
- History.rdoc
|
29
29
|
- README.rdoc
|
30
30
|
files:
|
31
|
+
- lib/active_record/connection_adapters/mysql2spatial_adapter.rb
|
32
|
+
- lib/active_record/connection_adapters/mysqlspatial_adapter.rb
|
33
|
+
- lib/rgeo/active_record/arel_modifications.rb
|
34
|
+
- lib/rgeo/active_record/base_modifications.rb
|
35
|
+
- lib/rgeo/active_record/common.rb
|
36
|
+
- lib/rgeo/active_record/mysql_common.rb
|
31
37
|
- lib/rgeo/all.rb
|
32
38
|
- lib/rgeo/cartesian/calculations.rb
|
33
39
|
- lib/rgeo/cartesian/factory.rb
|
@@ -38,6 +44,7 @@ files:
|
|
38
44
|
- lib/rgeo/errors.rb
|
39
45
|
- lib/rgeo/features/curve.rb
|
40
46
|
- lib/rgeo/features/factory.rb
|
47
|
+
- lib/rgeo/features/factory_generator.rb
|
41
48
|
- lib/rgeo/features/geometry.rb
|
42
49
|
- lib/rgeo/features/geometry_collection.rb
|
43
50
|
- lib/rgeo/features/line.rb
|
@@ -90,6 +97,7 @@ files:
|
|
90
97
|
- lib/rgeo.rb
|
91
98
|
- History.rdoc
|
92
99
|
- README.rdoc
|
100
|
+
- tests/active_record/tc_mysqlspatial.rb
|
93
101
|
- tests/common/geometry_collection_tests.rb
|
94
102
|
- tests/common/line_string_tests.rb
|
95
103
|
- tests/common/multi_line_string_tests.rb
|
@@ -136,6 +144,7 @@ files:
|
|
136
144
|
- tests/wkrep/tc_wkb_parser.rb
|
137
145
|
- tests/wkrep/tc_wkt_generator.rb
|
138
146
|
- tests/wkrep/tc_wkt_parser.rb
|
147
|
+
- tests/active_record/readme.txt
|
139
148
|
- ext/geos_c_impl/extconf.rb
|
140
149
|
- ext/geos_c_impl/factory.c
|
141
150
|
- ext/geos_c_impl/geometry.c
|
@@ -187,6 +196,7 @@ signing_key:
|
|
187
196
|
specification_version: 3
|
188
197
|
summary: RGeo is a spatial data library for Ruby.
|
189
198
|
test_files:
|
199
|
+
- tests/active_record/tc_mysqlspatial.rb
|
190
200
|
- tests/common/geometry_collection_tests.rb
|
191
201
|
- tests/common/line_string_tests.rb
|
192
202
|
- tests/common/multi_line_string_tests.rb
|