rgeo 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/History.rdoc +11 -0
  2. data/README.rdoc +23 -7
  3. data/Version +1 -1
  4. data/ext/geos_c_impl/factory.c +1 -1
  5. data/{lib/rgeo/geography/simple_mercator.rb → ext/proj4_c_impl/extconf.rb} +35 -30
  6. data/ext/proj4_c_impl/main.c +256 -0
  7. data/lib/rgeo.rb +54 -42
  8. data/lib/rgeo/active_record/arel_modifications.rb +2 -2
  9. data/lib/rgeo/active_record/base_modifications.rb +1 -1
  10. data/lib/rgeo/active_record/mysql_common.rb +12 -12
  11. data/lib/rgeo/all.rb +5 -4
  12. data/lib/rgeo/cartesian.rb +3 -2
  13. data/lib/rgeo/cartesian/bounding_box.rb +9 -9
  14. data/lib/rgeo/cartesian/factory.rb +30 -13
  15. data/lib/rgeo/cartesian/feature_classes.rb +33 -33
  16. data/lib/rgeo/cartesian/interface.rb +2 -2
  17. data/lib/rgeo/{geography/all.rb → coord_sys.rb} +22 -4
  18. data/lib/rgeo/coord_sys/proj4.rb +275 -0
  19. data/lib/rgeo/{errors.rb → error.rb} +5 -6
  20. data/lib/rgeo/{features.rb → feature.rb} +22 -20
  21. data/lib/rgeo/{features → feature}/curve.rb +6 -6
  22. data/lib/rgeo/{features → feature}/factory.rb +19 -3
  23. data/lib/rgeo/{features → feature}/factory_generator.rb +1 -1
  24. data/lib/rgeo/{features → feature}/geometry.rb +34 -34
  25. data/lib/rgeo/{features → feature}/geometry_collection.rb +4 -4
  26. data/lib/rgeo/{features → feature}/line.rb +1 -1
  27. data/lib/rgeo/{features → feature}/line_string.rb +4 -4
  28. data/lib/rgeo/{features → feature}/linear_ring.rb +1 -1
  29. data/lib/rgeo/{features → feature}/multi_curve.rb +3 -3
  30. data/lib/rgeo/{features → feature}/multi_line_string.rb +1 -1
  31. data/lib/rgeo/{features → feature}/multi_point.rb +1 -1
  32. data/lib/rgeo/{features → feature}/multi_polygon.rb +1 -1
  33. data/lib/rgeo/{features → feature}/multi_surface.rb +4 -4
  34. data/lib/rgeo/{features → feature}/point.rb +5 -5
  35. data/lib/rgeo/{features → feature}/polygon.rb +5 -5
  36. data/lib/rgeo/{features → feature}/surface.rb +4 -4
  37. data/lib/rgeo/feature/types.rb +301 -0
  38. data/lib/rgeo/geo_json.rb +1 -1
  39. data/lib/rgeo/geo_json/coder.rb +13 -13
  40. data/lib/rgeo/geo_json/interface.rb +2 -2
  41. data/lib/rgeo/geography.rb +33 -6
  42. data/lib/rgeo/geography/factory.rb +82 -39
  43. data/lib/rgeo/geography/interface.rb +135 -89
  44. data/lib/rgeo/geography/proj4_projector.rb +98 -0
  45. data/lib/rgeo/geography/projected_feature_classes.rb +213 -0
  46. data/lib/rgeo/geography/projected_feature_methods.rb +228 -0
  47. data/lib/rgeo/geography/projected_window.rb +7 -7
  48. data/lib/rgeo/geography/simple_mercator_projector.rb +133 -0
  49. data/lib/rgeo/geography/spherical_feature_classes.rb +212 -0
  50. data/lib/rgeo/geography/{simple_spherical/feature_methods.rb → spherical_feature_methods.rb} +39 -43
  51. data/lib/rgeo/geography/{simple_spherical/calculations.rb → spherical_math.rb} +7 -7
  52. data/lib/rgeo/geos.rb +1 -1
  53. data/lib/rgeo/geos/factory.rb +37 -19
  54. data/lib/rgeo/geos/impl_additions.rb +10 -11
  55. data/lib/rgeo/geos/interface.rb +1 -1
  56. data/lib/rgeo/geos/zm_factory.rb +15 -15
  57. data/lib/rgeo/geos/zm_impl.rb +10 -10
  58. data/lib/rgeo/{impl_helpers.rb → impl_helper.rb} +8 -8
  59. data/lib/rgeo/{impl_helpers → impl_helper}/basic_geometry_collection_methods.rb +13 -13
  60. data/lib/rgeo/{impl_helpers → impl_helper}/basic_geometry_methods.rb +2 -2
  61. data/lib/rgeo/{impl_helpers → impl_helper}/basic_line_string_methods.rb +13 -13
  62. data/lib/rgeo/{impl_helpers → impl_helper}/basic_point_methods.rb +5 -5
  63. data/lib/rgeo/{impl_helpers → impl_helper}/basic_polygon_methods.rb +6 -6
  64. data/lib/rgeo/{impl_helpers → impl_helper}/math.rb +1 -1
  65. data/lib/rgeo/shapefile.rb +1 -1
  66. data/lib/rgeo/shapefile/reader.rb +3 -3
  67. data/lib/rgeo/wkrep.rb +1 -1
  68. data/lib/rgeo/wkrep/wkb_generator.rb +17 -17
  69. data/lib/rgeo/wkrep/wkb_parser.rb +12 -12
  70. data/lib/rgeo/wkrep/wkt_generator.rb +8 -8
  71. data/lib/rgeo/wkrep/wkt_parser.rb +10 -10
  72. data/{tests → test}/active_record/readme.txt +0 -0
  73. data/{tests → test}/active_record/tc_mysqlspatial.rb +2 -2
  74. data/{tests → test}/common/geometry_collection_tests.rb +22 -22
  75. data/{tests → test}/common/line_string_tests.rb +20 -20
  76. data/{tests → test}/common/multi_line_string_tests.rb +19 -19
  77. data/{tests → test}/common/multi_point_tests.rb +17 -17
  78. data/{tests → test}/common/multi_polygon_tests.rb +16 -16
  79. data/{tests → test}/common/point_tests.rb +9 -9
  80. data/{tests → test}/common/polygon_tests.rb +9 -9
  81. data/test/coord_sys/tc_proj4.rb +111 -0
  82. data/{tests → test}/geos/tc_factory.rb +1 -1
  83. data/{tests → test}/geos/tc_geometry_collection.rb +1 -1
  84. data/{tests → test}/geos/tc_line_string.rb +0 -0
  85. data/{tests → test}/geos/tc_misc.rb +1 -1
  86. data/{tests → test}/geos/tc_multi_line_string.rb +1 -1
  87. data/{tests → test}/geos/tc_multi_point.rb +1 -1
  88. data/{tests → test}/geos/tc_multi_polygon.rb +1 -1
  89. data/{tests → test}/geos/tc_point.rb +1 -1
  90. data/{tests → test}/geos/tc_polygon.rb +0 -0
  91. data/{tests → test}/geos/tc_zmfactory.rb +2 -2
  92. data/test/projected_geography/tc_geometry_collection.rb +62 -0
  93. data/test/projected_geography/tc_line_string.rb +62 -0
  94. data/test/projected_geography/tc_multi_line_string.rb +62 -0
  95. data/test/projected_geography/tc_multi_point.rb +62 -0
  96. data/test/projected_geography/tc_multi_polygon.rb +63 -0
  97. data/test/projected_geography/tc_point.rb +93 -0
  98. data/test/projected_geography/tc_polygon.rb +62 -0
  99. data/{tests → test}/shapefile/shapelib_testcases/readme.txt +0 -0
  100. data/{tests → test}/shapefile/shapelib_testcases/test.dbf +0 -0
  101. data/{tests → test}/shapefile/shapelib_testcases/test.shp +0 -0
  102. data/{tests → test}/shapefile/shapelib_testcases/test.shx +0 -0
  103. data/{tests → test}/shapefile/shapelib_testcases/test0.shp +0 -0
  104. data/{tests → test}/shapefile/shapelib_testcases/test0.shx +0 -0
  105. data/{tests → test}/shapefile/shapelib_testcases/test1.shp +0 -0
  106. data/{tests → test}/shapefile/shapelib_testcases/test1.shx +0 -0
  107. data/{tests → test}/shapefile/shapelib_testcases/test10.shp +0 -0
  108. data/{tests → test}/shapefile/shapelib_testcases/test10.shx +0 -0
  109. data/{tests → test}/shapefile/shapelib_testcases/test11.shp +0 -0
  110. data/{tests → test}/shapefile/shapelib_testcases/test11.shx +0 -0
  111. data/{tests → test}/shapefile/shapelib_testcases/test12.shp +0 -0
  112. data/{tests → test}/shapefile/shapelib_testcases/test12.shx +0 -0
  113. data/{tests → test}/shapefile/shapelib_testcases/test13.shp +0 -0
  114. data/{tests → test}/shapefile/shapelib_testcases/test13.shx +0 -0
  115. data/{tests → test}/shapefile/shapelib_testcases/test2.shp +0 -0
  116. data/{tests → test}/shapefile/shapelib_testcases/test2.shx +0 -0
  117. data/{tests → test}/shapefile/shapelib_testcases/test3.shp +0 -0
  118. data/{tests → test}/shapefile/shapelib_testcases/test3.shx +0 -0
  119. data/{tests → test}/shapefile/shapelib_testcases/test4.shp +0 -0
  120. data/{tests → test}/shapefile/shapelib_testcases/test4.shx +0 -0
  121. data/{tests → test}/shapefile/shapelib_testcases/test5.shp +0 -0
  122. data/{tests → test}/shapefile/shapelib_testcases/test5.shx +0 -0
  123. data/{tests → test}/shapefile/shapelib_testcases/test6.shp +0 -0
  124. data/{tests → test}/shapefile/shapelib_testcases/test6.shx +0 -0
  125. data/{tests → test}/shapefile/shapelib_testcases/test7.shp +0 -0
  126. data/{tests → test}/shapefile/shapelib_testcases/test7.shx +0 -0
  127. data/{tests → test}/shapefile/shapelib_testcases/test8.shp +0 -0
  128. data/{tests → test}/shapefile/shapelib_testcases/test8.shx +0 -0
  129. data/{tests → test}/shapefile/shapelib_testcases/test9.shp +0 -0
  130. data/{tests → test}/shapefile/shapelib_testcases/test9.shx +0 -0
  131. data/{tests → test}/shapefile/tc_shapelib_tests.rb +17 -17
  132. data/{tests → test}/simple_cartesian/tc_calculations.rb +0 -0
  133. data/{tests → test}/simple_cartesian/tc_geometry_collection.rb +0 -0
  134. data/{tests → test}/simple_cartesian/tc_line_string.rb +0 -0
  135. data/{tests → test}/simple_cartesian/tc_multi_line_string.rb +0 -0
  136. data/{tests → test}/simple_cartesian/tc_multi_point.rb +0 -0
  137. data/{tests → test}/simple_cartesian/tc_multi_polygon.rb +0 -0
  138. data/{tests → test}/simple_cartesian/tc_point.rb +0 -0
  139. data/{tests → test}/simple_cartesian/tc_polygon.rb +0 -0
  140. data/{tests → test}/simple_mercator/tc_geometry_collection.rb +1 -1
  141. data/{tests → test}/simple_mercator/tc_line_string.rb +0 -0
  142. data/{tests → test}/simple_mercator/tc_multi_line_string.rb +1 -1
  143. data/{tests → test}/simple_mercator/tc_multi_point.rb +1 -1
  144. data/{tests → test}/simple_mercator/tc_multi_polygon.rb +1 -1
  145. data/{tests → test}/simple_mercator/tc_point.rb +2 -2
  146. data/{tests → test}/simple_mercator/tc_polygon.rb +0 -0
  147. data/{tests → test}/simple_mercator/tc_window.rb +1 -1
  148. data/test/spherical_geography/tc_calculations.rb +203 -0
  149. data/{tests/simple_spherical → test/spherical_geography}/tc_geometry_collection.rb +2 -2
  150. data/{tests/simple_spherical → test/spherical_geography}/tc_line_string.rb +2 -2
  151. data/{tests/simple_spherical → test/spherical_geography}/tc_multi_line_string.rb +2 -2
  152. data/{tests/simple_spherical → test/spherical_geography}/tc_multi_point.rb +2 -2
  153. data/{tests/simple_spherical → test/spherical_geography}/tc_multi_polygon.rb +3 -3
  154. data/{tests/simple_spherical → test/spherical_geography}/tc_point.rb +7 -7
  155. data/{tests/simple_spherical → test/spherical_geography}/tc_polygon.rb +2 -2
  156. data/{tests → test}/tc_cartesian_analysis.rb +0 -0
  157. data/{tests → test}/tc_geojson.rb +0 -0
  158. data/{tests → test}/tc_oneoff.rb +2 -1
  159. data/{tests → test}/wkrep/tc_wkb_generator.rb +0 -0
  160. data/{tests → test}/wkrep/tc_wkb_parser.rb +32 -32
  161. data/{tests → test}/wkrep/tc_wkt_generator.rb +0 -0
  162. data/{tests → test}/wkrep/tc_wkt_parser.rb +46 -46
  163. metadata +183 -164
  164. data/lib/rgeo/features/types.rb +0 -272
  165. data/lib/rgeo/geography/simple_mercator/feature_classes.rb +0 -279
  166. data/lib/rgeo/geography/simple_mercator/feature_methods.rb +0 -278
  167. data/lib/rgeo/geography/simple_mercator/projector.rb +0 -112
  168. data/lib/rgeo/geography/simple_spherical.rb +0 -68
  169. data/lib/rgeo/geography/simple_spherical/feature_classes.rb +0 -216
  170. data/tests/simple_spherical/tc_calculations.rb +0 -203
