rgeo 0.1.20 → 0.1.21

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.
Files changed (55) hide show
  1. data/History.rdoc +10 -0
  2. data/README.rdoc +38 -35
  3. data/Version +1 -1
  4. data/lib/active_record/connection_adapters/mysql2spatial_adapter.rb +1 -3
  5. data/lib/active_record/connection_adapters/mysqlspatial_adapter.rb +4 -4
  6. data/lib/active_record/connection_adapters/postgis_adapter.rb +426 -0
  7. data/lib/active_record/connection_adapters/spatialite_adapter.rb +488 -0
  8. data/lib/rgeo.rb +10 -29
  9. data/lib/rgeo/active_record/arel_modifications.rb +1 -0
  10. data/lib/rgeo/active_record/base_modifications.rb +27 -10
  11. data/lib/rgeo/active_record/common.rb +128 -0
  12. data/lib/rgeo/active_record/mysql_common.rb +14 -51
  13. data/lib/rgeo/cartesian/factory.rb +2 -2
  14. data/lib/rgeo/coord_sys.rb +1 -1
  15. data/lib/rgeo/coord_sys/proj4.rb +3 -2
  16. data/lib/rgeo/error.rb +0 -3
  17. data/lib/rgeo/feature.rb +1 -3
  18. data/lib/rgeo/feature/factory_generator.rb +8 -0
  19. data/lib/rgeo/geography/factory.rb +2 -2
  20. data/lib/rgeo/geography/interface.rb +3 -3
  21. data/lib/rgeo/geos/zm_factory.rb +2 -2
  22. data/lib/rgeo/wkrep/wkb_parser.rb +35 -36
  23. data/lib/rgeo/wkrep/wkt_parser.rb +36 -38
  24. data/test/active_record/common_setup_methods.rb +129 -0
  25. data/test/active_record/readme.txt +10 -0
  26. data/test/active_record/tc_mysqlspatial.rb +22 -71
  27. data/test/active_record/tc_postgis.rb +282 -0
  28. data/test/active_record/tc_spatialite.rb +198 -0
  29. data/test/coord_sys/tc_proj4.rb +12 -5
  30. data/test/projected_geography/tc_geometry_collection.rb +1 -1
  31. data/test/projected_geography/tc_line_string.rb +1 -1
  32. data/test/projected_geography/tc_multi_line_string.rb +1 -1
  33. data/test/projected_geography/tc_multi_point.rb +1 -1
  34. data/test/projected_geography/tc_multi_polygon.rb +2 -2
  35. data/test/projected_geography/tc_point.rb +4 -4
  36. data/test/projected_geography/tc_polygon.rb +1 -1
  37. data/test/simple_mercator/tc_geometry_collection.rb +1 -1
  38. data/test/simple_mercator/tc_line_string.rb +1 -1
  39. data/test/simple_mercator/tc_multi_line_string.rb +1 -1
  40. data/test/simple_mercator/tc_multi_point.rb +1 -1
  41. data/test/simple_mercator/tc_multi_polygon.rb +2 -2
  42. data/test/simple_mercator/tc_point.rb +4 -4
  43. data/test/simple_mercator/tc_polygon.rb +1 -1
  44. data/test/simple_mercator/tc_window.rb +1 -1
  45. data/test/spherical_geography/tc_geometry_collection.rb +1 -1
  46. data/test/spherical_geography/tc_line_string.rb +1 -1
  47. data/test/spherical_geography/tc_multi_line_string.rb +1 -1
  48. data/test/spherical_geography/tc_multi_point.rb +1 -1
  49. data/test/spherical_geography/tc_multi_polygon.rb +2 -2
  50. data/test/spherical_geography/tc_point.rb +4 -4
  51. data/test/spherical_geography/tc_polygon.rb +1 -1
  52. data/test/tc_oneoff.rb +3 -3
  53. data/test/wkrep/tc_wkb_parser.rb +14 -14
  54. data/test/wkrep/tc_wkt_parser.rb +37 -45
  55. metadata +10 -3
