rgeo 2.3.0 → 3.0.0.pre.rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +6 -0
- data/README.md +1 -0
- data/ext/geos_c_impl/analysis.c +8 -6
- data/ext/geos_c_impl/analysis.h +1 -3
- data/ext/geos_c_impl/errors.c +10 -8
- data/ext/geos_c_impl/errors.h +7 -3
- data/ext/geos_c_impl/extconf.rb +3 -0
- data/ext/geos_c_impl/factory.c +251 -182
- data/ext/geos_c_impl/factory.h +43 -62
- data/ext/geos_c_impl/geometry.c +56 -24
- data/ext/geos_c_impl/geometry.h +8 -3
- data/ext/geos_c_impl/geometry_collection.c +41 -148
- data/ext/geos_c_impl/geometry_collection.h +1 -14
- 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 +28 -29
- 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 +9 -8
- data/ext/geos_c_impl/point.h +1 -3
- data/ext/geos_c_impl/polygon.c +15 -51
- data/ext/geos_c_impl/polygon.h +1 -3
- data/ext/geos_c_impl/preface.h +8 -0
- data/lib/rgeo/cartesian/analysis.rb +2 -2
- data/lib/rgeo/cartesian/calculations.rb +54 -17
- data/lib/rgeo/cartesian/factory.rb +0 -7
- data/lib/rgeo/cartesian/feature_classes.rb +66 -46
- data/lib/rgeo/cartesian/feature_methods.rb +56 -20
- data/lib/rgeo/cartesian/interface.rb +0 -6
- data/lib/rgeo/cartesian/planar_graph.rb +379 -0
- data/lib/rgeo/cartesian/sweepline_intersector.rb +149 -0
- data/lib/rgeo/cartesian/valid_op.rb +71 -0
- data/lib/rgeo/cartesian.rb +3 -0
- data/lib/rgeo/coord_sys/cs/wkt_parser.rb +6 -6
- data/lib/rgeo/error.rb +15 -0
- data/lib/rgeo/feature/curve.rb +12 -2
- data/lib/rgeo/feature/geometry.rb +38 -28
- data/lib/rgeo/feature/geometry_collection.rb +13 -5
- data/lib/rgeo/feature/line_string.rb +3 -3
- data/lib/rgeo/feature/multi_curve.rb +6 -1
- data/lib/rgeo/feature/multi_surface.rb +3 -3
- data/lib/rgeo/feature/point.rb +4 -4
- data/lib/rgeo/feature/surface.rb +3 -3
- data/lib/rgeo/geographic/factory.rb +0 -7
- data/lib/rgeo/geographic/interface.rb +4 -18
- data/lib/rgeo/geographic/proj4_projector.rb +0 -2
- data/lib/rgeo/geographic/projected_feature_classes.rb +21 -9
- data/lib/rgeo/geographic/projected_feature_methods.rb +63 -30
- data/lib/rgeo/geographic/simple_mercator_projector.rb +0 -2
- data/lib/rgeo/geographic/spherical_feature_classes.rb +29 -9
- data/lib/rgeo/geographic/spherical_feature_methods.rb +68 -2
- data/lib/rgeo/geos/capi_factory.rb +21 -31
- data/lib/rgeo/geos/capi_feature_classes.rb +64 -11
- data/lib/rgeo/geos/ffi_factory.rb +0 -28
- data/lib/rgeo/geos/ffi_feature_classes.rb +34 -10
- data/lib/rgeo/geos/ffi_feature_methods.rb +53 -10
- data/lib/rgeo/geos/interface.rb +18 -10
- data/lib/rgeo/geos/zm_factory.rb +0 -12
- data/lib/rgeo/geos/zm_feature_methods.rb +30 -5
- data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +18 -8
- data/lib/rgeo/impl_helper/basic_geometry_methods.rb +1 -1
- data/lib/rgeo/impl_helper/basic_line_string_methods.rb +37 -26
- data/lib/rgeo/impl_helper/basic_point_methods.rb +13 -3
- data/lib/rgeo/impl_helper/basic_polygon_methods.rb +8 -3
- data/lib/rgeo/impl_helper/valid_op.rb +354 -0
- data/lib/rgeo/impl_helper/validity_check.rb +138 -0
- data/lib/rgeo/impl_helper.rb +1 -0
- data/lib/rgeo/version.rb +1 -1
- data/lib/rgeo/wkrep/wkb_generator.rb +1 -1
- data/lib/rgeo/wkrep/wkt_generator.rb +6 -6
- metadata +30 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e26b01fb2fff6915756d98e206ee4bdabefeaceadae3cd0b85cb7be9ee6d8285
|
4
|
+
data.tar.gz: 9b94dd4e6c57e9fa5ab07c7b5fb9c622a52d843b67d146b52454933cb817a4a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9adb8cc283c8663fb0a178eeb7a1629fe466265f7fa15c54d4e8dac4188646a2682f591a3e76d12271df5dc6c875961833600b88952d035f824933bd454211de
|
7
|
+
data.tar.gz: c1f7e26d5a5edcc060cac2efaa782a586c9ee95e1dda08f7af771648ecc1ea2373a1e4ba9053aae00288332e401370c7f61e254367231ceabb4fb36ad5406209
|
data/.yardopts
ADDED
data/README.md
CHANGED
@@ -129,6 +129,7 @@ Here's the current list of available topics:
|
|
129
129
|
- [Installing GEOS](https://github.com/rgeo/rgeo/blob/master/doc/Installing-GEOS.md)
|
130
130
|
- [Factory Compatibility](https://github.com/rgeo/rgeo/blob/master/doc/Factory-Compatibility.md)
|
131
131
|
- [Which factory should I use?](https://github.com/rgeo/rgeo/blob/master/doc/Which-factory-should-I-use.md)
|
132
|
+
- [Geometry validity handling](https://github.com/rgeo/rgeo/blob/master/doc/Geometry-Validity.md)
|
132
133
|
- [Examples](https://github.com/rgeo/rgeo/blob/master/doc/Examples.md)
|
133
134
|
- [Who uses `rgeo`?](https://github.com/rgeo/rgeo/blob/master/doc/Gallery.md)
|
134
135
|
|
data/ext/geos_c_impl/analysis.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 "analysis.h"
|
13
15
|
#include "factory.h"
|
14
16
|
#include "errors.h"
|
@@ -35,9 +37,9 @@ VALUE rgeo_geos_analysis_ccw_p(VALUE self, VALUE ring)
|
|
35
37
|
ring_data = RGEO_GEOMETRY_DATA_PTR(ring);
|
36
38
|
|
37
39
|
coord_seq = GEOSGeom_getCoordSeq_r(ring_data->geos_context, ring_data->geom);
|
38
|
-
if (!coord_seq) { rb_raise(
|
40
|
+
if (!coord_seq) { rb_raise(rb_eGeosError, "Could not retrieve CoordSeq from given ring."); }
|
39
41
|
if (!GEOSCoordSeq_isCCW_r(ring_data->geos_context, coord_seq, &is_ccw)) {
|
40
|
-
rb_raise(
|
42
|
+
rb_raise(rb_eGeosError, "Could not determine if the CoordSeq is CCW.");
|
41
43
|
}
|
42
44
|
|
43
45
|
return is_ccw ? Qtrue : Qfalse;
|
@@ -47,8 +49,8 @@ VALUE rgeo_geos_analysis_ccw_p(VALUE self, VALUE ring)
|
|
47
49
|
|
48
50
|
/**
|
49
51
|
* call-seq:
|
50
|
-
* RGeo::Geos::Analysis.ccw_supported? -> true or false
|
51
|
-
*
|
52
|
+
* RGeo::Geos::Analysis.ccw_supported? -> true or false
|
53
|
+
*
|
52
54
|
* Checks if the RGEO_GEOS_SUPPORTS_ISCCW macro is defined, returns +true+
|
53
55
|
* if it is, +false+ otherwise
|
54
56
|
*/
|
@@ -62,11 +64,11 @@ VALUE rgeo_geos_analysis_supports_ccw(VALUE self)
|
|
62
64
|
}
|
63
65
|
|
64
66
|
|
65
|
-
void rgeo_init_geos_analysis(
|
67
|
+
void rgeo_init_geos_analysis()
|
66
68
|
{
|
67
69
|
VALUE geos_analysis_module;
|
68
70
|
|
69
|
-
geos_analysis_module = rb_define_module_under(
|
71
|
+
geos_analysis_module = rb_define_module_under(rgeo_geos_module, "Analysis");
|
70
72
|
rb_define_singleton_method(geos_analysis_module, "ccw_supported?", rgeo_geos_analysis_supports_ccw, 0);
|
71
73
|
#ifdef RGEO_GEOS_SUPPORTS_ISCCW
|
72
74
|
rb_define_singleton_method(geos_analysis_module, "ccw?", rgeo_geos_analysis_ccw_p, 1);
|
data/ext/geos_c_impl/analysis.h
CHANGED
@@ -9,8 +9,6 @@
|
|
9
9
|
|
10
10
|
#ifdef RGEO_GEOS_SUPPORTED
|
11
11
|
|
12
|
-
#include "factory.h"
|
13
|
-
|
14
12
|
RGEO_BEGIN_C
|
15
13
|
|
16
14
|
/*
|
@@ -33,7 +31,7 @@ VALUE rgeo_geos_analysis_ccw_p(VALUE self, VALUE ring);
|
|
33
31
|
*/
|
34
32
|
VALUE rgeo_geos_analysis_supports_ccw(VALUE self);
|
35
33
|
|
36
|
-
void rgeo_init_geos_analysis(
|
34
|
+
void rgeo_init_geos_analysis();
|
37
35
|
|
38
36
|
RGEO_END_C
|
39
37
|
|
data/ext/geos_c_impl/errors.c
CHANGED
@@ -8,24 +8,26 @@
|
|
8
8
|
|
9
9
|
#ifdef RGEO_GEOS_SUPPORTED
|
10
10
|
|
11
|
+
#include "globals.h"
|
12
|
+
|
11
13
|
#include "errors.h"
|
12
14
|
|
13
15
|
RGEO_BEGIN_C
|
14
16
|
|
15
|
-
|
16
|
-
VALUE
|
17
|
-
|
18
|
-
VALUE
|
17
|
+
VALUE rb_eRGeoError;
|
18
|
+
VALUE rb_eRGeoInvalidGeometry;
|
19
|
+
VALUE rb_eRGeoUnsupportedOperation;
|
20
|
+
VALUE rb_eGeosError;
|
19
21
|
|
20
22
|
|
21
23
|
void rgeo_init_geos_errors() {
|
22
|
-
VALUE rgeo_module;
|
23
24
|
VALUE error_module;
|
24
25
|
|
25
|
-
rgeo_module = rb_define_module("RGeo");
|
26
26
|
error_module = rb_define_module_under(rgeo_module, "Error");
|
27
|
-
|
28
|
-
|
27
|
+
rb_eRGeoError = rb_define_class_under(error_module, "RGeoError", rb_eRuntimeError);
|
28
|
+
rb_eRGeoInvalidGeometry = rb_define_class_under(error_module, "InvalidGeometry", rb_eRGeoError);
|
29
|
+
rb_eRGeoUnsupportedOperation = rb_define_class_under(error_module, "UnsupportedOperation", rb_eRGeoError);
|
30
|
+
rb_eGeosError = rb_define_class_under(error_module, "GeosError", rb_eRGeoError);
|
29
31
|
}
|
30
32
|
|
31
33
|
RGEO_END_C
|
data/ext/geos_c_impl/errors.h
CHANGED
@@ -8,10 +8,14 @@
|
|
8
8
|
|
9
9
|
RGEO_BEGIN_C
|
10
10
|
|
11
|
-
//
|
12
|
-
extern VALUE
|
11
|
+
// Main rgeo error type
|
12
|
+
extern VALUE rb_eRGeoError;
|
13
|
+
// RGeo::Error::InvalidGeometry
|
14
|
+
extern VALUE rb_eRGeoInvalidGeometry;
|
15
|
+
// RGeo::Error::UnsupportedOperation
|
16
|
+
extern VALUE rb_eRGeoUnsupportedOperation;
|
13
17
|
// RGeo error specific to the GEOS implementation.
|
14
|
-
extern VALUE
|
18
|
+
extern VALUE rb_eGeosError;
|
15
19
|
|
16
20
|
void rgeo_init_geos_errors();
|
17
21
|
|
data/ext/geos_c_impl/extconf.rb
CHANGED
@@ -14,6 +14,8 @@ if RUBY_DESCRIPTION =~ /^jruby\s/
|
|
14
14
|
else
|
15
15
|
require "mkmf"
|
16
16
|
|
17
|
+
$CFLAGS << " -DRGEO_GEOS_DEBUG" if ENV.key?("DEBUG") || ENV.key?("RGEO_GEOS_DEBUG")
|
18
|
+
|
17
19
|
geosconfig = with_config("geos-config") || find_executable("geos-config")
|
18
20
|
|
19
21
|
if geosconfig
|
@@ -33,6 +35,7 @@ else
|
|
33
35
|
have_func("GEOSUnaryUnion_r", "geos_c.h")
|
34
36
|
have_func("GEOSCoordSeq_isCCW_r", "geos_c.h")
|
35
37
|
have_func("rb_memhash", "ruby.h")
|
38
|
+
have_func("rb_gc_mark_movable", "ruby.h")
|
36
39
|
end
|
37
40
|
|
38
41
|
if found_geos_
|