@@ -58,12 +58,12 @@ module Arel
58
58
 
59
59
  class Dot
60
60
  alias :visit_Arel_Attributes_Geometry :visit_Arel_Attribute
61
- alias :visit_RGeo_Features_Geometry :visit_String
61
+ alias :visit_RGeo_Feature_Geometry :visit_String
62
62
  end
63
63
 
64
64
  class ToSql
65
65
  alias :visit_Arel_Attributes_Geometry :visit_Arel_Attributes_Attribute
66
- alias :visit_RGeo_Features_Geometry :visit_String
66
+ alias :visit_RGeo_Feature_Geometry :visit_String
67
67
  end
68
68
 
69
69
  VISITORS['postgis'] = ::Arel::Visitors::PostgreSQL
@@ -50,7 +50,7 @@ module ActiveRecord
50
50
  #
51
51
  # === ActiveRecord::Base::rgeo_factory_generator
52
52
  #
53
- # The value of this attribute is a RGeo::Features::FactoryGenerator
53
+ # The value of this attribute is a RGeo::Feature::FactoryGenerator
54
54
  # that is used to generate the proper factory when loading geometry
55
55
  # objects from the database. For example, if the data being loaded
56
56
  # has M but not Z coordinates, and an embedded SRID, then this
@@ -34,7 +34,7 @@
34
34
  ;