@@ -0,0 +1,198 @@
1
+ # -----------------------------------------------------------------------------
2
+ #
3
+ # Tests for the SpatiaLite ActiveRecord adapter
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
+ require 'fileutils'
37
+ require 'test/unit'
38
+ require ::File.expand_path('common_setup_methods.rb', ::File.dirname(__FILE__))
39
+
40
+
41
+ module RGeo
42
+ module Tests # :nodoc:
43
+ module ActiveRecord # :nodoc:
44
+
45
+ if TESTS_AVAILABLE
46
+
47
+
48
+ if ALL_DATABASES_CONFIG.include?('spatialite')
49
+
50
+ class TestSpatiaLite < ::Test::Unit::TestCase # :nodoc:
51
+
52
+
53
+ ADAPTER_NAME = 'spatialite'
54
+
55
+ def self.before_open_database(params_)
56
+ database_ = params_[:config][:database]
57
+ dir_ = ::File.dirname(database_)
58
+ ::FileUtils.mkdir_p(dir_) unless dir_ == '.'
59
+ ::FileUtils.rm_f(database_)
60
+ end
61
+
62
+ def self.initialize_database(params_)
63
+ params_[:connection].execute('SELECT InitSpatialMetaData()')
64
+ end
65
+
66
+ include CommonSetupMethods
67
+
68
+
69
+ def populate_ar_class(content_)
70
+ klass_ = create_ar_class
71
+ case content_
72
+ when :latlon_point
73
+ klass_.connection.create_table(:spatial_test) do |t_|
74
+ t_.column 'latlon', :point, :srid => 4326
75
+ end
76
+ end
77
+ klass_
78
+ end
79
+
80
+
81
+ def test_meta_data_present
82
+ result_ = DEFAULT_AR_CLASS.connection.select_value("SELECT COUNT(*) FROM spatial_ref_sys").to_i
83
+ assert_not_equal(0, result_)
84
+ end
85
+
86
+
87
+ def test_create_simple_geometry
88
+ klass_ = create_ar_class
89
+ klass_.connection.create_table(:spatial_test) do |t_|
90
+ t_.column 'latlon', :geometry
91
+ end
92
+ assert_equal(1, klass_.connection.select_value("SELECT COUNT(*) FROM geometry_columns WHERE f_table_name='spatial_test'").to_i)
93
+ assert_equal(::RGeo::Feature::Geometry, klass_.columns.last.geometric_type)
94
+ assert(klass_.cached_attributes.include?('latlon'))
95
+ klass_.connection.drop_table(:spatial_test)
96
+ assert_equal(0, klass_.connection.select_value("SELECT COUNT(*) FROM geometry_columns WHERE f_table_name='spatial_test'").to_i)
97
+ end
98
+
99
+
100
+ def test_create_point_geometry
101
+ klass_ = create_ar_class
102
+ klass_.connection.create_table(:spatial_test) do |t_|
103
+ t_.column 'latlon', :point
104
+ end
105
+ assert_equal(::RGeo::Feature::Point, klass_.columns.last.geometric_type)
106
+ assert(klass_.cached_attributes.include?('latlon'))
107
+ end
108
+
109
+
110
+ def test_create_geometry_with_index
111
+ klass_ = create_ar_class
112
+ klass_.connection.create_table(:spatial_test) do |t_|
113
+ t_.column 'latlon', :geometry
114
+ end
115
+ klass_.connection.change_table(:spatial_test) do |t_|
116
+ t_.index([:latlon], :spatial => true)
117
+ end
118
+ assert(klass_.connection.spatial_indexes(:spatial_test).last.spatial)
119
+ end
120
+
121
+
122
+ def test_set_and_get_point
123
+ klass_ = populate_ar_class(:latlon_point)
124
+ obj_ = klass_.new
125
+ assert_nil(obj_.latlon)
126
+ obj_.latlon = @factory.point(1, 2)
127
+ assert_equal(@factory.point(1, 2), obj_.latlon)
128
+ assert_equal(4326, obj_.latlon.srid)
129
+ end
130
+
131
+
132
+ def test_set_and_get_point_from_wkt
133
+ klass_ = populate_ar_class(:latlon_point)
134
+ obj_ = klass_.new
135
+ assert_nil(obj_.latlon)
136
+ obj_.latlon = 'POINT(1 2)'
137
+ assert_equal(@factory.point(1, 2), obj_.latlon)
138
+ assert_equal(4326, obj_.latlon.srid)
139
+ end
140
+
141
+
142
+ def test_save_and_load_point
143
+ klass_ = populate_ar_class(:latlon_point)
144
+ obj_ = klass_.new
145
+ obj_.latlon = @factory.point(1, 2)
146
+ obj_.save!
147
+ id_ = obj_.id
148
+ obj2_ = klass_.find(id_)
149
+ assert_equal(@factory.point(1, 2), obj2_.latlon)
150
+ assert_equal(4326, obj2_.latlon.srid)
151
+ end
152
+
153
+
154
+ def test_save_and_load_point_from_wkt
155
+ klass_ = populate_ar_class(:latlon_point)
156
+ obj_ = klass_.new
157
+ obj_.latlon = 'POINT(1 2)'
158
+ obj_.save!
159
+ id_ = obj_.id
160
+ obj2_ = klass_.find(id_)
161
+ assert_equal(@factory.point(1, 2), obj2_.latlon)
162
+ assert_equal(4326, obj2_.latlon.srid)
163
+ end
164
+
165
+
166
+ def test_add_column
167
+ klass_ = create_ar_class
168
+ klass_.connection.create_table(:spatial_test) do |t_|
169
+ t_.column('latlon', :geometry)
170
+ end
171
+ klass_.connection.change_table(:spatial_test) do |t_|
172
+ t_.column('geom2', :point, :srid => 4326)
173
+ t_.column('name', :string)
174
+ end
175
+ assert_equal(2, klass_.connection.select_value("SELECT COUNT(*) FROM geometry_columns WHERE f_table_name='spatial_test'").to_i)
176
+ cols_ = klass_.columns
177
+ assert_equal(::RGeo::Feature::Geometry, cols_[-3].geometric_type)
178
+ assert_equal(-1, cols_[-3].srid)
179
+ assert_equal(::RGeo::Feature::Point, cols_[-2].geometric_type)
180
+ assert_equal(4326, cols_[-2].srid)
181
+ assert_nil(cols_[-1].geometric_type)
182
+ end
183
+
184
+
185
+ end
186
+
187
+ else
188
+ puts "WARNING: Couldn't find spatialite in database.yml. Skipping those tests."
189
+ puts " See tests/active_record/readme.txt for more info."
190
+ end
191
+
192
+
193
+ end
194
+
195
+ end
196
+
197
+ end
198
+ end
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------
2
2
  #
