rgeo 0.1.19 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +11 -0
- data/README.rdoc +23 -7
- data/Version +1 -1
- data/ext/geos_c_impl/factory.c +1 -1
- data/{lib/rgeo/geography/simple_mercator.rb → ext/proj4_c_impl/extconf.rb} +35 -30
- data/ext/proj4_c_impl/main.c +256 -0
- data/lib/rgeo.rb +54 -42
- data/lib/rgeo/active_record/arel_modifications.rb +2 -2
- data/lib/rgeo/active_record/base_modifications.rb +1 -1
- data/lib/rgeo/active_record/mysql_common.rb +12 -12
- data/lib/rgeo/all.rb +5 -4
- data/lib/rgeo/cartesian.rb +3 -2
- data/lib/rgeo/cartesian/bounding_box.rb +9 -9
- data/lib/rgeo/cartesian/factory.rb +30 -13
- data/lib/rgeo/cartesian/feature_classes.rb +33 -33
- data/lib/rgeo/cartesian/interface.rb +2 -2
- data/lib/rgeo/{geography/all.rb → coord_sys.rb} +22 -4
- data/lib/rgeo/coord_sys/proj4.rb +275 -0
- data/lib/rgeo/{errors.rb → error.rb} +5 -6
- data/lib/rgeo/{features.rb → feature.rb} +22 -20
- data/lib/rgeo/{features → feature}/curve.rb +6 -6
- data/lib/rgeo/{features → feature}/factory.rb +19 -3
- data/lib/rgeo/{features → feature}/factory_generator.rb +1 -1
- data/lib/rgeo/{features → feature}/geometry.rb +34 -34
- data/lib/rgeo/{features → feature}/geometry_collection.rb +4 -4
- data/lib/rgeo/{features → feature}/line.rb +1 -1
- data/lib/rgeo/{features → feature}/line_string.rb +4 -4
- data/lib/rgeo/{features → feature}/linear_ring.rb +1 -1
- data/lib/rgeo/{features → feature}/multi_curve.rb +3 -3
- data/lib/rgeo/{features → feature}/multi_line_string.rb +1 -1
- data/lib/rgeo/{features → feature}/multi_point.rb +1 -1
- data/lib/rgeo/{features → feature}/multi_polygon.rb +1 -1
- data/lib/rgeo/{features → feature}/multi_surface.rb +4 -4
- data/lib/rgeo/{features → feature}/point.rb +5 -5
- data/lib/rgeo/{features → feature}/polygon.rb +5 -5
- data/lib/rgeo/{features → feature}/surface.rb +4 -4
- data/lib/rgeo/feature/types.rb +301 -0
- data/lib/rgeo/geo_json.rb +1 -1
- data/lib/rgeo/geo_json/coder.rb +13 -13
- data/lib/rgeo/geo_json/interface.rb +2 -2
- data/lib/rgeo/geography.rb +33 -6
- data/lib/rgeo/geography/factory.rb +82 -39
- data/lib/rgeo/geography/interface.rb +135 -89
- data/lib/rgeo/geography/proj4_projector.rb +98 -0
- data/lib/rgeo/geography/projected_feature_classes.rb +213 -0
- data/lib/rgeo/geography/projected_feature_methods.rb +228 -0
- data/lib/rgeo/geography/projected_window.rb +7 -7
- data/lib/rgeo/geography/simple_mercator_projector.rb +133 -0
- data/lib/rgeo/geography/spherical_feature_classes.rb +212 -0
- data/lib/rgeo/geography/{simple_spherical/feature_methods.rb → spherical_feature_methods.rb} +39 -43
- data/lib/rgeo/geography/{simple_spherical/calculations.rb → spherical_math.rb} +7 -7
- data/lib/rgeo/geos.rb +1 -1
- data/lib/rgeo/geos/factory.rb +37 -19
- data/lib/rgeo/geos/impl_additions.rb +10 -11
- data/lib/rgeo/geos/interface.rb +1 -1
- data/lib/rgeo/geos/zm_factory.rb +15 -15
- data/lib/rgeo/geos/zm_impl.rb +10 -10
- data/lib/rgeo/{impl_helpers.rb → impl_helper.rb} +8 -8
- data/lib/rgeo/{impl_helpers → impl_helper}/basic_geometry_collection_methods.rb +13 -13
- data/lib/rgeo/{impl_helpers → impl_helper}/basic_geometry_methods.rb +2 -2
- data/lib/rgeo/{impl_helpers → impl_helper}/basic_line_string_methods.rb +13 -13
- data/lib/rgeo/{impl_helpers → impl_helper}/basic_point_methods.rb +5 -5
- data/lib/rgeo/{impl_helpers → impl_helper}/basic_polygon_methods.rb +6 -6
- data/lib/rgeo/{impl_helpers → impl_helper}/math.rb +1 -1
- data/lib/rgeo/shapefile.rb +1 -1
- data/lib/rgeo/shapefile/reader.rb +3 -3
- data/lib/rgeo/wkrep.rb +1 -1
- data/lib/rgeo/wkrep/wkb_generator.rb +17 -17
- data/lib/rgeo/wkrep/wkb_parser.rb +12 -12
- data/lib/rgeo/wkrep/wkt_generator.rb +8 -8
- data/lib/rgeo/wkrep/wkt_parser.rb +10 -10
- data/{tests → test}/active_record/readme.txt +0 -0
- data/{tests → test}/active_record/tc_mysqlspatial.rb +2 -2
- data/{tests → test}/common/geometry_collection_tests.rb +22 -22
- data/{tests → test}/common/line_string_tests.rb +20 -20
- data/{tests → test}/common/multi_line_string_tests.rb +19 -19
- data/{tests → test}/common/multi_point_tests.rb +17 -17
- data/{tests → test}/common/multi_polygon_tests.rb +16 -16
- data/{tests → test}/common/point_tests.rb +9 -9
- data/{tests → test}/common/polygon_tests.rb +9 -9
- data/test/coord_sys/tc_proj4.rb +111 -0
- data/{tests → test}/geos/tc_factory.rb +1 -1
- data/{tests → test}/geos/tc_geometry_collection.rb +1 -1
- data/{tests → test}/geos/tc_line_string.rb +0 -0
- data/{tests → test}/geos/tc_misc.rb +1 -1
- data/{tests → test}/geos/tc_multi_line_string.rb +1 -1
- data/{tests → test}/geos/tc_multi_point.rb +1 -1
- data/{tests → test}/geos/tc_multi_polygon.rb +1 -1
- data/{tests → test}/geos/tc_point.rb +1 -1
- data/{tests → test}/geos/tc_polygon.rb +0 -0
- data/{tests → test}/geos/tc_zmfactory.rb +2 -2
- data/test/projected_geography/tc_geometry_collection.rb +62 -0
- data/test/projected_geography/tc_line_string.rb +62 -0
- data/test/projected_geography/tc_multi_line_string.rb +62 -0
- data/test/projected_geography/tc_multi_point.rb +62 -0
- data/test/projected_geography/tc_multi_polygon.rb +63 -0
- data/test/projected_geography/tc_point.rb +93 -0
- data/test/projected_geography/tc_polygon.rb +62 -0
- data/{tests → test}/shapefile/shapelib_testcases/readme.txt +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test.dbf +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test0.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test0.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test1.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test1.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test10.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test10.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test11.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test11.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test12.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test12.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test13.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test13.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test2.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test2.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test3.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test3.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test4.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test4.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test5.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test5.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test6.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test6.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test7.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test7.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test8.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test8.shx +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test9.shp +0 -0
- data/{tests → test}/shapefile/shapelib_testcases/test9.shx +0 -0
- data/{tests → test}/shapefile/tc_shapelib_tests.rb +17 -17
- data/{tests → test}/simple_cartesian/tc_calculations.rb +0 -0
- data/{tests → test}/simple_cartesian/tc_geometry_collection.rb +0 -0
- data/{tests → test}/simple_cartesian/tc_line_string.rb +0 -0
- data/{tests → test}/simple_cartesian/tc_multi_line_string.rb +0 -0
- data/{tests → test}/simple_cartesian/tc_multi_point.rb +0 -0
- data/{tests → test}/simple_cartesian/tc_multi_polygon.rb +0 -0
- data/{tests → test}/simple_cartesian/tc_point.rb +0 -0
- data/{tests → test}/simple_cartesian/tc_polygon.rb +0 -0
- data/{tests → test}/simple_mercator/tc_geometry_collection.rb +1 -1
- data/{tests → test}/simple_mercator/tc_line_string.rb +0 -0
- data/{tests → test}/simple_mercator/tc_multi_line_string.rb +1 -1
- data/{tests → test}/simple_mercator/tc_multi_point.rb +1 -1
- data/{tests → test}/simple_mercator/tc_multi_polygon.rb +1 -1
- data/{tests → test}/simple_mercator/tc_point.rb +2 -2
- data/{tests → test}/simple_mercator/tc_polygon.rb +0 -0
- data/{tests → test}/simple_mercator/tc_window.rb +1 -1
- data/test/spherical_geography/tc_calculations.rb +203 -0
- data/{tests/simple_spherical → test/spherical_geography}/tc_geometry_collection.rb +2 -2
- data/{tests/simple_spherical → test/spherical_geography}/tc_line_string.rb +2 -2
- data/{tests/simple_spherical → test/spherical_geography}/tc_multi_line_string.rb +2 -2
- data/{tests/simple_spherical → test/spherical_geography}/tc_multi_point.rb +2 -2
- data/{tests/simple_spherical → test/spherical_geography}/tc_multi_polygon.rb +3 -3
- data/{tests/simple_spherical → test/spherical_geography}/tc_point.rb +7 -7
- data/{tests/simple_spherical → test/spherical_geography}/tc_polygon.rb +2 -2
- data/{tests → test}/tc_cartesian_analysis.rb +0 -0
- data/{tests → test}/tc_geojson.rb +0 -0
- data/{tests → test}/tc_oneoff.rb +2 -1
- data/{tests → test}/wkrep/tc_wkb_generator.rb +0 -0
- data/{tests → test}/wkrep/tc_wkb_parser.rb +32 -32
- data/{tests → test}/wkrep/tc_wkt_generator.rb +0 -0
- data/{tests → test}/wkrep/tc_wkt_parser.rb +46 -46
- metadata +183 -164
- data/lib/rgeo/features/types.rb +0 -272
- data/lib/rgeo/geography/simple_mercator/feature_classes.rb +0 -279
- data/lib/rgeo/geography/simple_mercator/feature_methods.rb +0 -278
- data/lib/rgeo/geography/simple_mercator/projector.rb +0 -112
- data/lib/rgeo/geography/simple_spherical.rb +0 -68
- data/lib/rgeo/geography/simple_spherical/feature_classes.rb +0 -216
- data/tests/simple_spherical/tc_calculations.rb +0 -203
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
|
+
- 20
|
9
|
+
version: 0.1.20
|
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-30 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -113,6 +113,7 @@ executables: []
|
|
113
113
|
|
114
114
|
extensions:
|
115
115
|
- ext/geos_c_impl/extconf.rb
|
116
|
+
- ext/proj4_c_impl/extconf.rb
|
116
117
|
extra_rdoc_files:
|
117
118
|
- History.rdoc
|
118
119
|
- README.rdoc
|
@@ -132,41 +133,41 @@ files:
|
|
132
133
|
- lib/rgeo/cartesian/feature_methods.rb
|
133
134
|
- lib/rgeo/cartesian/interface.rb
|
134
135
|
- lib/rgeo/cartesian.rb
|
135
|
-
- lib/rgeo/
|
136
|
-
- lib/rgeo/
|
137
|
-
- lib/rgeo/
|
138
|
-
- lib/rgeo/
|
139
|
-
- lib/rgeo/
|
140
|
-
- lib/rgeo/
|
141
|
-
- lib/rgeo/
|
142
|
-
- lib/rgeo/
|
143
|
-
- lib/rgeo/
|
144
|
-
- lib/rgeo/
|
145
|
-
- lib/rgeo/
|
146
|
-
- lib/rgeo/
|
147
|
-
- lib/rgeo/
|
148
|
-
- lib/rgeo/
|
149
|
-
- lib/rgeo/
|
150
|
-
- lib/rgeo/
|
151
|
-
- lib/rgeo/
|
152
|
-
- lib/rgeo/
|
153
|
-
- lib/rgeo/
|
136
|
+
- lib/rgeo/coord_sys/proj4.rb
|
137
|
+
- lib/rgeo/coord_sys.rb
|
138
|
+
- lib/rgeo/error.rb
|
139
|
+
- lib/rgeo/feature/curve.rb
|
140
|
+
- lib/rgeo/feature/factory.rb
|
141
|
+
- lib/rgeo/feature/factory_generator.rb
|
142
|
+
- lib/rgeo/feature/geometry.rb
|
143
|
+
- lib/rgeo/feature/geometry_collection.rb
|
144
|
+
- lib/rgeo/feature/line.rb
|
145
|
+
- lib/rgeo/feature/line_string.rb
|
146
|
+
- lib/rgeo/feature/linear_ring.rb
|
147
|
+
- lib/rgeo/feature/multi_curve.rb
|
148
|
+
- lib/rgeo/feature/multi_line_string.rb
|
149
|
+
- lib/rgeo/feature/multi_point.rb
|
150
|
+
- lib/rgeo/feature/multi_polygon.rb
|
151
|
+
- lib/rgeo/feature/multi_surface.rb
|
152
|
+
- lib/rgeo/feature/point.rb
|
153
|
+
- lib/rgeo/feature/polygon.rb
|
154
|
+
- lib/rgeo/feature/surface.rb
|
155
|
+
- lib/rgeo/feature/types.rb
|
156
|
+
- lib/rgeo/feature.rb
|
154
157
|
- lib/rgeo/geo_json/coder.rb
|
155
158
|
- lib/rgeo/geo_json/entities.rb
|
156
159
|
- lib/rgeo/geo_json/interface.rb
|
157
160
|
- lib/rgeo/geo_json.rb
|
158
|
-
- lib/rgeo/geography/all.rb
|
159
161
|
- lib/rgeo/geography/factory.rb
|
160
162
|
- lib/rgeo/geography/interface.rb
|
163
|
+
- lib/rgeo/geography/proj4_projector.rb
|
164
|
+
- lib/rgeo/geography/projected_feature_classes.rb
|
165
|
+
- lib/rgeo/geography/projected_feature_methods.rb
|
161
166
|
- lib/rgeo/geography/projected_window.rb
|
162
|
-
- lib/rgeo/geography/
|
163
|
-
- lib/rgeo/geography/
|
164
|
-
- lib/rgeo/geography/
|
165
|
-
- lib/rgeo/geography/
|
166
|
-
- lib/rgeo/geography/simple_spherical/calculations.rb
|
167
|
-
- lib/rgeo/geography/simple_spherical/feature_classes.rb
|
168
|
-
- lib/rgeo/geography/simple_spherical/feature_methods.rb
|
169
|
-
- lib/rgeo/geography/simple_spherical.rb
|
167
|
+
- lib/rgeo/geography/simple_mercator_projector.rb
|
168
|
+
- lib/rgeo/geography/spherical_feature_classes.rb
|
169
|
+
- lib/rgeo/geography/spherical_feature_methods.rb
|
170
|
+
- lib/rgeo/geography/spherical_math.rb
|
170
171
|
- lib/rgeo/geography.rb
|
171
172
|
- lib/rgeo/geos/factory.rb
|
172
173
|
- lib/rgeo/geos/impl_additions.rb
|
@@ -174,13 +175,13 @@ files:
|
|
174
175
|
- lib/rgeo/geos/zm_factory.rb
|
175
176
|
- lib/rgeo/geos/zm_impl.rb
|
176
177
|
- lib/rgeo/geos.rb
|
177
|
-
- lib/rgeo/
|
178
|
-
- lib/rgeo/
|
179
|
-
- lib/rgeo/
|
180
|
-
- lib/rgeo/
|
181
|
-
- lib/rgeo/
|
182
|
-
- lib/rgeo/
|
183
|
-
- lib/rgeo/
|
178
|
+
- lib/rgeo/impl_helper/basic_geometry_collection_methods.rb
|
179
|
+
- lib/rgeo/impl_helper/basic_geometry_methods.rb
|
180
|
+
- lib/rgeo/impl_helper/basic_line_string_methods.rb
|
181
|
+
- lib/rgeo/impl_helper/basic_point_methods.rb
|
182
|
+
- lib/rgeo/impl_helper/basic_polygon_methods.rb
|
183
|
+
- lib/rgeo/impl_helper/math.rb
|
184
|
+
- lib/rgeo/impl_helper.rb
|
184
185
|
- lib/rgeo/shapefile/reader.rb
|
185
186
|
- lib/rgeo/shapefile.rb
|
186
187
|
- lib/rgeo/version.rb
|
@@ -192,90 +193,99 @@ files:
|
|
192
193
|
- lib/rgeo.rb
|
193
194
|
- History.rdoc
|
194
195
|
- README.rdoc
|
195
|
-
-
|
196
|
-
-
|
197
|
-
-
|
198
|
-
-
|
199
|
-
-
|
200
|
-
-
|
201
|
-
-
|
202
|
-
-
|
203
|
-
-
|
204
|
-
-
|
205
|
-
-
|
206
|
-
-
|
207
|
-
-
|
208
|
-
-
|
209
|
-
-
|
210
|
-
-
|
211
|
-
-
|
212
|
-
-
|
213
|
-
-
|
214
|
-
-
|
215
|
-
-
|
216
|
-
-
|
217
|
-
-
|
218
|
-
-
|
219
|
-
-
|
220
|
-
-
|
221
|
-
-
|
222
|
-
-
|
223
|
-
-
|
224
|
-
-
|
225
|
-
-
|
226
|
-
-
|
227
|
-
-
|
228
|
-
-
|
229
|
-
-
|
230
|
-
-
|
231
|
-
-
|
232
|
-
-
|
233
|
-
-
|
234
|
-
-
|
235
|
-
-
|
236
|
-
-
|
237
|
-
-
|
238
|
-
-
|
239
|
-
-
|
240
|
-
-
|
241
|
-
-
|
242
|
-
-
|
243
|
-
-
|
244
|
-
-
|
245
|
-
-
|
246
|
-
-
|
247
|
-
-
|
248
|
-
-
|
249
|
-
-
|
250
|
-
-
|
251
|
-
-
|
252
|
-
-
|
253
|
-
-
|
254
|
-
-
|
255
|
-
-
|
256
|
-
-
|
257
|
-
-
|
258
|
-
-
|
259
|
-
-
|
260
|
-
-
|
261
|
-
-
|
262
|
-
-
|
263
|
-
-
|
264
|
-
-
|
265
|
-
-
|
266
|
-
-
|
267
|
-
-
|
268
|
-
-
|
269
|
-
-
|
270
|
-
-
|
271
|
-
-
|
272
|
-
-
|
273
|
-
-
|
274
|
-
-
|
275
|
-
-
|
276
|
-
-
|
277
|
-
-
|
196
|
+
- test/active_record/tc_mysqlspatial.rb
|
197
|
+
- test/common/geometry_collection_tests.rb
|
198
|
+
- test/common/line_string_tests.rb
|
199
|
+
- test/common/multi_line_string_tests.rb
|
200
|
+
- test/common/multi_point_tests.rb
|
201
|
+
- test/common/multi_polygon_tests.rb
|
202
|
+
- test/common/point_tests.rb
|
203
|
+
- test/common/polygon_tests.rb
|
204
|
+
- test/coord_sys/tc_proj4.rb
|
205
|
+
- test/geos/tc_factory.rb
|
206
|
+
- test/geos/tc_geometry_collection.rb
|
207
|
+
- test/geos/tc_line_string.rb
|
208
|
+
- test/geos/tc_misc.rb
|
209
|
+
- test/geos/tc_multi_line_string.rb
|
210
|
+
- test/geos/tc_multi_point.rb
|
211
|
+
- test/geos/tc_multi_polygon.rb
|
212
|
+
- test/geos/tc_point.rb
|
213
|
+
- test/geos/tc_polygon.rb
|
214
|
+
- test/geos/tc_zmfactory.rb
|
215
|
+
- test/projected_geography/tc_geometry_collection.rb
|
216
|
+
- test/projected_geography/tc_line_string.rb
|
217
|
+
- test/projected_geography/tc_multi_line_string.rb
|
218
|
+
- test/projected_geography/tc_multi_point.rb
|
219
|
+
- test/projected_geography/tc_multi_polygon.rb
|
220
|
+
- test/projected_geography/tc_point.rb
|
221
|
+
- test/projected_geography/tc_polygon.rb
|
222
|
+
- test/shapefile/tc_shapelib_tests.rb
|
223
|
+
- test/simple_cartesian/tc_calculations.rb
|
224
|
+
- test/simple_cartesian/tc_geometry_collection.rb
|
225
|
+
- test/simple_cartesian/tc_line_string.rb
|
226
|
+
- test/simple_cartesian/tc_multi_line_string.rb
|
227
|
+
- test/simple_cartesian/tc_multi_point.rb
|
228
|
+
- test/simple_cartesian/tc_multi_polygon.rb
|
229
|
+
- test/simple_cartesian/tc_point.rb
|
230
|
+
- test/simple_cartesian/tc_polygon.rb
|
231
|
+
- test/simple_mercator/tc_geometry_collection.rb
|
232
|
+
- test/simple_mercator/tc_line_string.rb
|
233
|
+
- test/simple_mercator/tc_multi_line_string.rb
|
234
|
+
- test/simple_mercator/tc_multi_point.rb
|
235
|
+
- test/simple_mercator/tc_multi_polygon.rb
|
236
|
+
- test/simple_mercator/tc_point.rb
|
237
|
+
- test/simple_mercator/tc_polygon.rb
|
238
|
+
- test/simple_mercator/tc_window.rb
|
239
|
+
- test/spherical_geography/tc_calculations.rb
|
240
|
+
- test/spherical_geography/tc_geometry_collection.rb
|
241
|
+
- test/spherical_geography/tc_line_string.rb
|
242
|
+
- test/spherical_geography/tc_multi_line_string.rb
|
243
|
+
- test/spherical_geography/tc_multi_point.rb
|
244
|
+
- test/spherical_geography/tc_multi_polygon.rb
|
245
|
+
- test/spherical_geography/tc_point.rb
|
246
|
+
- test/spherical_geography/tc_polygon.rb
|
247
|
+
- test/tc_cartesian_analysis.rb
|
248
|
+
- test/tc_geojson.rb
|
249
|
+
- test/tc_oneoff.rb
|
250
|
+
- test/wkrep/tc_wkb_generator.rb
|
251
|
+
- test/wkrep/tc_wkb_parser.rb
|
252
|
+
- test/wkrep/tc_wkt_generator.rb
|
253
|
+
- test/wkrep/tc_wkt_parser.rb
|
254
|
+
- test/active_record/readme.txt
|
255
|
+
- test/shapefile/shapelib_testcases/readme.txt
|
256
|
+
- test/shapefile/shapelib_testcases/test.shp
|
257
|
+
- test/shapefile/shapelib_testcases/test0.shp
|
258
|
+
- test/shapefile/shapelib_testcases/test1.shp
|
259
|
+
- test/shapefile/shapelib_testcases/test10.shp
|
260
|
+
- test/shapefile/shapelib_testcases/test11.shp
|
261
|
+
- test/shapefile/shapelib_testcases/test12.shp
|
262
|
+
- test/shapefile/shapelib_testcases/test13.shp
|
263
|
+
- test/shapefile/shapelib_testcases/test2.shp
|
264
|
+
- test/shapefile/shapelib_testcases/test3.shp
|
265
|
+
- test/shapefile/shapelib_testcases/test4.shp
|
266
|
+
- test/shapefile/shapelib_testcases/test5.shp
|
267
|
+
- test/shapefile/shapelib_testcases/test6.shp
|
268
|
+
- test/shapefile/shapelib_testcases/test7.shp
|
269
|
+
- test/shapefile/shapelib_testcases/test8.shp
|
270
|
+
- test/shapefile/shapelib_testcases/test9.shp
|
271
|
+
- test/shapefile/shapelib_testcases/test.shx
|
272
|
+
- test/shapefile/shapelib_testcases/test0.shx
|
273
|
+
- test/shapefile/shapelib_testcases/test1.shx
|
274
|
+
- test/shapefile/shapelib_testcases/test10.shx
|
275
|
+
- test/shapefile/shapelib_testcases/test11.shx
|
276
|
+
- test/shapefile/shapelib_testcases/test12.shx
|
277
|
+
- test/shapefile/shapelib_testcases/test13.shx
|
278
|
+
- test/shapefile/shapelib_testcases/test2.shx
|
279
|
+
- test/shapefile/shapelib_testcases/test3.shx
|
280
|
+
- test/shapefile/shapelib_testcases/test4.shx
|
281
|
+
- test/shapefile/shapelib_testcases/test5.shx
|
282
|
+
- test/shapefile/shapelib_testcases/test6.shx
|
283
|
+
- test/shapefile/shapelib_testcases/test7.shx
|
284
|
+
- test/shapefile/shapelib_testcases/test8.shx
|
285
|
+
- test/shapefile/shapelib_testcases/test9.shx
|
286
|
+
- test/shapefile/shapelib_testcases/test.dbf
|
278
287
|
- ext/geos_c_impl/extconf.rb
|
288
|
+
- ext/proj4_c_impl/extconf.rb
|
279
289
|
- ext/geos_c_impl/factory.c
|
280
290
|
- ext/geos_c_impl/geometry.c
|
281
291
|
- ext/geos_c_impl/geometry_collection.c
|
@@ -283,6 +293,7 @@ files:
|
|
283
293
|
- ext/geos_c_impl/main.c
|
284
294
|
- ext/geos_c_impl/point.c
|
285
295
|
- ext/geos_c_impl/polygon.c
|
296
|
+
- ext/proj4_c_impl/main.c
|
286
297
|
- ext/geos_c_impl/factory.h
|
287
298
|
- ext/geos_c_impl/geometry.h
|
288
299
|
- ext/geos_c_impl/geometry_collection.h
|
@@ -326,46 +337,54 @@ signing_key:
|
|
326
337
|
specification_version: 3
|
327
338
|
summary: RGeo is a spatial data library for Ruby.
|
328
339
|
test_files:
|
329
|
-
-
|
330
|
-
-
|
331
|
-
-
|
332
|
-
-
|
333
|
-
-
|
334
|
-
-
|
335
|
-
-
|
336
|
-
-
|
337
|
-
-
|
338
|
-
-
|
339
|
-
-
|
340
|
-
-
|
341
|
-
-
|
342
|
-
-
|
343
|
-
-
|
344
|
-
-
|
345
|
-
-
|
346
|
-
-
|
347
|
-
-
|
348
|
-
-
|
349
|
-
-
|
350
|
-
-
|
351
|
-
-
|
352
|
-
-
|
353
|
-
-
|
354
|
-
-
|
355
|
-
-
|
356
|
-
-
|
357
|
-
-
|
358
|
-
-
|
359
|
-
-
|
360
|
-
-
|
361
|
-
-
|
362
|
-
-
|
363
|
-
-
|
364
|
-
-
|
365
|
-
-
|
366
|
-
-
|
367
|
-
-
|
368
|
-
-
|
369
|
-
-
|
370
|
-
-
|
371
|
-
-
|
340
|
+
- test/active_record/tc_mysqlspatial.rb
|
341
|
+
- test/coord_sys/tc_proj4.rb
|
342
|
+
- test/geos/tc_factory.rb
|
343
|
+
- test/geos/tc_geometry_collection.rb
|
344
|
+
- test/geos/tc_line_string.rb
|
345
|
+
- test/geos/tc_misc.rb
|
346
|
+
- test/geos/tc_multi_line_string.rb
|
347
|
+
- test/geos/tc_multi_point.rb
|
348
|
+
- test/geos/tc_multi_polygon.rb
|
349
|
+
- test/geos/tc_point.rb
|
350
|
+
- test/geos/tc_polygon.rb
|
351
|
+
- test/geos/tc_zmfactory.rb
|
352
|
+
- test/projected_geography/tc_geometry_collection.rb
|
353
|
+
- test/projected_geography/tc_line_string.rb
|
354
|
+
- test/projected_geography/tc_multi_line_string.rb
|
355
|
+
- test/projected_geography/tc_multi_point.rb
|
356
|
+
- test/projected_geography/tc_multi_polygon.rb
|
357
|
+
- test/projected_geography/tc_point.rb
|
358
|
+
- test/projected_geography/tc_polygon.rb
|
359
|
+
- test/shapefile/tc_shapelib_tests.rb
|
360
|
+
- test/simple_cartesian/tc_calculations.rb
|
361
|
+
- test/simple_cartesian/tc_geometry_collection.rb
|
362
|
+
- test/simple_cartesian/tc_line_string.rb
|
363
|
+
- test/simple_cartesian/tc_multi_line_string.rb
|
364
|
+
- test/simple_cartesian/tc_multi_point.rb
|
365
|
+
- test/simple_cartesian/tc_multi_polygon.rb
|
366
|
+
- test/simple_cartesian/tc_point.rb
|
367
|
+
- test/simple_cartesian/tc_polygon.rb
|
368
|
+
- test/simple_mercator/tc_geometry_collection.rb
|
369
|
+
- test/simple_mercator/tc_line_string.rb
|
370
|
+
- test/simple_mercator/tc_multi_line_string.rb
|
371
|
+
- test/simple_mercator/tc_multi_point.rb
|
372
|
+
- test/simple_mercator/tc_multi_polygon.rb
|
373
|
+
- test/simple_mercator/tc_point.rb
|
374
|
+
- test/simple_mercator/tc_polygon.rb
|
375
|
+
- test/simple_mercator/tc_window.rb
|
376
|
+
- test/spherical_geography/tc_calculations.rb
|
377
|
+
- test/spherical_geography/tc_geometry_collection.rb
|
378
|
+
- test/spherical_geography/tc_line_string.rb
|
379
|
+
- test/spherical_geography/tc_multi_line_string.rb
|
380
|
+
- test/spherical_geography/tc_multi_point.rb
|
381
|
+
- test/spherical_geography/tc_multi_polygon.rb
|
382
|
+
- test/spherical_geography/tc_point.rb
|
383
|
+
- test/spherical_geography/tc_polygon.rb
|
384
|
+
- test/tc_cartesian_analysis.rb
|
385
|
+
- test/tc_geojson.rb
|
386
|
+
- test/tc_oneoff.rb
|
387
|
+
- test/wkrep/tc_wkb_generator.rb
|
388
|
+
- test/wkrep/tc_wkb_parser.rb
|
389
|
+
- test/wkrep/tc_wkt_generator.rb
|
390
|
+
- test/wkrep/tc_wkt_parser.rb
|
data/lib/rgeo/features/types.rb
DELETED
@@ -1,272 +0,0 @@
|
|
1
|
-
# -----------------------------------------------------------------------------
|
2
|
-
#
|
3
|
-
# Feature type management and casting
|
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
|
-
module RGeo
|
38
|
-
|
39
|
-
module Features
|
40
|
-
|
41
|
-
|
42
|
-
# These methods are available as module methods (not instance methods)
|
43
|
-
# of the various feature types.
|
44
|
-
# For example, you may determine whether a feature object is a
|
45
|
-
# point by calling:
|
46
|
-
#
|
47
|
-
# ::RGeo::Features::Point.check_type(object)
|
48
|
-
#
|
49
|
-
# A corresponding === operator is provided so you can use the type
|
50
|
-
# modules in a case-when clause.
|
51
|
-
#
|
52
|
-
# You may also use the presence of this module to determine whether
|
53
|
-
# a particular object is a feature type:
|
54
|
-
#
|
55
|
-
# object.kind_of?(::RGeo::Features::Type)
|
56
|
-
|
57
|
-
module Type
|
58
|
-
|
59
|
-
|
60
|
-
# All geometry implementations MUST include this submodule.
|
61
|
-
# This serves as a marker that may be used to test an object for
|
62
|
-
# feature-ness.
|
63
|
-
|
64
|
-
module Instance
|
65
|
-
end
|
66
|
-
|
67
|
-
|
68
|
-
# Returns true if the given object is this type or a subtype
|
69
|
-
# thereof, or if it is a feature object whose geometry_type is
|
70
|
-
# this type or a subtype thereof.
|
71
|
-
#
|
72
|
-
# Note that feature objects need not actually include this module.
|
73
|
-
|
74
|
-
def check_type(rhs_)
|
75
|
-
rhs_ = rhs_.geometry_type if rhs_.kind_of?(Instance)
|
76
|
-
rhs_.kind_of?(Type) && (rhs_ == self || rhs_.include?(self))
|
77
|
-
end
|
78
|
-
alias_method :===, :check_type
|
79
|
-
|
80
|
-
|
81
|
-
# Returns true if this type is the same type or a subtype of the
|
82
|
-
# given type.
|
83
|
-
|
84
|
-
def subtype_of?(type_)
|
85
|
-
self == type_ || self.include?(type_)
|
86
|
-
end
|
87
|
-
|
88
|
-
|
89
|
-
# Returns the OpenGIS type name of this type.
|
90
|
-
|
91
|
-
def type_name
|
92
|
-
self.name.sub('RGeo::Features::', '')
|
93
|
-
end
|
94
|
-
|
95
|
-
|
96
|
-
end
|
97
|
-
|
98
|
-
|
99
|
-
class << self
|
100
|
-
|
101
|
-
|
102
|
-
# Cast the given object according to the given parameters.
|
103
|
-
#
|
104
|
-
# You may optionally pass a factory, a feature type, the value
|
105
|
-
# <tt>:force_new</tt>, and the value <tt>:keep_subtype</tt> as the
|
106
|
-
# parameters. You may also pass the parameters as a hash, with the
|
107
|
-
# keys <tt>:factory</tt>, <tt>:type</tt>, <tt>:force_new</tt> and
|
108
|
-
# <tt>:keep_subtype</tt>.
|
109
|
-
#
|
110
|
-
# The given object will be casted into the given factory and
|
111
|
-
# feature type, if possible.
|
112
|
-
# If the cast is not possible to accomplish, nil is returned.
|
113
|
-
# If the factory or type is not provided, or is the same as the
|
114
|
-
# object's current attribute, that attribute is not modified.
|
115
|
-
#
|
116
|
-
# Normally, casting to a particular type always casts strictly to
|
117
|
-
# that type, even if the old type is a subtype of the new type.
|
118
|
-
# You can cause cast to retain the subtype by passing
|
119
|
-
# <tt>:keep_subtype</tt> as one of the parameters. For example,
|
120
|
-
# casting a LinearRing to a LineString will normally yield a
|
121
|
-
# LineString. However, if you specify <tt>:keep_subtype</tt>, the
|
122
|
-
# casted object will remain a LinearRing. You cannot cast to a
|
123
|
-
# non-instantiable type (such as Curve) without specifying
|
124
|
-
# <tt>:keep_subtype</tt>.
|
125
|
-
#
|
126
|
-
# Normally, if neither the factory nor the type are set to be
|
127
|
-
# modified, the original object is returned. However, you may cause
|
128
|
-
# cast to return a duplicate of the original object by passing
|
129
|
-
# <tt>:force_new</tt> as one of the parameters. This effectively
|
130
|
-
# forces cast always to return either a new object or nil.
|
131
|
-
#
|
132
|
-
# RGeo provides a default casting algorithm. Individual feature
|
133
|
-
# implementation factories may override this and customize the
|
134
|
-
# casting behavior by defining the override_cast method. See
|
135
|
-
# ::RGeo::Features::Factory#override_cast for more details.
|
136
|
-
|
137
|
-
def cast(obj_, *params_)
|
138
|
-
# Interpret params
|
139
|
-
nfactory_ = factory_ = obj_.factory
|
140
|
-
ntype_ = type_ = obj_.geometry_type
|
141
|
-
force_new_ = nil
|
142
|
-
keep_subtype_ = nil
|
143
|
-
params_.each do |param_|
|
144
|
-
case param_
|
145
|
-
when Factory::Instance
|
146
|
-
nfactory_ = param_
|
147
|
-
when Geometry
|
148
|
-
ntype_ = param_
|
149
|
-
when :force_new
|
150
|
-
force_new_ = param_
|
151
|
-
when :keep_subtype
|
152
|
-
keep_subtype_ = param_
|
153
|
-
when ::Hash
|
154
|
-
nfactory_ = param_[:factory] || nfactory_
|
155
|
-
ntype_ = param_[:type] || ntype_
|
156
|
-
force_new_ = param_[:force_new] if param_.include?(:force_new)
|
157
|
-
keep_subtype_ = param_[:keep_subtype] if param_.include?(:keep_subtype)
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
# Let the factory override
|
162
|
-
if nfactory_.respond_to?(:override_cast)
|
163
|
-
override_ = nfactory_.override_cast(obj_, ntype_, :keep_subtype => keep_subtype_, :force_new => force_new_)
|
164
|
-
return override_ unless override_ == false
|
165
|
-
end
|
166
|
-
|
167
|
-
# Default algorithm
|
168
|
-
ntype_ = type_ if keep_subtype_ && type_.include?(ntype_)
|
169
|
-
if nfactory_ == factory_ && ntype_ == type_
|
170
|
-
force_new_ ? obj_.dup : obj_
|
171
|
-
elsif ntype_ == type_
|
172
|
-
if type_ == Point
|
173
|
-
extra_ = []
|
174
|
-
if nfactory_.has_capability?(:z_coordinate)
|
175
|
-
extra_ << (factory_.has_capability?(:z_coordinate) ? obj_.z : 0.0)
|
176
|
-
end
|
177
|
-
if nfactory_.has_capability?(:m_coordinate)
|
178
|
-
extra_ << (factory_.has_capability?(:m_coordinate) ? obj_.m : 0.0)
|
179
|
-
end
|
180
|
-
nfactory_.point(obj_.x, obj_.y, *extra_)
|
181
|
-
elsif type_ == Line
|
182
|
-
nfactory_.line(obj_.start_point, obj_.end_point)
|
183
|
-
elsif type_ == LinearRing
|
184
|
-
nfactory_.linear_ring(obj_.points)
|
185
|
-
elsif type_ == LineString
|
186
|
-
nfactory_.line_string(obj_.points)
|
187
|
-
elsif type_ == Polygon
|
188
|
-
nfactory_.polygon(obj_.exterior_ring, obj_.interior_rings)
|
189
|
-
elsif type_ == MultiPoint
|
190
|
-
nfactory_.multi_point(obj_)
|
191
|
-
elsif type_ == MultiLineString
|
192
|
-
nfactory_.multi_line_string(obj_)
|
193
|
-
elsif type_ == MultiPolygon
|
194
|
-
nfactory_.multi_polygon(obj_)
|
195
|
-
elsif type_ == GeometryCollection
|
196
|
-
nfactory_.collection(obj_)
|
197
|
-
else
|
198
|
-
nil
|
199
|
-
end
|
200
|
-
else
|
201
|
-
if ntype_ == Point && (type_ == MultiPoint || type_ == GeometryCollection) ||
|
202
|
-
(ntype_ == Line || ntype_ == LineString || ntype_ == LinearRing) && (type_ == MultiLineString || type_ == GeometryCollection) ||
|
203
|
-
ntype_ == Polygon && (type_ == MultiPolygon || type_ == GeometryCollection)
|
204
|
-
then
|
205
|
-
if obj_.num_geometries == 1
|
206
|
-
cast(obj_.geometry_n(0), nfactory_, ntype_, keep_subtype_, force_new_)
|
207
|
-
else
|
208
|
-
nil
|
209
|
-
end
|
210
|
-
elsif ntype_ == Point
|
211
|
-
nil
|
212
|
-
elsif ntype_ == Line
|
213
|
-
if type_ == LineString && obj_.num_points == 2
|
214
|
-
nfactory_.line(obj_.point_n(0), obj_.point_n(1))
|
215
|
-
else
|
216
|
-
nil
|
217
|
-
end
|
218
|
-
elsif ntype_ == LinearRing
|
219
|
-
if type_ == LineString
|
220
|
-
nfactory_.linear_ring(obj_.points)
|
221
|
-
else
|
222
|
-
nil
|
223
|
-
end
|
224
|
-
elsif ntype_ == LineString
|
225
|
-
if type_ == Line || type_ == LinearRing
|
226
|
-
nfactory_.line_string(obj_.points)
|
227
|
-
else
|
228
|
-
nil
|
229
|
-
end
|
230
|
-
elsif ntype_ == MultiPoint
|
231
|
-
if type_ == Point
|
232
|
-
nfactory_.multi_point([obj_])
|
233
|
-
elsif type_ == GeometryCollection
|
234
|
-
nfactory_.multi_point(obj_)
|
235
|
-
else
|
236
|
-
nil
|
237
|
-
end
|
238
|
-
elsif ntype_ == MultiLineString
|
239
|
-
if type_ == Line || type_ == LinearRing || type_ == LineString
|
240
|
-
nfactory_.multi_line_string([obj_])
|
241
|
-
elsif type_ == GeometryCollection
|
242
|
-
nfactory_.multi_line_string(obj_)
|
243
|
-
else
|
244
|
-
nil
|
245
|
-
end
|
246
|
-
elsif ntype_ == MultiPolygon
|
247
|
-
if type_ == Polygon
|
248
|
-
nfactory_.multi_polygon([obj_])
|
249
|
-
elsif type_ == GeometryCollection
|
250
|
-
nfactory_.multi_polygon(obj_)
|
251
|
-
else
|
252
|
-
nil
|
253
|
-
end
|
254
|
-
elsif ntype_ == GeometryCollection
|
255
|
-
if type_ == MultiPoint || type_ == MultiLineString || type_ == MultiPolygon
|
256
|
-
nfactory_.collection(obj_)
|
257
|
-
else
|
258
|
-
nfactory_.collection([obj_])
|
259
|
-
end
|
260
|
-
else
|
261
|
-
nil
|
262
|
-
end
|
263
|
-
end
|
264
|
-
end
|
265
|
-
|
266
|
-
|
267
|
-
end
|
268
|
-
|
269
|
-
|
270
|
-
end
|
271
|
-
|
272
|
-
end
|