35
35
 
36
36
 
37
- require 'rgeo/features'
37
+ require 'rgeo/feature'
38
38
  require 'rgeo/cartesian'
39
39
  require 'rgeo/wkrep'
40
40
  require 'rgeo/active_record/common'
@@ -52,7 +52,7 @@ module RGeo
52
52
 
53
53
 
54
54
  def quote(value_, column_=nil)
55
- if ::RGeo::Features::Geometry.check_type(value_)
55
+ if ::RGeo::Feature::Geometry.check_type(value_)
56
56
  "GeomFromWKB(0x#{::RGeo::WKRep::WKBGenerator.new(:hex_format => true).generate(value_)},#{value_.srid})"
57
57
  else
58
58
  super
@@ -104,7 +104,7 @@ module RGeo
104
104
 
105
105
 
106
106
  def klass
107
- type == :geometry ? ::RGeo::Features::Geometry : super
107
+ type == :geometry ? ::RGeo::Feature::Geometry : super
108
108
  end
109
109
 
110
110
 
@@ -122,14 +122,14 @@ module RGeo
122
122
 
123
123
  def extract_geometric_type(sql_type_)
124
124
  case sql_type_
125
- when /^geometry$/i then ::RGeo::Features::Geometry
126
- when /^point$/i then ::RGeo::Features::Point
127
- when /^linestring$/i then ::RGeo::Features::LineString
128
- when /^polygon$/i then ::RGeo::Features::Polygon
129
- when /^geometrycollection$/i then ::RGeo::Features::GeometryCollection
130
- when /^multipoint$/i then ::RGeo::Features::MultiPoint
131
- when /^multilinestring$/i then ::RGeo::Features::MultiLineString
132
- when /^multipolygon$/i then ::RGeo::Features::MultiPolygon
125
+ when /^geometry$/i then ::RGeo::Feature::Geometry
126
+ when /^point$/i then ::RGeo::Feature::Point
127
+ when /^linestring$/i then ::RGeo::Feature::LineString
128
+ when /^polygon$/i then ::RGeo::Feature::Polygon
129
+ when /^geometrycollection$/i then ::RGeo::Feature::GeometryCollection
130
+ when /^multipoint$/i then ::RGeo::Feature::MultiPoint
131
+ when /^multilinestring$/i then ::RGeo::Feature::MultiLineString
132
+ when /^multipolygon$/i then ::RGeo::Feature::MultiPolygon
133
133
  else nil