3
- # A container file for one-off tests
3
+ # Tests for proj4 wrapper
4
4
  #
5
5
  # -----------------------------------------------------------------------------
6
6
  # Copyright 2010 Daniel Azuma
@@ -94,16 +94,23 @@ module RGeo
94
94
  def test_simple_mercator_transform
95
95
  geography_ = RGeo::CoordSys::Proj4.create('+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')
96
96
  projection_ = RGeo::CoordSys::Proj4.create('+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs')
97
- assert_equal(_project_merc(0, 0), RGeo::CoordSys::Proj4.transform_coords(geography_, projection_, 0, 0, nil, :radians => true))
98
- assert_equal(_project_merc(0.01, 0.01), RGeo::CoordSys::Proj4.transform_coords(geography_, projection_, 0.01, 0.01, nil, :radians => true))
99
- assert_equal(_project_merc(1, 1), RGeo::CoordSys::Proj4.transform_coords(geography_, projection_, 1, 1, nil, :radians => true))
100
- assert_equal(_project_merc(-1, -1), RGeo::CoordSys::Proj4.transform_coords(geography_, projection_, -1, -1, nil, :radians => true))
97
+ _assert_xy_close(_project_merc(0, 0), RGeo::CoordSys::Proj4.transform_coords(geography_, projection_, 0, 0, nil, :radians => true))
98
+ _assert_xy_close(_project_merc(0.01, 0.01), RGeo::CoordSys::Proj4.transform_coords(geography_, projection_, 0.01, 0.01, nil, :radians => true))
99
+ _assert_xy_close(_project_merc(1, 1), RGeo::CoordSys::Proj4.transform_coords(geography_, projection_, 1, 1, nil, :radians => true))
100
+ _assert_xy_close(_project_merc(-1, -1), RGeo::CoordSys::Proj4.transform_coords(geography_, projection_, -1, -1, nil, :radians => true))
101
101
  _assert_xy_close(_unproject_merc(0, 0), RGeo::CoordSys::Proj4.transform_coords(projection_, geography_, 0, 0, nil, :radians => true))
