rgeo 2.3.1 → 3.0.0.pre.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +6 -0
- data/README.md +11 -10
- 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 +273 -202
- data/ext/geos_c_impl/factory.h +51 -63
- data/ext/geos_c_impl/geometry.c +124 -22
- data/ext/geos_c_impl/geometry.h +8 -3
- data/ext/geos_c_impl/geometry_collection.c +81 -185
- 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 +43 -72
- data/ext/geos_c_impl/polygon.h +1 -3
- data/ext/geos_c_impl/preface.h +12 -0
- data/ext/geos_c_impl/ruby_more.c +65 -0
- data/ext/geos_c_impl/ruby_more.h +16 -0
- data/lib/rgeo/cartesian/calculations.rb +54 -17
- data/lib/rgeo/cartesian/factory.rb +6 -14
- data/lib/rgeo/cartesian/feature_classes.rb +68 -46
- data/lib/rgeo/cartesian/feature_methods.rb +67 -20
- data/lib/rgeo/cartesian/interface.rb +0 -36
- 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/coord_sys.rb +0 -11
- data/lib/rgeo/error.rb +15 -0
- data/lib/rgeo/feature/factory_generator.rb +0 -3
- data/lib/rgeo/feature/geometry.rb +107 -28
- data/lib/rgeo/feature/geometry_collection.rb +13 -5
- data/lib/rgeo/feature/line_string.rb +3 -3
- 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 +6 -7
- data/lib/rgeo/geographic/interface.rb +6 -49
- 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 +67 -28
- 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 +79 -2
- data/lib/rgeo/geos/capi_factory.rb +21 -38
- data/lib/rgeo/geos/capi_feature_classes.rb +54 -11
- data/lib/rgeo/geos/ffi_factory.rb +6 -35
- data/lib/rgeo/geos/ffi_feature_classes.rb +34 -10
- data/lib/rgeo/geos/ffi_feature_methods.rb +39 -5
- data/lib/rgeo/geos/interface.rb +0 -24
- data/lib/rgeo/geos/zm_factory.rb +0 -19
- data/lib/rgeo/geos/zm_feature_methods.rb +16 -0
- data/lib/rgeo/geos.rb +6 -3
- data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +4 -4
- data/lib/rgeo/impl_helper/basic_geometry_methods.rb +1 -1
- data/lib/rgeo/impl_helper/basic_line_string_methods.rb +15 -19
- data/lib/rgeo/impl_helper/basic_point_methods.rb +1 -1
- data/lib/rgeo/impl_helper/basic_polygon_methods.rb +1 -1
- data/lib/rgeo/impl_helper/valid_op.rb +354 -0
- data/lib/rgeo/impl_helper/validity_check.rb +139 -0
- data/lib/rgeo/impl_helper.rb +1 -0
- data/lib/rgeo/version.rb +1 -1
- metadata +45 -9
- data/lib/rgeo/coord_sys/srs_database/entry.rb +0 -107
- data/lib/rgeo/coord_sys/srs_database/sr_org.rb +0 -64
- data/lib/rgeo/coord_sys/srs_database/url_reader.rb +0 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 939fdbb8c9bbcb94342b99f952ad5524cb436683ea054bcab0aaa408f362ac2a
|
4
|
+
data.tar.gz: 4cd0c59ee3e08947c646c1b7e5c9a9755c44a0a87459437754867bbb5c2e304e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6f02199e30b35334156d3a1107213b6dab9028572e423d2f0f6072a7a2032586e26dfa5a594a8132b33d4071f0d55f6bd75dcd60d1e5a60df4bde0c51b7a78f
|
7
|
+
data.tar.gz: 20404c7de6aec61e04eae659253ddf16f518afce40c64274d261acc1a160f5420866c8188fed18425e1a55788e5041ff9b7a93c653f61cdde0a7ce15dccfa1a1
|
data/.yardopts
ADDED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
## RGeo
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/rgeo.svg)](http://badge.fury.io/rb/rgeo)
|
4
|
-
[![CI](https://github.com/rgeo/rgeo/workflows/CI/badge.svg)](https://github.com/rgeo/rgeo/actions?query=workflow%3ACI+branch%
|
4
|
+
[![CI](https://github.com/rgeo/rgeo/workflows/CI/badge.svg)](https://github.com/rgeo/rgeo/actions?query=workflow%3ACI+branch%3Amain+event%3Apush)
|
5
5
|
|
6
6
|
RGeo is a geospatial data library for Ruby.
|
7
7
|
|
@@ -109,7 +109,7 @@ ActiveRecord connection adapter for SpatiaLite, based on sqlite3 (*not maintaine
|
|
109
109
|
RDoc Documentation is available at https://www.rubydoc.info/gems/rgeo
|
110
110
|
|
111
111
|
Contributions are welcome. Please read the
|
112
|
-
[Contributing guidelines](https://github.com/rgeo/rgeo/blob/
|
112
|
+
[Contributing guidelines](https://github.com/rgeo/rgeo/blob/main/CONTRIBUTING.md).
|
113
113
|
|
114
114
|
Support may be available on the
|
115
115
|
[rgeo-users google group](https://groups.google.com/forum/#!forum/rgeo-users)
|
@@ -124,13 +124,14 @@ generate documentation locally if you're working on RGeo: `yardoc server`.
|
|
124
124
|
|
125
125
|
Here's the current list of available topics:
|
126
126
|
|
127
|
-
- [An introduction to Spatial Programming With RGeo](https://github.com/rgeo/rgeo/blob/
|
128
|
-
- [Enable GEOS and Proj4 on Heroku](https://github.com/rgeo/rgeo/blob/
|
129
|
-
- [Installing GEOS](https://github.com/rgeo/rgeo/blob/
|
130
|
-
- [Factory Compatibility](https://github.com/rgeo/rgeo/blob/
|
131
|
-
- [Which factory should I use?](https://github.com/rgeo/rgeo/blob/
|
132
|
-
- [
|
133
|
-
- [
|
127
|
+
- [An introduction to Spatial Programming With RGeo](https://github.com/rgeo/rgeo/blob/main/doc/An-Introduction-to-Spatial-Programming-With-RGeo.md)
|
128
|
+
- [Enable GEOS and Proj4 on Heroku](https://github.com/rgeo/rgeo/blob/main/doc/Enable-GEOS-and-Proj4-on-Heroku.md)
|
129
|
+
- [Installing GEOS](https://github.com/rgeo/rgeo/blob/main/doc/Installing-GEOS.md)
|
130
|
+
- [Factory Compatibility](https://github.com/rgeo/rgeo/blob/main/doc/Factory-Compatibility.md)
|
131
|
+
- [Which factory should I use?](https://github.com/rgeo/rgeo/blob/main/doc/Which-factory-should-I-use.md)
|
132
|
+
- [Geometry validity handling](https://github.com/rgeo/rgeo/blob/main/doc/Geometry-Validity.md)
|
133
|
+
- [Examples](https://github.com/rgeo/rgeo/blob/main/doc/Examples.md)
|
134
|
+
- [Who uses `rgeo`?](https://github.com/rgeo/rgeo/blob/main/doc/Gallery.md)
|
134
135
|
|
135
136
|
You can see an exhaustive and up to date list at https://rubydoc.info/gems/rgeo/index.
|
136
137
|
### Acknowledgments
|
@@ -157,4 +158,4 @@ by [J Smith](https://github.com/dark-panda).
|
|
157
158
|
|
158
159
|
Copyright (c) Daniel Azuma, Tee Parham
|
159
160
|
|
160
|
-
[License](https://github.com/rgeo/rgeo/blob/
|
161
|
+
[License](https://github.com/rgeo/rgeo/blob/main/LICENSE.txt)
|
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_
|