134
134
  end
135
135
  end
@@ -142,7 +142,7 @@ module RGeo
142
142
 
143
143
  def self.string_to_geometry(str_, ar_class_)
144
144
  case str_
145
- when ::RGeo::Features::Geometry
145
+ when ::RGeo::Feature::Geometry
146
146
  str_
147
147
  when ::String
148
148
  marker_ = str_[4,1]
data/lib/rgeo/all.rb CHANGED
@@ -38,11 +38,12 @@
38
38
  require 'rgeo'
39
39
 
40
40
  # Implementation files
41
- require 'rgeo/errors'
42
- require 'rgeo/features'
43
- require 'rgeo/impl_helpers'
41
+ require 'rgeo/error'
42
+ require 'rgeo/feature'
43
+ require 'rgeo/impl_helper'
44
44
  require 'rgeo/wkrep'
45
45
  require 'rgeo/geos'
46
46
  require 'rgeo/cartesian'
47
- require 'rgeo/geography/all'
47
+ require 'rgeo/geography'
48
48
  require 'rgeo/geo_json'
49
+ require 'rgeo/shapefile'
@@ -55,9 +55,10 @@ end
55
55
 
56
56
 
57
57
  # Dependency files.
58
- require 'rgeo/features'
58
+ require 'rgeo/feature'
59
+ require 'rgeo/geos'
59
60
  require 'rgeo/wkrep'