102
102
  _assert_xy_close(_unproject_merc(10000, 10000), RGeo::CoordSys::Proj4.transform_coords(projection_, geography_, 10000, 10000, nil, :radians => true))
103
103
  _assert_xy_close(_unproject_merc(-20000000, -20000000), RGeo::CoordSys::Proj4.transform_coords(projection_, geography_, -20000000, -20000000, nil, :radians => true))
104
104
  end
105
105
 
106
106
 
107
+ def test_equivalence
108
+ proj1_ = RGeo::CoordSys::Proj4.create('+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')
109
+ proj2_ = RGeo::CoordSys::Proj4.create('+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')
110
+ assert_equal(proj1_, proj2_)
111
+ end
112
+
113
+
107
114
  end
108
115
 
109
116
  end
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factory
51
- ::RGeo::Geography.projected(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
51
+ ::RGeo::Geography.projected_factory(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
52
52
  end
53
53
 
54
54
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def setup
51
- @factory = ::RGeo::Geography.projected(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
51
+ @factory = ::RGeo::Geography.projected_factory(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
52
52
  end
53
53
 
54
54
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factory
51
- ::RGeo::Geography.projected(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
51
+ ::RGeo::Geography.projected_factory(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
52
52
  end
53
53
 
54
54
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factory
51
- ::RGeo::Geography.projected(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
51
+ ::RGeo::Geography.projected_factory(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
52
52
  end
53
53
 
54
54
 
@@ -48,8 +48,8 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factories
51
- @factory = ::RGeo::Geography.projected(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
52
- @lenient_factory = ::RGeo::Geography.projected(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857, :lenient_multi_polygon_assertions => true)
51
+ @factory = ::RGeo::Geography.projected_factory(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
52
+ @lenient_factory = ::RGeo::Geography.projected_factory(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857, :lenient_multi_polygon_assertions => true)
53
53
  end
54
54
 
55
55
 
@@ -48,10 +48,10 @@ module RGeo
48
48
 
49
49
 
50
50
  def setup
51
- @factory = ::RGeo::Geography.projected(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
52
- @zfactory = ::RGeo::Geography.projected(:support_z_coordinate => true, :projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
53
- @mfactory = ::RGeo::Geography.projected(:support_m_coordinate => true, :projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
54
- @zmfactory = ::RGeo::Geography.projected(:support_z_coordinate => true, :support_m_coordinate => true, :projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
51
+ @factory = ::RGeo::Geography.projected_factory(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
52
+ @zfactory = ::RGeo::Geography.projected_factory(:support_z_coordinate => true, :projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
53
+ @mfactory = ::RGeo::Geography.projected_factory(:support_m_coordinate => true, :projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
54
+ @zmfactory = ::RGeo::Geography.projected_factory(:support_z_coordinate => true, :support_m_coordinate => true, :projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
55
55
  end
56
56
 
57
57
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def setup
51
- @factory = ::RGeo::Geography.projected(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
51
+ @factory = ::RGeo::Geography.projected_factory(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857)
52
52
  end
53
53
 
54
54
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factory
51
- ::RGeo::Geography.simple_mercator
51
+ ::RGeo::Geography.simple_mercator_factory
52
52
  end
53
53
 
54
54
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def setup
51
- @factory = ::RGeo::Geography.simple_mercator
51
+ @factory = ::RGeo::Geography.simple_mercator_factory
52
52
  end
53
53
 
54
54
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factory
51
- ::RGeo::Geography.simple_mercator
51
+ ::RGeo::Geography.simple_mercator_factory
52
52
  end
53
53
 
54
54
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factory
51
- ::RGeo::Geography.simple_mercator
51
+ ::RGeo::Geography.simple_mercator_factory
52
52
  end
53
53
 
54
54
 
@@ -48,8 +48,8 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factories
51
- @factory = ::RGeo::Geography.simple_mercator
52
- @lenient_factory = ::RGeo::Geography.simple_mercator(:lenient_multi_polygon_assertions => true)
51
+ @factory = ::RGeo::Geography.simple_mercator_factory
52
+ @lenient_factory = ::RGeo::Geography.simple_mercator_factory(:lenient_multi_polygon_assertions => true)
53
53
  end
54
54
 
55
55
 
@@ -48,10 +48,10 @@ module RGeo
48
48
 
49
49
 
50
50
  def setup
51
- @factory = ::RGeo::Geography.simple_mercator
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)
51
+ @factory = ::RGeo::Geography.simple_mercator_factory
52
+ @zfactory = ::RGeo::Geography.simple_mercator_factory(:support_z_coordinate => true)
53
+ @mfactory = ::RGeo::Geography.simple_mercator_factory(:support_m_coordinate => true)
54
+ @zmfactory = ::RGeo::Geography.simple_mercator_factory(:support_z_coordinate => true, :support_m_coordinate => true)
55
55
  end
56
56
 
57
57
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def setup
51
- @factory = ::RGeo::Geography.simple_mercator
51
+ @factory = ::RGeo::Geography.simple_mercator_factory
52
52
  end
53
53
 
54
54
 
@@ -46,7 +46,7 @@ module RGeo
46
46
 
47
47
 
48
48
  def setup
49
- @factory = ::RGeo::Geography.simple_mercator
49
+ @factory = ::RGeo::Geography.simple_mercator_factory
50
50
  end
51
51
 
52
52
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factory
51
- @factory = ::RGeo::Geography.spherical
51
+ @factory = ::RGeo::Geography.spherical_factory
52
52
  end
53
53
 
54
54
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def setup
51
- @factory = ::RGeo::Geography.spherical
51
+ @factory = ::RGeo::Geography.spherical_factory
52
52
  end
53
53
 
54
54
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factory
51
- @factory = ::RGeo::Geography.spherical
51
+ @factory = ::RGeo::Geography.spherical_factory
52
52
  end
53
53
 
54
54
 
@@ -48,7 +48,7 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factory
51
- @factory = ::RGeo::Geography.spherical
51
+ @factory = ::RGeo::Geography.spherical_factory
52
52
  end
53
53
 
54
54
 
@@ -48,8 +48,8 @@ module RGeo
48
48
 
49
49
 
50
50
  def create_factories
51
- @factory = ::RGeo::Geography.spherical
52
- @lenient_factory = ::RGeo::Geography.spherical(:lenient_multi_polygon_assertions => true)
51
+ @factory = ::RGeo::Geography.spherical_factory
52
+ @lenient_factory = ::RGeo::Geography.spherical_factory(:lenient_multi_polygon_assertions => true)
53
53
  end
54
54
 
55
55