rgeo 2.3.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/geos_c_impl/analysis.c +4 -2
- data/ext/geos_c_impl/analysis.h +1 -3
- data/ext/geos_c_impl/errors.c +2 -2
- data/ext/geos_c_impl/extconf.rb +1 -0
- data/ext/geos_c_impl/factory.c +167 -170
- data/ext/geos_c_impl/factory.h +15 -48
- data/ext/geos_c_impl/geometry.c +8 -8
- data/ext/geos_c_impl/geometry.h +1 -3
- data/ext/geos_c_impl/geometry_collection.c +38 -43
- data/ext/geos_c_impl/geometry_collection.h +1 -3
- data/ext/geos_c_impl/globals.c +91 -0
- data/ext/geos_c_impl/globals.h +45 -0
- data/ext/geos_c_impl/line_string.c +25 -26
- data/ext/geos_c_impl/line_string.h +1 -3
- data/ext/geos_c_impl/main.c +10 -9
- data/ext/geos_c_impl/point.c +8 -7
- data/ext/geos_c_impl/point.h +1 -3
- data/ext/geos_c_impl/polygon.c +14 -14
- data/ext/geos_c_impl/polygon.h +1 -3
- data/ext/geos_c_impl/preface.h +5 -0
- data/lib/rgeo/version.rb +1 -1
- metadata +8 -6
@@ -11,6 +11,8 @@
|
|
11
11
|
#include <ruby.h>
|
12
12
|
#include <geos_c.h>
|
13
13
|
|
14
|
+
#include "globals.h"
|
15
|
+
|
14
16
|
#include "factory.h"
|
15
17
|
#include "geometry.h"
|
16
18
|
#include "point.h"
|
@@ -29,7 +31,7 @@ static VALUE method_line_string_geometry_type(VALUE self)
|
|
29
31
|
result = Qnil;
|
30
32
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
31
33
|
if (self_data->geom) {
|
32
|
-
result =
|
34
|
+
result = rgeo_feature_line_string_module;
|
33
35
|
}
|
34
36
|
return result;
|
35
37
|
}
|
@@ -43,7 +45,7 @@ static VALUE method_linear_ring_geometry_type(VALUE self)
|
|
43
45
|
result = Qnil;
|
44
46
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
45
47
|
if (self_data->geom) {
|
46
|
-
result =
|
48
|
+
result = rgeo_feature_linear_ring_module;
|
47
49
|
}
|
48
50
|
return result;
|
49
51
|
}
|
@@ -57,7 +59,7 @@ static VALUE method_line_geometry_type(VALUE self)
|
|
57
59
|
result = Qnil;
|
58
60
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
59
61
|
if (self_data->geom) {
|
60
|
-
result =
|
62
|
+
result = rgeo_feature_line_module;
|
61
63
|
}
|
62
64
|
return result;
|
63
65
|
}
|
@@ -264,7 +266,7 @@ static VALUE method_line_string_project_point(VALUE self, VALUE point)
|
|
264
266
|
factory_data = RGEO_FACTORY_DATA_PTR(factory);
|
265
267
|
|
266
268
|
if(self_geom && point) {
|
267
|
-
geos_point = rgeo_convert_to_geos_geometry(factory, point,
|
269
|
+
geos_point = rgeo_convert_to_geos_geometry(factory, point, rgeo_geos_point_class);
|
268
270
|
location = GEOSProject_r(self_data->geos_context, self_geom, geos_point);
|
269
271
|
result = DBL2NUM(location);
|
270
272
|
}
|
@@ -290,7 +292,7 @@ static VALUE method_line_string_interpolate_point(VALUE self, VALUE loc_num)
|
|
290
292
|
|
291
293
|
if(self_geom) {
|
292
294
|
geos_point = GEOSInterpolate_r(self_data->geos_context, self_geom, location);
|
293
|
-
result = rgeo_wrap_geos_geometry(factory, geos_point,
|
295
|
+
result = rgeo_wrap_geos_geometry(factory, geos_point, rgeo_geos_point_class);
|
294
296
|
}
|
295
297
|
|
296
298
|
return result;
|
@@ -358,8 +360,7 @@ static VALUE method_line_string_hash(VALUE self)
|
|
358
360
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
359
361
|
factory = self_data->factory;
|
360
362
|
hash = rb_hash_start(0);
|
361
|
-
hash = rgeo_geos_objbase_hash(factory,
|
362
|
-
RGEO_FACTORY_DATA_PTR(factory)->globals->feature_line_string, hash);
|
363
|
+
hash = rgeo_geos_objbase_hash(factory, rgeo_feature_line_string_module, hash);
|
363
364
|
hash = rgeo_geos_coordseq_hash(self_data->geos_context, self_data->geom, hash);
|
364
365
|
return LONG2FIX(rb_hash_end(hash));
|
365
366
|
}
|
@@ -374,8 +375,7 @@ static VALUE method_linear_ring_hash(VALUE self)
|
|
374
375
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
375
376
|
factory = self_data->factory;
|
376
377
|
hash = rb_hash_start(0);
|
377
|
-
hash = rgeo_geos_objbase_hash(factory,
|
378
|
-
RGEO_FACTORY_DATA_PTR(factory)->globals->feature_linear_ring, hash);
|
378
|
+
hash = rgeo_geos_objbase_hash(factory, rgeo_feature_linear_ring_module, hash);
|
379
379
|
hash = rgeo_geos_coordseq_hash(self_data->geos_context, self_data->geom, hash);
|
380
380
|
return LONG2FIX(rb_hash_end(hash));
|
381
381
|
}
|
@@ -390,8 +390,7 @@ static VALUE method_line_hash(VALUE self)
|
|
390
390
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
391
391
|
factory = self_data->factory;
|
392
392
|
hash = rb_hash_start(0);
|
393
|
-
hash = rgeo_geos_objbase_hash(factory,
|
394
|
-
RGEO_FACTORY_DATA_PTR(factory)->globals->feature_line, hash);
|
393
|
+
hash = rgeo_geos_objbase_hash(factory, rgeo_feature_line_module, hash);
|
395
394
|
hash = rgeo_geos_coordseq_hash(self_data->geos_context, self_data->geom, hash);
|
396
395
|
return LONG2FIX(rb_hash_end(hash));
|
397
396
|
}
|
@@ -415,7 +414,7 @@ static GEOSCoordSequence* coord_seq_from_array(VALUE factory, VALUE array, char
|
|
415
414
|
|
416
415
|
Check_Type(array, T_ARRAY);
|
417
416
|
factory_data = RGEO_FACTORY_DATA_PTR(factory);
|
418
|
-
point_type =
|
417
|
+
point_type = rgeo_feature_point_module;
|
419
418
|
len = (unsigned int)RARRAY_LEN(array);
|
420
419
|
has_z = (char)(RGEO_FACTORY_DATA_PTR(factory)->flags & RGEO_FACTORYFLAGS_SUPPORTS_Z_OR_M);
|
421
420
|
dims = has_z ? 3 : 2;
|
@@ -491,7 +490,7 @@ static VALUE cmethod_create_line_string(VALUE module, VALUE factory, VALUE array
|
|
491
490
|
factory_data = RGEO_FACTORY_DATA_PTR(factory);
|
492
491
|
geom = GEOSGeom_createLineString_r(factory_data->geos_context, coord_seq);
|
493
492
|
if (geom) {
|
494
|
-
result = rgeo_wrap_geos_geometry(factory, geom,
|
493
|
+
result = rgeo_wrap_geos_geometry(factory, geom, rgeo_geos_line_string_class);
|
495
494
|
}
|
496
495
|
}
|
497
496
|
return result;
|
@@ -511,7 +510,7 @@ static VALUE cmethod_create_linear_ring(VALUE module, VALUE factory, VALUE array
|
|
511
510
|
factory_data = RGEO_FACTORY_DATA_PTR(factory);
|
512
511
|
geom = GEOSGeom_createLinearRing_r(factory_data->geos_context, coord_seq);
|
513
512
|
if (geom) {
|
514
|
-
result = rgeo_wrap_geos_geometry(factory, geom,
|
513
|
+
result = rgeo_wrap_geos_geometry(factory, geom, rgeo_geos_linear_ring_class);
|
515
514
|
}
|
516
515
|
}
|
517
516
|
return result;
|
@@ -557,7 +556,7 @@ static VALUE cmethod_create_line(VALUE module, VALUE factory, VALUE start, VALUE
|
|
557
556
|
result = Qnil;
|
558
557
|
factory_data = RGEO_FACTORY_DATA_PTR(factory);
|
559
558
|
has_z = (char)(factory_data->flags & RGEO_FACTORYFLAGS_SUPPORTS_Z_OR_M);
|
560
|
-
point_type =
|
559
|
+
point_type = rgeo_feature_point_module;
|
561
560
|
context = factory_data->geos_context;
|
562
561
|
|
563
562
|
start_geom = rgeo_convert_to_geos_geometry(factory, start, point_type);
|
@@ -570,7 +569,7 @@ static VALUE cmethod_create_line(VALUE module, VALUE factory, VALUE start, VALUE
|
|
570
569
|
populate_geom_into_coord_seq(context, end_geom, coord_seq, 1, has_z);
|
571
570
|
geom = GEOSGeom_createLineString_r(context, coord_seq);
|
572
571
|
if (geom) {
|
573
|
-
result = rgeo_wrap_geos_geometry(factory, geom,
|
572
|
+
result = rgeo_wrap_geos_geometry(factory, geom, rgeo_geos_line_class);
|
574
573
|
}
|
575
574
|
}
|
576
575
|
}
|
@@ -631,26 +630,26 @@ static VALUE cmethod_linear_ring_copy_from(VALUE klass, VALUE factory, VALUE ori
|
|
631
630
|
}
|
632
631
|
|
633
632
|
|
634
|
-
void rgeo_init_geos_line_string(
|
633
|
+
void rgeo_init_geos_line_string()
|
635
634
|
{
|
636
635
|
VALUE geos_line_string_methods;
|
637
636
|
VALUE geos_linear_ring_methods;
|
638
637
|
VALUE geos_line_methods;
|
639
638
|
|
640
639
|
// Class methods for CAPILineStringImpl
|
641
|
-
rb_define_module_function(
|
642
|
-
rb_define_module_function(
|
640
|
+
rb_define_module_function(rgeo_geos_line_string_class, "create", cmethod_create_line_string, 2);
|
641
|
+
rb_define_module_function(rgeo_geos_line_string_class, "_copy_from", cmethod_line_string_copy_from, 2);
|
643
642
|
|
644
643
|
// Class methods for CAPILinearRingImpl
|
645
|
-
rb_define_module_function(
|
646
|
-
rb_define_module_function(
|
644
|
+
rb_define_module_function(rgeo_geos_linear_ring_class, "create", cmethod_create_linear_ring, 2);
|
645
|
+
rb_define_module_function(rgeo_geos_linear_ring_class, "_copy_from", cmethod_linear_ring_copy_from, 2);
|
647
646
|
|
648
647
|
// Class methods for CAPILineImpl
|
649
|
-
rb_define_module_function(
|
650
|
-
rb_define_module_function(
|
648
|
+
rb_define_module_function(rgeo_geos_line_class, "create", cmethod_create_line, 3);
|
649
|
+
rb_define_module_function(rgeo_geos_line_class, "_copy_from", cmethod_line_copy_from, 2);
|
651
650
|
|
652
651
|
// CAPILineStringMethods module
|
653
|
-
geos_line_string_methods = rb_define_module_under(
|
652
|
+
geos_line_string_methods = rb_define_module_under(rgeo_geos_module, "CAPILineStringMethods");
|
654
653
|
rb_define_method(geos_line_string_methods, "rep_equals?", method_line_string_eql, 1);
|
655
654
|
rb_define_method(geos_line_string_methods, "eql?", method_line_string_eql, 1);
|
656
655
|
rb_define_method(geos_line_string_methods, "hash", method_line_string_hash, 0);
|
@@ -668,12 +667,12 @@ void rgeo_init_geos_line_string(RGeo_Globals* globals)
|
|
668
667
|
rb_define_method(geos_line_string_methods, "coordinates", method_line_string_coordinates, 0);
|
669
668
|
|
670
669
|
// CAPILinearRingMethods module
|
671
|
-
geos_linear_ring_methods = rb_define_module_under(
|
670
|
+
geos_linear_ring_methods = rb_define_module_under(rgeo_geos_module, "CAPILinearRingMethods");
|
672
671
|
rb_define_method(geos_linear_ring_methods, "geometry_type", method_linear_ring_geometry_type, 0);
|
673
672
|
rb_define_method(geos_linear_ring_methods, "hash", method_linear_ring_hash, 0);
|
674
673
|
|
675
674
|
// CAPILineMethods module
|
676
|
-
geos_line_methods = rb_define_module_under(
|
675
|
+
geos_line_methods = rb_define_module_under(rgeo_geos_module, "CAPILineMethods");
|
677
676
|
rb_define_method(geos_line_methods, "geometry_type", method_line_geometry_type, 0);
|
678
677
|
rb_define_method(geos_line_methods, "hash", method_line_hash, 0);
|
679
678
|
}
|
@@ -9,8 +9,6 @@
|
|
9
9
|
#include <ruby.h>
|
10
10
|
#include <geos_c.h>
|
11
11
|
|
12
|
-
#include "factory.h"
|
13
|
-
|
14
12
|
RGEO_BEGIN_C
|
15
13
|
|
16
14
|
|
@@ -18,7 +16,7 @@ RGEO_BEGIN_C
|
|
18
16
|
Initializes the line string module. This should be called after
|
19
17
|
the geometry module is initialized.
|
20
18
|
*/
|
21
|
-
void rgeo_init_geos_line_string(
|
19
|
+
void rgeo_init_geos_line_string();
|
22
20
|
|
23
21
|
/*
|
24
22
|
Determines whether the given GEOS line string is closed.
|
data/ext/geos_c_impl/main.c
CHANGED
@@ -9,6 +9,8 @@
|
|
9
9
|
#include <ruby.h>
|
10
10
|
#include <geos_c.h>
|
11
11
|
|
12
|
+
#include "globals.h"
|
13
|
+
|
12
14
|
#include "errors.h"
|
13
15
|
|
14
16
|
#include "factory.h"
|
@@ -26,15 +28,14 @@ RGEO_BEGIN_C
|
|
26
28
|
void Init_geos_c_impl()
|
27
29
|
{
|
28
30
|
#ifdef RGEO_GEOS_SUPPORTED
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
rgeo_init_geos_analysis(globals);
|
31
|
+
rgeo_init_geos_globals();
|
32
|
+
rgeo_init_geos_factory();
|
33
|
+
rgeo_init_geos_geometry();
|
34
|
+
rgeo_init_geos_point();
|
35
|
+
rgeo_init_geos_line_string();
|
36
|
+
rgeo_init_geos_polygon();
|
37
|
+
rgeo_init_geos_geometry_collection();
|
38
|
+
rgeo_init_geos_analysis();
|
38
39
|
rgeo_init_geos_errors();
|
39
40
|
#endif
|
40
41
|
}
|
data/ext/geos_c_impl/point.c
CHANGED
@@ -9,6 +9,8 @@
|
|
9
9
|
#include <ruby.h>
|
10
10
|
#include <geos_c.h>
|
11
11
|
|
12
|
+
#include "globals.h"
|
13
|
+
|
12
14
|
#include "factory.h"
|
13
15
|
#include "geometry.h"
|
14
16
|
#include "point.h"
|
@@ -26,7 +28,7 @@ static VALUE method_point_geometry_type(VALUE self)
|
|
26
28
|
result = Qnil;
|
27
29
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
28
30
|
if (self_data->geom) {
|
29
|
-
result =
|
31
|
+
result = rgeo_feature_point_module;
|
30
32
|
}
|
31
33
|
return result;
|
32
34
|
}
|
@@ -168,8 +170,7 @@ static VALUE method_point_hash(VALUE self)
|
|
168
170
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
169
171
|
factory = self_data->factory;
|
170
172
|
hash = rb_hash_start(0);
|
171
|
-
hash = rgeo_geos_objbase_hash(factory,
|
172
|
-
RGEO_FACTORY_DATA_PTR(factory)->globals->feature_point, hash);
|
173
|
+
hash = rgeo_geos_objbase_hash(factory, rgeo_feature_point_module, hash);
|
173
174
|
hash = rgeo_geos_coordseq_hash(self_data->geos_context, self_data->geom, hash);
|
174
175
|
return LONG2FIX(rb_hash_end(hash));
|
175
176
|
}
|
@@ -182,15 +183,15 @@ static VALUE cmethod_create(VALUE module, VALUE factory, VALUE x, VALUE y, VALUE
|
|
182
183
|
}
|
183
184
|
|
184
185
|
|
185
|
-
void rgeo_init_geos_point(
|
186
|
+
void rgeo_init_geos_point()
|
186
187
|
{
|
187
188
|
VALUE geos_point_methods;
|
188
189
|
|
189
190
|
// Class methods for CAPIPointImpl
|
190
|
-
rb_define_module_function(
|
191
|
+
rb_define_module_function(rgeo_geos_point_class, "create", cmethod_create, 4);
|
191
192
|
|
192
193
|
// CAPIPointMethods module
|
193
|
-
geos_point_methods = rb_define_module_under(
|
194
|
+
geos_point_methods = rb_define_module_under(rgeo_geos_module, "CAPIPointMethods");
|
194
195
|
rb_define_method(geos_point_methods, "rep_equals?", method_point_eql, 1);
|
195
196
|
rb_define_method(geos_point_methods, "eql?", method_point_eql, 1);
|
196
197
|
rb_define_method(geos_point_methods, "hash", method_point_hash, 0);
|
@@ -221,7 +222,7 @@ VALUE rgeo_create_geos_point(VALUE factory, double x, double y, double z)
|
|
221
222
|
if (GEOSCoordSeq_setZ_r(context, coord_seq, 0, z)) {
|
222
223
|
geom = GEOSGeom_createPoint_r(context, coord_seq);
|
223
224
|
if (geom) {
|
224
|
-
result = rgeo_wrap_geos_geometry(factory, geom,
|
225
|
+
result = rgeo_wrap_geos_geometry(factory, geom, rgeo_geos_point_class);
|
225
226
|
}
|
226
227
|
}
|
227
228
|
}
|
data/ext/geos_c_impl/point.h
CHANGED
@@ -8,8 +8,6 @@
|
|
8
8
|
|
9
9
|
#include <ruby.h>
|
10
10
|
|
11
|
-
#include "factory.h"
|
12
|
-
|
13
11
|
RGEO_BEGIN_C
|
14
12
|
|
15
13
|
|
@@ -17,7 +15,7 @@ RGEO_BEGIN_C
|
|
17
15
|
Initializes the point module. This should be called after
|
18
16
|
the geometry module is initialized.
|
19
17
|
*/
|
20
|
-
void rgeo_init_geos_point(
|
18
|
+
void rgeo_init_geos_point();
|
21
19
|
|
22
20
|
/*
|
23
21
|
Creates a 3d point and returns the ruby object.
|
data/ext/geos_c_impl/polygon.c
CHANGED
@@ -10,6 +10,8 @@
|
|
10
10
|
#include <ruby.h>
|
11
11
|
#include <geos_c.h>
|
12
12
|
|
13
|
+
#include "globals.h"
|
14
|
+
|
13
15
|
#include "factory.h"
|
14
16
|
#include "geometry.h"
|
15
17
|
#include "line_string.h"
|
@@ -43,8 +45,7 @@ static VALUE method_polygon_hash(VALUE self)
|
|
43
45
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
44
46
|
factory = self_data->factory;
|
45
47
|
hash = rb_hash_start(0);
|
46
|
-
hash = rgeo_geos_objbase_hash(factory,
|
47
|
-
RGEO_FACTORY_DATA_PTR(factory)->globals->feature_polygon, hash);
|
48
|
+
hash = rgeo_geos_objbase_hash(factory, rgeo_feature_polygon_module, hash);
|
48
49
|
hash = rgeo_geos_polygon_hash(self_data->geos_context, self_data->geom, hash);
|
49
50
|
return LONG2FIX(rb_hash_end(hash));
|
50
51
|
}
|
@@ -58,7 +59,7 @@ static VALUE method_polygon_geometry_type(VALUE self)
|
|
58
59
|
result = Qnil;
|
59
60
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
60
61
|
if (self_data->geom) {
|
61
|
-
result =
|
62
|
+
result = rgeo_feature_polygon_module;
|
62
63
|
}
|
63
64
|
return result;
|
64
65
|
}
|
@@ -93,7 +94,7 @@ static VALUE method_polygon_centroid(VALUE self)
|
|
93
94
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
94
95
|
self_geom = self_data->geom;
|
95
96
|
if (self_geom) {
|
96
|
-
result = rgeo_wrap_geos_geometry(self_data->factory, GEOSGetCentroid_r(self_data->geos_context, self_geom),
|
97
|
+
result = rgeo_wrap_geos_geometry(self_data->factory, GEOSGetCentroid_r(self_data->geos_context, self_geom), rgeo_geos_point_class);
|
97
98
|
}
|
98
99
|
return result;
|
99
100
|
}
|
@@ -109,7 +110,7 @@ static VALUE method_polygon_point_on_surface(VALUE self)
|
|
109
110
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
110
111
|
self_geom = self_data->geom;
|
111
112
|
if (self_geom) {
|
112
|
-
result = rgeo_wrap_geos_geometry(self_data->factory, GEOSPointOnSurface_r(self_data->geos_context, self_geom),
|
113
|
+
result = rgeo_wrap_geos_geometry(self_data->factory, GEOSPointOnSurface_r(self_data->geos_context, self_geom), rgeo_geos_point_class);
|
113
114
|
}
|
114
115
|
return result;
|
115
116
|
}
|
@@ -145,7 +146,7 @@ static VALUE method_polygon_exterior_ring(VALUE self)
|
|
145
146
|
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
146
147
|
self_geom = self_data->geom;
|
147
148
|
if (self_geom) {
|
148
|
-
result = rgeo_wrap_geos_geometry_clone(self_data->factory, GEOSGetExteriorRing_r(self_data->geos_context, self_geom),
|
149
|
+
result = rgeo_wrap_geos_geometry_clone(self_data->factory, GEOSGetExteriorRing_r(self_data->geos_context, self_geom), rgeo_geos_linear_ring_class);
|
149
150
|
}
|
150
151
|
return result;
|
151
152
|
}
|
@@ -191,7 +192,7 @@ static VALUE method_polygon_interior_ring_n(VALUE self, VALUE n)
|
|
191
192
|
if (i < num) {
|
192
193
|
result = rgeo_wrap_geos_geometry_clone(self_data->factory,
|
193
194
|
GEOSGetInteriorRingN_r(self_context, self_geom, i),
|
194
|
-
|
195
|
+
rgeo_geos_linear_ring_class);
|
195
196
|
}
|
196
197
|
}
|
197
198
|
}
|
@@ -219,9 +220,8 @@ static VALUE method_polygon_interior_rings(VALUE self)
|
|
219
220
|
if (count >= 0) {
|
220
221
|
result = rb_ary_new2(count);
|
221
222
|
factory = self_data->factory;
|
222
|
-
linear_ring_class = RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->geos_linear_ring;
|
223
223
|
for (i=0; i<count; ++i) {
|
224
|
-
rb_ary_store(result, i, rgeo_wrap_geos_geometry_clone(factory, GEOSGetInteriorRingN_r(self_context, self_geom, i),
|
224
|
+
rb_ary_store(result, i, rgeo_wrap_geos_geometry_clone(factory, GEOSGetInteriorRingN_r(self_context, self_geom, i), rgeo_geos_linear_ring_class));
|
225
225
|
}
|
226
226
|
}
|
227
227
|
}
|
@@ -244,7 +244,7 @@ static VALUE cmethod_create(VALUE module, VALUE factory, VALUE exterior, VALUE i
|
|
244
244
|
|
245
245
|
Check_Type(interior_array, T_ARRAY);
|
246
246
|
factory_data = RGEO_FACTORY_DATA_PTR(factory);
|
247
|
-
linear_ring_type =
|
247
|
+
linear_ring_type = rgeo_feature_linear_ring_module;
|
248
248
|
exterior_geom = rgeo_convert_to_detached_geos_geometry(exterior, factory, linear_ring_type, NULL);
|
249
249
|
if (exterior_geom) {
|
250
250
|
context = factory_data->geos_context;
|
@@ -262,7 +262,7 @@ static VALUE cmethod_create(VALUE module, VALUE factory, VALUE exterior, VALUE i
|
|
262
262
|
polygon = GEOSGeom_createPolygon_r(context, exterior_geom, interior_geoms, actual_len);
|
263
263
|
if (polygon) {
|
264
264
|
free(interior_geoms);
|
265
|
-
return rgeo_wrap_geos_geometry(factory, polygon,
|
265
|
+
return rgeo_wrap_geos_geometry(factory, polygon, rgeo_geos_polygon_class);
|
266
266
|
}
|
267
267
|
}
|
268
268
|
for (i=0; i<actual_len; ++i) {
|
@@ -276,15 +276,15 @@ static VALUE cmethod_create(VALUE module, VALUE factory, VALUE exterior, VALUE i
|
|
276
276
|
}
|
277
277
|
|
278
278
|
|
279
|
-
void rgeo_init_geos_polygon(
|
279
|
+
void rgeo_init_geos_polygon()
|
280
280
|
{
|
281
281
|
VALUE geos_polygon_methods;
|
282
282
|
|
283
283
|
// Class methods for CAPIPolygonImpl
|
284
|
-
rb_define_module_function(
|
284
|
+
rb_define_module_function(rgeo_geos_polygon_class, "create", cmethod_create, 3);
|
285
285
|
|
286
286
|
// CAPIPolygonMethods module
|
287
|
-
geos_polygon_methods = rb_define_module_under(
|
287
|
+
geos_polygon_methods = rb_define_module_under(rgeo_geos_module, "CAPIPolygonMethods");
|
288
288
|
rb_define_method(geos_polygon_methods, "rep_equals?", method_polygon_eql, 1);
|
289
289
|
rb_define_method(geos_polygon_methods, "eql?", method_polygon_eql, 1);
|
290
290
|
rb_define_method(geos_polygon_methods, "hash", method_polygon_hash, 0);
|
data/ext/geos_c_impl/polygon.h
CHANGED
@@ -9,8 +9,6 @@
|
|
9
9
|
#include <ruby.h>
|
10
10
|
#include <geos_c.h>
|
11
11
|
|
12
|
-
#include "factory.h"
|
13
|
-
|
14
12
|
RGEO_BEGIN_C
|
15
13
|
|
16
14
|
|
@@ -18,7 +16,7 @@ RGEO_BEGIN_C
|
|
18
16
|
Initializes the polygon module. This should be called after
|
19
17
|
the geometry module is initialized.
|
20
18
|
*/
|
21
|
-
void rgeo_init_geos_polygon(
|
19
|
+
void rgeo_init_geos_polygon();
|
22
20
|
|
23
21
|
/*
|
24
22
|
Comopares the values of two GEOS polygons. The two given geometries MUST
|
data/ext/geos_c_impl/preface.h
CHANGED
@@ -27,6 +27,11 @@
|
|
27
27
|
#ifdef HAVE_RB_MEMHASH
|
28
28
|
#define RGEO_SUPPORTS_NEW_HASHING
|
29
29
|
#endif
|
30
|
+
#ifdef HAVE_RB_GC_MARK_MOVABLE
|
31
|
+
#define mark rb_gc_mark_movable
|
32
|
+
#else
|
33
|
+
#define mark rb_gc_mark
|
34
|
+
#endif
|
30
35
|
|
31
36
|
#ifndef RGEO_SUPPORTS_NEW_HASHING
|
32
37
|
#define st_index_t int
|
data/lib/rgeo/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgeo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma
|
8
8
|
- Tee Parham
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi-geos
|
@@ -110,6 +110,8 @@ files:
|
|
110
110
|
- ext/geos_c_impl/geometry.h
|
111
111
|
- ext/geos_c_impl/geometry_collection.c
|
112
112
|
- ext/geos_c_impl/geometry_collection.h
|
113
|
+
- ext/geos_c_impl/globals.c
|
114
|
+
- ext/geos_c_impl/globals.h
|
113
115
|
- ext/geos_c_impl/line_string.c
|
114
116
|
- ext/geos_c_impl/line_string.h
|
115
117
|
- ext/geos_c_impl/main.c
|
@@ -193,7 +195,7 @@ homepage: https://github.com/rgeo/rgeo
|
|
193
195
|
licenses:
|
194
196
|
- BSD-3-Clause
|
195
197
|
metadata: {}
|
196
|
-
post_install_message:
|
198
|
+
post_install_message:
|
197
199
|
rdoc_options: []
|
198
200
|
require_paths:
|
199
201
|
- lib
|
@@ -208,8 +210,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
210
|
- !ruby/object:Gem::Version
|
209
211
|
version: '0'
|
210
212
|
requirements: []
|
211
|
-
rubygems_version: 3.1.
|
212
|
-
signing_key:
|
213
|
+
rubygems_version: 3.1.6
|
214
|
+
signing_key:
|
213
215
|
specification_version: 4
|
214
216
|
summary: RGeo is a geospatial data library for Ruby.
|
215
217
|
test_files: []
|