60
- require 'rgeo/impl_helpers'
61
+ require 'rgeo/impl_helper'
61
62
 
62
63
  # Implementation files.
63
64
  require 'rgeo/cartesian/calculations'
@@ -212,7 +212,7 @@ module RGeo
212
212
  when BoundingBox
213
213
  add(geometry_.min_point)
214
214
  add(geometry_.max_point)
215
- when Features::Geometry
215
+ when Feature::Geometry
216
216
  if geometry_.factory == @factory
217
217
  _add_geometry(geometry_)
218
218
  else
@@ -264,7 +264,7 @@ module RGeo
264
264
  # have M. Default is false.
265
265
 
266
266
  def contains?(rhs_, opts_={})
267
- if Features::Geometry === rhs_
267
+ if Feature::Geometry === rhs_
268
268
  contains?(BoundingBox.new(@factory).add(rhs_))
269
269
  elsif rhs_.empty?
270
270
  true
@@ -284,19 +284,19 @@ module RGeo
284
284
 
285
285
  def _add_geometry(geometry_) # :nodoc:
286
286
  case geometry_
287
- when Features::Point
287
+ when Feature::Point
288
288
  _add_point(geometry_)
289
- when Features::LineString
289
+ when Feature::LineString
290
290
  geometry_.points.each{ |p_| _add_point(p_) }
291
- when Features::Polygon
291
+ when Feature::Polygon
292
292
  geometry_.exterior_ring.points.each{ |p_| _add_point(p_) }
293
- when Features::MultiPoint
293
+ when Feature::MultiPoint
294
294
  geometry_.each{ |p_| _add_point(p_) }
295
- when Features::MultiLineString
295
+ when Feature::MultiLineString
296
296
  geometry_.each{ |line_| line_.points.each{ |p_| _add_point(p_) } }
297
- when Features::MultiPolygon
297
+ when Feature::MultiPolygon
298
298
  geometry_.each{ |poly_| poly_.exterior_ring.points.each{ |p_| _add_point(p_) } }
299
- when Features::GeometryCollection
299
+ when Feature::GeometryCollection
300
300
  geometry_.each{ |g_| _add_geometry(g_) }
301
301
  end
302
302
  end
@@ -44,7 +44,7 @@ module RGeo
44
44
 
45
45
  class Factory
46
46
 
47
- include Features::Factory::Instance
47
+ include Feature::Factory::Instance
48
48
 
49
49
 
50
50
  # Create a new simple cartesian factory.
@@ -55,6 +55,14 @@ module RGeo
55
55
  @srid = opts_[:srid].to_i
56
56
  @support_z = opts_[:support_z_coordinate] ? true : false
57
57
  @support_m = opts_[:support_m_coordinate] ? true : false
