rgeo 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +6 -0
- data/README.rdoc +10 -7
- data/Version +1 -1
- data/ext/geos_c_impl/extconf.rb +42 -34
- data/ext/geos_c_impl/factory.c +56 -39
- data/ext/geos_c_impl/factory.h +55 -45
- data/ext/geos_c_impl/geometry.c +137 -93
- data/ext/geos_c_impl/geometry_collection.c +67 -46
- data/ext/geos_c_impl/line_string.c +79 -54
- data/ext/geos_c_impl/point.c +37 -24
- data/ext/geos_c_impl/polygon.c +40 -25
- data/ext/proj4_c_impl/extconf.rb +44 -36
- data/lib/rgeo/coord_sys.rb +3 -1
- data/lib/rgeo/geos.rb +3 -1
- data/lib/rgeo/geos/impl_additions.rb +12 -10
- data/test/coord_sys/tc_proj4.rb +1 -1
- data/test/geos/tc_factory.rb +1 -1
- data/test/geos/tc_geometry_collection.rb +1 -1
- data/test/geos/tc_line_string.rb +1 -1
- data/test/geos/tc_misc.rb +1 -1
- data/test/geos/tc_multi_line_string.rb +1 -1
- data/test/geos/tc_multi_point.rb +1 -1
- data/test/geos/tc_multi_polygon.rb +1 -1
- data/test/geos/tc_point.rb +1 -1
- data/test/geos/tc_polygon.rb +1 -1
- data/test/geos/tc_zmfactory.rb +1 -1
- data/test/projected_geographic/tc_geometry_collection.rb +1 -1
- data/test/projected_geographic/tc_line_string.rb +1 -1
- data/test/projected_geographic/tc_multi_line_string.rb +1 -1
- data/test/projected_geographic/tc_multi_point.rb +1 -1
- data/test/projected_geographic/tc_multi_polygon.rb +1 -1
- data/test/projected_geographic/tc_point.rb +1 -1
- data/test/projected_geographic/tc_polygon.rb +1 -1
- data/test/simple_cartesian/tc_calculations.rb +1 -1
- data/test/tc_oneoff.rb +5 -5
- data/test/wkrep/tc_wkt_parser.rb +4 -4
- metadata +3 -3
data/ext/geos_c_impl/point.c
CHANGED
@@ -52,9 +52,9 @@ RGEO_BEGIN_C
|
|
52
52
|
static VALUE method_point_geometry_type(VALUE self)
|
53
53
|
{
|
54
54
|
VALUE result = Qnil;
|
55
|
-
|
56
|
-
if (
|
57
|
-
result =
|
55
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
56
|
+
if (self_data->geom) {
|
57
|
+
result = RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->feature_point;
|
58
58
|
}
|
59
59
|
return result;
|
60
60
|
}
|
@@ -63,12 +63,14 @@ static VALUE method_point_geometry_type(VALUE self)
|
|
63
63
|
static VALUE method_point_x(VALUE self)
|
64
64
|
{
|
65
65
|
VALUE result = Qnil;
|
66
|
-
|
66
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
67
|
+
const GEOSGeometry* self_geom = self_data->geom;
|
67
68
|
if (self_geom) {
|
68
|
-
|
69
|
+
GEOSContextHandle_t self_context = self_data->geos_context;
|
70
|
+
const GEOSCoordSequence* coord_seq = GEOSGeom_getCoordSeq_r(self_context, self_geom);
|
69
71
|
if (coord_seq) {
|
70
72
|
double val;
|
71
|
-
if (GEOSCoordSeq_getX_r(
|
73
|
+
if (GEOSCoordSeq_getX_r(self_context, coord_seq, 0, &val)) {
|
72
74
|
result = rb_float_new(val);
|
73
75
|
}
|
74
76
|
}
|
@@ -80,12 +82,14 @@ static VALUE method_point_x(VALUE self)
|
|
80
82
|
static VALUE method_point_y(VALUE self)
|
81
83
|
{
|
82
84
|
VALUE result = Qnil;
|
83
|
-
|
85
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
86
|
+
const GEOSGeometry* self_geom = self_data->geom;
|
84
87
|
if (self_geom) {
|
85
|
-
|
88
|
+
GEOSContextHandle_t self_context = self_data->geos_context;
|
89
|
+
const GEOSCoordSequence* coord_seq = GEOSGeom_getCoordSeq_r(self_context, self_geom);
|
86
90
|
if (coord_seq) {
|
87
91
|
double val;
|
88
|
-
if (GEOSCoordSeq_getY_r(
|
92
|
+
if (GEOSCoordSeq_getY_r(self_context, coord_seq, 0, &val)) {
|
89
93
|
result = rb_float_new(val);
|
90
94
|
}
|
91
95
|
}
|
@@ -97,13 +101,17 @@ static VALUE method_point_y(VALUE self)
|
|
97
101
|
static VALUE get_3d_point(VALUE self, int flag)
|
98
102
|
{
|
99
103
|
VALUE result = Qnil;
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
if (
|
104
|
-
|
105
|
-
|
106
|
-
|
104
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
105
|
+
const GEOSGeometry* self_geom = self_data->geom;
|
106
|
+
if (self_geom) {
|
107
|
+
if (RGEO_FACTORY_DATA_PTR(self_data->factory)->flags & flag) {
|
108
|
+
GEOSContextHandle_t self_context = self_data->geos_context;
|
109
|
+
const GEOSCoordSequence* coord_seq = GEOSGeom_getCoordSeq_r(self_context, self_geom);
|
110
|
+
if (coord_seq) {
|
111
|
+
double val;
|
112
|
+
if (GEOSCoordSeq_getZ_r(self_context, coord_seq, 0, &val)) {
|
113
|
+
result = rb_float_new(val);
|
114
|
+
}
|
107
115
|
}
|
108
116
|
}
|
109
117
|
}
|
@@ -127,7 +135,8 @@ static VALUE method_point_eql(VALUE self, VALUE rhs)
|
|
127
135
|
{
|
128
136
|
VALUE result = rgeo_geos_klasses_and_factories_eql(self, rhs);
|
129
137
|
if (RTEST(result)) {
|
130
|
-
|
138
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
139
|
+
result = rgeo_geos_coordseqs_eql(self_data->geos_context, self_data->geom, RGEO_GEOMETRY_DATA_PTR(rhs)->geom, RGEO_FACTORY_DATA_PTR(self_data->factory)->flags & RGEO_FACTORYFLAGS_SUPPORTS_Z_OR_M);
|
131
140
|
}
|
132
141
|
return result;
|
133
142
|
}
|
@@ -142,7 +151,9 @@ static VALUE cmethod_create(VALUE module, VALUE factory, VALUE x, VALUE y, VALUE
|
|
142
151
|
|
143
152
|
void rgeo_init_geos_point(RGeo_Globals* globals)
|
144
153
|
{
|
145
|
-
VALUE geos_point_class = rb_define_class_under(globals->geos_module, "PointImpl",
|
154
|
+
VALUE geos_point_class = rb_define_class_under(globals->geos_module, "PointImpl", globals->geos_geometry);
|
155
|
+
globals->geos_point = geos_point_class;
|
156
|
+
globals->feature_point = rb_const_get_at(globals->feature_module, rb_intern("Point"));
|
146
157
|
|
147
158
|
rb_define_module_function(geos_point_class, "create", cmethod_create, 4);
|
148
159
|
|
@@ -158,14 +169,16 @@ void rgeo_init_geos_point(RGeo_Globals* globals)
|
|
158
169
|
VALUE rgeo_create_geos_point(VALUE factory, double x, double y, double z)
|
159
170
|
{
|
160
171
|
VALUE result = Qnil;
|
161
|
-
|
172
|
+
RGeo_FactoryData* factory_data = RGEO_FACTORY_DATA_PTR(factory);
|
173
|
+
GEOSContextHandle_t context = factory_data->geos_context;
|
174
|
+
GEOSCoordSequence* coord_seq = GEOSCoordSeq_create_r(context, 1, 3);
|
162
175
|
if (coord_seq) {
|
163
|
-
if (GEOSCoordSeq_setX_r(
|
164
|
-
if (GEOSCoordSeq_setY_r(
|
165
|
-
if (GEOSCoordSeq_setZ_r(
|
166
|
-
GEOSGeometry* geom = GEOSGeom_createPoint_r(
|
176
|
+
if (GEOSCoordSeq_setX_r(context, coord_seq, 0, x)) {
|
177
|
+
if (GEOSCoordSeq_setY_r(context, coord_seq, 0, y)) {
|
178
|
+
if (GEOSCoordSeq_setZ_r(context, coord_seq, 0, z)) {
|
179
|
+
GEOSGeometry* geom = GEOSGeom_createPoint_r(context, coord_seq);
|
167
180
|
if (geom) {
|
168
|
-
result = rgeo_wrap_geos_geometry(factory, geom,
|
181
|
+
result = rgeo_wrap_geos_geometry(factory, geom, factory_data->globals->geos_point);
|
169
182
|
}
|
170
183
|
}
|
171
184
|
}
|
data/ext/geos_c_impl/polygon.c
CHANGED
@@ -54,7 +54,8 @@ static VALUE method_polygon_eql(VALUE self, VALUE rhs)
|
|
54
54
|
{
|
55
55
|
VALUE result = rgeo_geos_klasses_and_factories_eql(self, rhs);
|
56
56
|
if (RTEST(result)) {
|
57
|
-
|
57
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
58
|
+
result = rgeo_geos_polygons_eql(self_data->geos_context, self_data->geom, RGEO_GEOMETRY_DATA_PTR(rhs)->geom, RGEO_FACTORY_DATA_PTR(self_data->factory)->flags & RGEO_FACTORYFLAGS_SUPPORTS_Z_OR_M);
|
58
59
|
}
|
59
60
|
return result;
|
60
61
|
}
|
@@ -63,9 +64,9 @@ static VALUE method_polygon_eql(VALUE self, VALUE rhs)
|
|
63
64
|
static VALUE method_polygon_geometry_type(VALUE self)
|
64
65
|
{
|
65
66
|
VALUE result = Qnil;
|
66
|
-
|
67
|
-
if (
|
68
|
-
result =
|
67
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
68
|
+
if (self_data->geom) {
|
69
|
+
result = RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->feature_polygon;
|
69
70
|
}
|
70
71
|
return result;
|
71
72
|
}
|
@@ -74,10 +75,11 @@ static VALUE method_polygon_geometry_type(VALUE self)
|
|
74
75
|
static VALUE method_polygon_area(VALUE self)
|
75
76
|
{
|
76
77
|
VALUE result = Qnil;
|
77
|
-
|
78
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
79
|
+
const GEOSGeometry* self_geom = self_data->geom;
|
78
80
|
if (self_geom) {
|
79
81
|
double area;
|
80
|
-
if (GEOSArea_r(
|
82
|
+
if (GEOSArea_r(self_data->geos_context, self_geom, &area)) {
|
81
83
|
result = rb_float_new(area);
|
82
84
|
}
|
83
85
|
}
|
@@ -88,9 +90,10 @@ static VALUE method_polygon_area(VALUE self)
|
|
88
90
|
static VALUE method_polygon_centroid(VALUE self)
|
89
91
|
{
|
90
92
|
VALUE result = Qnil;
|
91
|
-
|
93
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
94
|
+
const GEOSGeometry* self_geom = self_data->geom;
|
92
95
|
if (self_geom) {
|
93
|
-
result = rgeo_wrap_geos_geometry(
|
96
|
+
result = rgeo_wrap_geos_geometry(self_data->factory, GEOSGetCentroid_r(self_data->geos_context, self_geom), RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->geos_point);
|
94
97
|
}
|
95
98
|
return result;
|
96
99
|
}
|
@@ -99,9 +102,10 @@ static VALUE method_polygon_centroid(VALUE self)
|
|
99
102
|
static VALUE method_polygon_point_on_surface(VALUE self)
|
100
103
|
{
|
101
104
|
VALUE result = Qnil;
|
102
|
-
|
105
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
106
|
+
const GEOSGeometry* self_geom = self_data->geom;
|
103
107
|
if (self_geom) {
|
104
|
-
result = rgeo_wrap_geos_geometry(
|
108
|
+
result = rgeo_wrap_geos_geometry(self_data->factory, GEOSPointOnSurface_r(self_data->geos_context, self_geom), RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->geos_point);
|
105
109
|
}
|
106
110
|
return result;
|
107
111
|
}
|
@@ -110,9 +114,10 @@ static VALUE method_polygon_point_on_surface(VALUE self)
|
|
110
114
|
static VALUE method_polygon_exterior_ring(VALUE self)
|
111
115
|
{
|
112
116
|
VALUE result = Qnil;
|
113
|
-
|
117
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
118
|
+
const GEOSGeometry* self_geom = self_data->geom;
|
114
119
|
if (self_geom) {
|
115
|
-
result = rgeo_wrap_geos_geometry_clone(
|
120
|
+
result = rgeo_wrap_geos_geometry_clone(self_data->factory, GEOSGetExteriorRing_r(self_data->geos_context, self_geom), RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->geos_linear_ring);
|
116
121
|
}
|
117
122
|
return result;
|
118
123
|
}
|
@@ -121,9 +126,10 @@ static VALUE method_polygon_exterior_ring(VALUE self)
|
|
121
126
|
static VALUE method_polygon_num_interior_rings(VALUE self)
|
122
127
|
{
|
123
128
|
VALUE result = Qnil;
|
124
|
-
|
129
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
130
|
+
const GEOSGeometry* self_geom = self_data->geom;
|
125
131
|
if (self_geom) {
|
126
|
-
int num = GEOSGetNumInteriorRings_r(
|
132
|
+
int num = GEOSGetNumInteriorRings_r(self_data->geos_context, self_geom);
|
127
133
|
if (num >= 0) {
|
128
134
|
result = INT2NUM(num);
|
129
135
|
}
|
@@ -135,9 +141,10 @@ static VALUE method_polygon_num_interior_rings(VALUE self)
|
|
135
141
|
static VALUE method_polygon_interior_ring_n(VALUE self, VALUE n)
|
136
142
|
{
|
137
143
|
VALUE result = Qnil;
|
138
|
-
|
144
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
145
|
+
const GEOSGeometry* self_geom = self_data->geom;
|
139
146
|
if (self_geom) {
|
140
|
-
result = rgeo_wrap_geos_geometry_clone(
|
147
|
+
result = rgeo_wrap_geos_geometry_clone(self_data->factory, GEOSGetInteriorRingN_r(self_data->geos_context, self_geom, NUM2INT(n)), RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->geos_linear_ring);
|
141
148
|
}
|
142
149
|
return result;
|
143
150
|
}
|
@@ -146,14 +153,18 @@ static VALUE method_polygon_interior_ring_n(VALUE self, VALUE n)
|
|
146
153
|
static VALUE method_polygon_interior_rings(VALUE self)
|
147
154
|
{
|
148
155
|
VALUE result = Qnil;
|
149
|
-
|
156
|
+
RGeo_GeometryData* self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
157
|
+
const GEOSGeometry* self_geom = self_data->geom;
|
150
158
|
if (self_geom) {
|
151
|
-
|
159
|
+
GEOSContextHandle_t self_context = self_data->geos_context;
|
160
|
+
int count = GEOSGetNumInteriorRings_r(self_context, self_geom);
|
152
161
|
if (count >= 0) {
|
153
162
|
result = rb_ary_new2(count);
|
163
|
+
VALUE factory = self_data->factory;
|
164
|
+
VALUE linear_ring_class = RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->geos_linear_ring;
|
154
165
|
int i;
|
155
166
|
for (i=0; i<count; ++i) {
|
156
|
-
rb_ary_store(result, i, rgeo_wrap_geos_geometry_clone(
|
167
|
+
rb_ary_store(result, i, rgeo_wrap_geos_geometry_clone(factory, GEOSGetInteriorRingN_r(self_context, self_geom, i), linear_ring_class));
|
157
168
|
}
|
158
169
|
}
|
159
170
|
}
|
@@ -164,9 +175,11 @@ static VALUE method_polygon_interior_rings(VALUE self)
|
|
164
175
|
static VALUE cmethod_create(VALUE module, VALUE factory, VALUE exterior, VALUE interior_array)
|
165
176
|
{
|
166
177
|
Check_Type(interior_array, T_ARRAY);
|
167
|
-
|
178
|
+
RGeo_FactoryData* factory_data = RGEO_FACTORY_DATA_PTR(factory);
|
179
|
+
VALUE linear_ring_type = factory_data->globals->feature_linear_ring;
|
168
180
|
GEOSGeometry* exterior_geom = rgeo_convert_to_detached_geos_geometry(exterior, factory, linear_ring_type, NULL);
|
169
181
|
if (exterior_geom) {
|
182
|
+
GEOSContextHandle_t context = factory_data->geos_context;
|
170
183
|
unsigned int len = (unsigned int)RARRAY_LEN(interior_array);
|
171
184
|
GEOSGeometry** interior_geoms = ALLOC_N(GEOSGeometry*, len == 0 ? 1 : len);
|
172
185
|
if (interior_geoms) {
|
@@ -179,18 +192,18 @@ static VALUE cmethod_create(VALUE module, VALUE factory, VALUE exterior, VALUE i
|
|
179
192
|
}
|
180
193
|
}
|
181
194
|
if (len == actual_len) {
|
182
|
-
GEOSGeometry* polygon = GEOSGeom_createPolygon_r(
|
195
|
+
GEOSGeometry* polygon = GEOSGeom_createPolygon_r(context, exterior_geom, interior_geoms, actual_len);
|
183
196
|
if (polygon) {
|
184
197
|
free(interior_geoms);
|
185
|
-
return rgeo_wrap_geos_geometry(factory, polygon,
|
198
|
+
return rgeo_wrap_geos_geometry(factory, polygon, factory_data->globals->geos_polygon);
|
186
199
|
}
|
187
200
|
}
|
188
201
|
for (i=0; i<actual_len; ++i) {
|
189
|
-
GEOSGeom_destroy_r(
|
202
|
+
GEOSGeom_destroy_r(context, interior_geoms[i]);
|
190
203
|
}
|
191
204
|
free(interior_geoms);
|
192
205
|
}
|
193
|
-
GEOSGeom_destroy_r(
|
206
|
+
GEOSGeom_destroy_r(context, exterior_geom);
|
194
207
|
}
|
195
208
|
return Qnil;
|
196
209
|
}
|
@@ -198,7 +211,9 @@ static VALUE cmethod_create(VALUE module, VALUE factory, VALUE exterior, VALUE i
|
|
198
211
|
|
199
212
|
void rgeo_init_geos_polygon(RGeo_Globals* globals)
|
200
213
|
{
|
201
|
-
VALUE geos_polygon_class = rb_define_class_under(globals->geos_module, "PolygonImpl",
|
214
|
+
VALUE geos_polygon_class = rb_define_class_under(globals->geos_module, "PolygonImpl", globals->geos_geometry);
|
215
|
+
globals->geos_polygon = geos_polygon_class;
|
216
|
+
globals->feature_polygon = rb_const_get_at(globals->feature_module, rb_intern("Polygon"));
|
202
217
|
|
203
218
|
rb_define_module_function(geos_polygon_class, "create", cmethod_create, 3);
|
204
219
|
|
data/ext/proj4_c_impl/extconf.rb
CHANGED
@@ -34,41 +34,49 @@
|
|
34
34
|
;
|
35
35
|
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
37
|
+
if ::RUBY_DESCRIPTION =~ /^jruby\s/
|
38
|
+
|
39
|
+
::File.open('Makefile', 'w'){ |f_| f_.write(".PHONY: install\ninstall:\n") }
|
40
|
+
|
41
|
+
else
|
42
|
+
|
43
|
+
require 'mkmf'
|
44
|
+
|
45
|
+
header_dirs_ =
|
46
|
+
[
|
47
|
+
'/usr/local/include',
|
48
|
+
'/usr/local/proj/include',
|
49
|
+
'/usr/local/proj4/include',
|
50
|
+
'/opt/local/include',
|
51
|
+
::Config::CONFIG['includedir'],
|
52
|
+
'/usr/include',
|
53
|
+
]
|
54
|
+
lib_dirs_ =
|
55
|
+
[
|
56
|
+
'/usr/local/lib',
|
57
|
+
'/usr/local/proj/lib',
|
58
|
+
'/usr/local/proj4/lib',
|
59
|
+
'/opt/local/lib',
|
60
|
+
::Config::CONFIG['libdir'],
|
61
|
+
'/usr/lib',
|
62
|
+
]
|
63
|
+
header_dirs_.delete_if{ |path_| !::File.directory?(path_) }
|
64
|
+
lib_dirs_.delete_if{ |path_| !::File.directory?(path_) }
|
65
|
+
|
66
|
+
found_proj_ = false
|
67
|
+
header_dirs_, lib_dirs_ = dir_config('proj', header_dirs_, lib_dirs_)
|
68
|
+
if have_header('proj_api.h')
|
69
|
+
$libs << ' -lproj'
|
70
|
+
if have_func('pj_init_plus', 'proj_api.h')
|
71
|
+
found_proj_ = true
|
72
|
+
else
|
73
|
+
$libs.gsub!(' -lproj', '')
|
74
|
+
end
|
68
75
|
end
|
76
|
+
unless found_proj_
|
77
|
+
puts "**** WARNING: Unable to find Proj headers or Proj version is too old."
|
78
|
+
puts "**** Compiling without Proj support."
|
79
|
+
end
|
80
|
+
create_makefile('rgeo/coord_sys/proj4_c_impl')
|
81
|
+
|
69
82
|
end
|
70
|
-
unless found_proj_
|
71
|
-
puts "**** WARNING: Unable to find Proj headers or Proj version is too old."
|
72
|
-
puts "**** Compiling without Proj support."
|
73
|
-
end
|
74
|
-
create_makefile('rgeo/coord_sys/proj4_c_impl')
|
data/lib/rgeo/coord_sys.rb
CHANGED
data/lib/rgeo/geos.rb
CHANGED
@@ -64,7 +64,9 @@ end
|
|
64
64
|
# Implementation files
|
65
65
|
require 'rgeo/geos/factory'
|
66
66
|
require 'rgeo/geos/interface'
|
67
|
-
|
67
|
+
begin
|
68
|
+
require 'rgeo/geos/geos_c_impl'
|
69
|
+
rescue ::LoadError; end
|
68
70
|
require 'rgeo/geos/impl_additions'
|
69
71
|
require 'rgeo/geos/zm_factory'
|
70
72
|
require 'rgeo/geos/zm_impl'
|
@@ -53,16 +53,18 @@ module RGeo
|
|
53
53
|
|
54
54
|
|
55
55
|
# :stopdoc:
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
56
|
+
if ::RGeo::Geos.supported?
|
57
|
+
IMPL_CLASSES = {
|
58
|
+
Feature::Point => PointImpl,
|
59
|
+
Feature::LineString => LineStringImpl,
|
60
|
+
Feature::LinearRing => LinearRingImpl,
|
61
|
+
Feature::Line => LineImpl,
|
62
|
+
Feature::GeometryCollection => GeometryCollectionImpl,
|
63
|
+
Feature::MultiPoint => MultiPointImpl,
|
64
|
+
Feature::MultiLineString => MultiLineStringImpl,
|
65
|
+
Feature::MultiPolygon => MultiPolygonImpl,
|
66
|
+
}
|
67
|
+
end
|
66
68
|
# :startdoc:
|
67
69
|
|
68
70
|
|
data/test/coord_sys/tc_proj4.rb
CHANGED
data/test/geos/tc_factory.rb
CHANGED
data/test/geos/tc_line_string.rb
CHANGED