58
+ @proj4 = opts_[:proj4]
59
+ if CoordSys::Proj4.supported?
60
+ if @proj4.kind_of?(::String) || @proj4.kind_of?(::Hash)
61
+ @proj4 = CoordSys::Proj4.create(@proj4)
62
+ end
63
+ else
64
+ @proj4 = nil
65
+ end
58
66
  end
59
67
 
60
68
 
@@ -73,7 +81,7 @@ module RGeo
73
81
  end
74
82
 
75
83
 
76
- # See ::RGeo::Features::Factory#has_capability?
84
+ # See ::RGeo::Feature::Factory#has_capability?
77
85
 
78
86
  def has_capability?(name_)
79
87
  case name_
@@ -81,89 +89,98 @@ module RGeo
81
89
  @support_z
82
90
  when :m_coordinate
83
91
  @support_m
92
+ when :proj4
93
+ !@proj4.nil?
84
94
  else
85
95
  nil
86
96
  end
87
97
  end
88
98
 
89
99
 
90
- # See ::RGeo::Features::Factory#parse_wkt
100
+ # See ::RGeo::Feature::Factory#parse_wkt
91
101
 
92
102
  def parse_wkt(str_)
93
103
  WKRep::WKTParser.new(:default_factory => self).parse(str_)
94
104
  end
95
105
 
96
106
 
97
- # See ::RGeo::Features::Factory#parse_wkb
107
+ # See ::RGeo::Feature::Factory#parse_wkb
98
108
 
99
109
  def parse_wkb(str_)
100
110
  WKRep::WKBParser.new(:default_factory => self).parse(str_)
101
111
  end
102
112
 
103
113
 
104
- # See ::RGeo::Features::Factory#point
114
+ # See ::RGeo::Feature::Factory#point
105
115
 
106
116
  def point(x_, y_, *extra_)
107
117
  PointImpl.new(self, x_, y_, *extra_) rescue nil
108
118
  end
109
119
 
110
120
 
111
- # See ::RGeo::Features::Factory#line_string
121
+ # See ::RGeo::Feature::Factory#line_string
112
122
 
113
123
  def line_string(points_)
114
124
  LineStringImpl.new(self, points_) rescue nil
115
125
  end
116
126
 
117
127
 
118
- # See ::RGeo::Features::Factory#line
128
+ # See ::RGeo::Feature::Factory#line
119
129
 
120
130
  def line(start_, end_)
121
131
  LineImpl.new(self, start_, end_) rescue nil
122
132
  end
123
133
 
124
134
 
125
- # See ::RGeo::Features::Factory#linear_ring
135
+ # See ::RGeo::Feature::Factory#linear_ring
126
136
 
127
137
  def linear_ring(points_)
128
138
  LinearRingImpl.new(self, points_) rescue nil
129
139
  end
130
140
 
131
141
 
132
- # See ::RGeo::Features::Factory#polygon
142
+ # See ::RGeo::Feature::Factory#polygon
133
143
 
134
144
  def polygon(outer_ring_, inner_rings_=nil)
135
145
  PolygonImpl.new(self, outer_ring_, inner_rings_) rescue nil
136
146
  end
137
147
 
138
148
 
139
- # See ::RGeo::Features::Factory#collection
149
+ # See ::RGeo::Feature::Factory#collection
140
150
 
141
151
  def collection(elems_)
142
152
  GeometryCollectionImpl.new(self, elems_) rescue nil
143
153
  end
144
154
 
145
155
 
146
- # See ::RGeo::Features::Factory#multi_point
156
+ # See ::RGeo::Feature::Factory#multi_point
147
157
 
148
158
  def multi_point(elems_)
149
159
  MultiPointImpl.new(self, elems_) rescue nil
150
160
  end
151
161
 
152
162
 
153
- # See ::RGeo::Features::Factory#multi_line_string
163
+ # See ::RGeo::Feature::Factory#multi_line_string
154
164
 
155
165
  def multi_line_string(elems_)
156
166
  MultiLineStringImpl.new(self, elems_) rescue nil
157
167
  end
158
168
 
159
169
 
160
- # See ::RGeo::Features::Factory#multi_polygon
170
+ # See ::RGeo::Feature::Factory#multi_polygon
161
171
 
162
172
  def multi_polygon(elems_)
163
173
  MultiPolygonImpl.new(self, elems_) rescue nil
164
174
  end
165
175
 
166
176
 
177
+ # See ::RGeo::Feature::Factory#proj4
178
+
179
+ def proj4
180
+ @proj4
181
+ end
182
+
183
+
167
184
  end
168
185
 
169
186
 
@@ -42,14 +42,14 @@ module RGeo
42
42
  class PointImpl # :nodoc:
43
43
 
44
44
 
45
- include ::RGeo::Features::Point
46
- include ::RGeo::ImplHelpers::BasicGeometryMethods
47
- include ::RGeo::ImplHelpers::BasicPointMethods
45
+ include ::RGeo::Feature::Point
46
+ include ::RGeo::ImplHelper::BasicGeometryMethods
47
+ include ::RGeo::ImplHelper::BasicPointMethods
48
48
  include ::RGeo::Cartesian::GeometryMethods
49
49
 
50
50
 
51
51
  def distance(rhs_)
52
- rhs_ = ::RGeo::Features.cast(rhs_, @factory)
52
+ rhs_ = ::RGeo::Feature.cast(rhs_, @factory)
53
53
  case rhs_
54
54
  when PointImpl
55
55
  dx_ = @x - rhs_.x
@@ -67,9 +67,9 @@ module RGeo
67
67
  class LineStringImpl # :nodoc:
68
68
 
69
69
 
70
- include ::RGeo::Features::LineString
71
- include ::RGeo::ImplHelpers::BasicGeometryMethods
72
- include ::RGeo::ImplHelpers::BasicLineStringMethods
70
+ include ::RGeo::Feature::LineString
71
+ include ::RGeo::ImplHelper::BasicGeometryMethods
72
+ include ::RGeo::ImplHelper::BasicLineStringMethods
73
73
  include ::RGeo::Cartesian::GeometryMethods
74
74
  include ::RGeo::Cartesian::LineStringMethods
75
75
 
@@ -80,10 +80,10 @@ module RGeo
80
80
  class LineImpl # :nodoc:
81
81
 
82
82
 
83
- include ::RGeo::Features::Line
84
- include ::RGeo::ImplHelpers::BasicGeometryMethods
85
- include ::RGeo::ImplHelpers::BasicLineStringMethods
86
- include ::RGeo::ImplHelpers::BasicLineMethods
83
+ include ::RGeo::Feature::Line
84
+ include ::RGeo::ImplHelper::BasicGeometryMethods
85
+ include ::RGeo::ImplHelper::BasicLineStringMethods
86
+ include ::RGeo::ImplHelper::BasicLineMethods
87
87
  include ::RGeo::Cartesian::GeometryMethods
88
88
  include ::RGeo::Cartesian::LineStringMethods
89
89
 
@@ -94,10 +94,10 @@ module RGeo
94
94
  class LinearRingImpl # :nodoc:
95
95
 
96
96
 
97
- include ::RGeo::Features::Line
98
- include ::RGeo::ImplHelpers::BasicGeometryMethods
99
- include ::RGeo::ImplHelpers::BasicLineStringMethods
100
- include ::RGeo::ImplHelpers::BasicLinearRingMethods
97
+ include ::RGeo::Feature::Line
98
+ include ::RGeo::ImplHelper::BasicGeometryMethods
99
+ include ::RGeo::ImplHelper::BasicLineStringMethods
100
+ include ::RGeo::ImplHelper::BasicLinearRingMethods
101
101
  include ::RGeo::Cartesian::GeometryMethods
102
102
  include ::RGeo::Cartesian::LineStringMethods
103
103
 
@@ -108,9 +108,9 @@ module RGeo
108
108
  class PolygonImpl # :nodoc:
109
109
 
110
110
 
111
- include ::RGeo::Features::Polygon
112
- include ::RGeo::ImplHelpers::BasicGeometryMethods
113
- include ::RGeo::ImplHelpers::BasicPolygonMethods
111
+ include ::RGeo::Feature::Polygon
112
+ include ::RGeo::ImplHelper::BasicGeometryMethods
113
+ include ::RGeo::ImplHelper::BasicPolygonMethods
114
114
  include ::RGeo::Cartesian::GeometryMethods
115
115
 
116
116
 
@@ -120,9 +120,9 @@ module RGeo
120
120
  class GeometryCollectionImpl # :nodoc:
121
121
 
122
122
 
123
- include ::RGeo::Features::GeometryCollection
124
- include ::RGeo::ImplHelpers::BasicGeometryMethods
125
- include ::RGeo::ImplHelpers::BasicGeometryCollectionMethods
123
+ include ::RGeo::Feature::GeometryCollection
124
+ include ::RGeo::ImplHelper::BasicGeometryMethods
125
+ include ::RGeo::ImplHelper::BasicGeometryCollectionMethods
126
126
  include ::RGeo::Cartesian::GeometryMethods
127
127
 
128
128
 
@@ -132,10 +132,10 @@ module RGeo
132
132
  class MultiPointImpl # :nodoc:
133
133
 
134
134
 
135
- include ::RGeo::Features::GeometryCollection
136
- include ::RGeo::ImplHelpers::BasicGeometryMethods
137
- include ::RGeo::ImplHelpers::BasicGeometryCollectionMethods
138
- include ::RGeo::ImplHelpers::BasicMultiPointMethods
135
+ include ::RGeo::Feature::GeometryCollection
136
+ include ::RGeo::ImplHelper::BasicGeometryMethods
137
+ include ::RGeo::ImplHelper::BasicGeometryCollectionMethods
138
+ include ::RGeo::ImplHelper::BasicMultiPointMethods
139
139
  include ::RGeo::Cartesian::GeometryMethods
140
140
 
141
141
 
@@ -145,10 +145,10 @@ module RGeo
145
145
  class MultiLineStringImpl # :nodoc:
146
146
 
147
147
 
148
- include ::RGeo::Features::GeometryCollection
149
- include ::RGeo::ImplHelpers::BasicGeometryMethods
150
- include ::RGeo::ImplHelpers::BasicGeometryCollectionMethods
151
- include ::RGeo::ImplHelpers::BasicMultiLineStringMethods
148
+ include ::RGeo::Feature::GeometryCollection
149
+ include ::RGeo::ImplHelper::BasicGeometryMethods
150
+ include ::RGeo::ImplHelper::BasicGeometryCollectionMethods
151
+ include ::RGeo::ImplHelper::BasicMultiLineStringMethods
152
152
  include ::RGeo::Cartesian::GeometryMethods
153
153
 
154
154
 
@@ -158,10 +158,10 @@ module RGeo
158
158
  class MultiPolygonImpl # :nodoc:
159
159
 
160
160
 
161
- include ::RGeo::Features::GeometryCollection
162
- include ::RGeo::ImplHelpers::BasicGeometryMethods
163
- include ::RGeo::ImplHelpers::BasicGeometryCollectionMethods
164
- include ::RGeo::ImplHelpers::BasicMultiPolygonMethods
161
+ include ::RGeo::Feature::GeometryCollection
162
+ include ::RGeo::ImplHelper::BasicGeometryMethods
163
+ include ::RGeo::ImplHelper::BasicGeometryCollectionMethods
164
+ include ::RGeo::ImplHelper::BasicMultiPolygonMethods
165
165
  include ::RGeo::Cartesian::GeometryMethods
166
166
 
167
167
 
@@ -70,9 +70,9 @@ module RGeo
70
70
  # thus always available, but it does not implement many of the more
71
71
  # advanced geometric operations. These limitations are:
72
72
  #
73
- # * Relational operators such as Features::Geometry#intersects? are
73
+ # * Relational operators such as Feature::Geometry#intersects? are
74
74
  # not implemented for most types.
75
- # * Relational constructors such as Features::Geometry#union are
75
+ # * Relational constructors such as Feature::Geometry#union are
76
76
  # not implemented for most types.
77
77
  # * Buffer and convex hull calculations are not implemented for most
78
78
  # types. Boundaries are available except for GeometryCollection.
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------
2
2
  #
3
- # All files in the Cartesian module for RGeo
3
+ # GEOS wrapper for RGeo
4
4
  #
5
5
  # -----------------------------------------------------------------------------
6
6
  # Copyright 2010 Daniel Azuma
@@ -34,7 +34,25 @@
34
34
  ;
35
35
 
36
36
 
37
- require 'rgeo/geography'
37
+ # Parent file
38
+ require 'rgeo'
38
39
 
39
- require 'rgeo/geography/simple_spherical'
40
- require 'rgeo/geography/simple_mercator'
40
+
41
+ module RGeo
42
+
43
+
44
+ # Coordinate reference systems.
45
+
46
+ module CoordSys
47
+ end
48
+
49
+
50
+ end
51
+
52
+
53
+ # Dependency files
54
+ require 'rgeo/feature'
55
+
56
+ # Implementation files
57
+ require 'rgeo/coord_sys/proj4_c_impl'
58
+ require 'rgeo/coord_sys/proj4'