rgeo 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f0ded4953c3ad02eb5512ae8a9e8dd204e2008360678807a4ecea567c39533c
4
- data.tar.gz: 577998a9cc566eba2146fb5a5e02e26db330e38f2b8518551b50c86fa8a7a027
3
+ metadata.gz: 1e86885f1c2a19a3b89ea73784add4644f6cbfa6afb1cf73dc0f1dda22151923
4
+ data.tar.gz: 83690993b988a200dc689750e31f8aabdb78fc7aade2af339a068f5adb41b9a1
5
5
  SHA512:
6
- metadata.gz: 01f855c7553814054b662dbc9e84629f878ee71f642901cfb32f09386737cba9e0a86a2e91cbbe660515095d24cb09fb45d4b0ed680eac2f8194e0399eafe7c7
7
- data.tar.gz: 810f5ef0b1b0f7c20d1a2b8845cdd443b9646aa564965d98d2b0d9b4bb25211e810cc73b780ff14e405dd824f5d7305a8a473a952e89e0f397406672f8fceab1
6
+ metadata.gz: 733c109fc5858536ca56a18bac9d9ab78204365a1ea5cd2e4eb7f9d06eaf833cafb28907a547698954c5b5963be921b415b9e5cc881f7235d644be2619de482f
7
+ data.tar.gz: 7ab29b70bcfb8f7a58832271245a6a125861c5298db870a3ecad3ff2869aa56045fb42213b44609b44edcf7531349a205ef0e688773bab1f652508c66925730d
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
- [![Build Status](https://travis-ci.org/rgeo/rgeo.svg?branch=master)](https://travis-ci.org/rgeo/rgeo)
4
+ [![CI](https://github.com/rgeo/rgeo/workflows/CI/badge.svg)](https://github.com/rgeo/rgeo/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush)
5
5
 
6
6
  RGeo is a geospatial data library for Ruby.
7
7
 
@@ -67,7 +67,7 @@ or include it in your Gemfile:
67
67
  gem "rgeo"
68
68
  ```
69
69
 
70
- If you are using proj.4 extensions, include
70
+ If you are using proj.4 extensions, include
71
71
  [`rgeo-proj4`](https://github.com/rgeo/rgeo-proj4):
72
72
 
73
73
  ```ruby
@@ -108,25 +108,41 @@ ActiveRecord connection adapter for SpatiaLite, based on sqlite3 (*not maintaine
108
108
 
109
109
  RDoc Documentation is available at https://www.rubydoc.info/gems/rgeo
110
110
 
111
- Contributions are welcome. Please read the
111
+ Contributions are welcome. Please read the
112
112
  [Contributing guidelines](https://github.com/rgeo/rgeo/blob/master/CONTRIBUTING.md).
113
113
 
114
- Support may be available on the
114
+ Support may be available on the
115
115
  [rgeo-users google group](https://groups.google.com/forum/#!forum/rgeo-users)
116
116
  or on [Stack Overflow](https://stackoverflow.com/questions/tagged/rgeo).
117
117
 
118
+ ### Documentation
118
119
 
119
- ### Acknowledgments
120
+ You can see more in-depth documentation in the `doc` folder. Factories and
121
+ methods are documented inline, you should consider checking
122
+ https://rubydoc.info/gems/rgeo with the version you are currently using. Or
123
+ generate documentation locally if you're working on RGeo: `yardoc server`.
124
+
125
+ Here's the current list of available topics:
120
126
 
121
- RGeo was created by [Daniel Azuma](http://www.daniel-azuma.com).
122
- [Tee Parham](https://github.com/teeparham) is the current maintainer.
127
+ - [An introduction to Spatial Programming With RGeo](https://github.com/rgeo/rgeo/blob/master/doc/An-Introduction-to-Spatial-Programming-With-RGeo.md)
128
+ - [Enable GEOS and Proj4 on Heroku](https://github.com/rgeo/rgeo/blob/master/doc/Enable-GEOS-and-Proj4-on-Heroku.md)
129
+ - [Installing GEOS](https://github.com/rgeo/rgeo/blob/master/doc/Installing-GEOS.md)
130
+ - [Factory Compatibility](https://github.com/rgeo/rgeo/blob/master/doc/Factory-Compatibility.md)
131
+ - [Which factory should I use?](https://github.com/rgeo/rgeo/blob/master/doc/Which-factory-should-I-use.md)
132
+ - [Examples](https://github.com/rgeo/rgeo/blob/master/doc/Examples.md)
133
+ - [Who uses `rgeo`?](https://github.com/rgeo/rgeo/blob/master/doc/Gallery.md)
134
+
135
+ You can see an exhaustive and up to date list at https://rubydoc.info/gems/rgeo/index.
136
+ ### Acknowledgments
123
137
 
124
- Thanks to [Pirq](http://www.pirq.com) and [Neighborland](https://neighborland.com)
125
- for development support.
138
+ [Daniel Azuma](http://www.daniel-azuma.com) created RGeo.
139
+ [Tee Parham](http://twitter.com/teeparham) is a former maintainer.
140
+ [Keith Doggett](http://www.github.com/keithdoggett), [Ulysse Buonomo](http://www.github.com/BuonOmo) are current maintainers.
126
141
 
127
- Thanks to [Travis-CI](https://travis-ci.org) for CI testing.
142
+ Development is supported by:
128
143
 
129
- Thanks to [JetBrains](https://www.jetbrains.com/?from=rgeo) for RubyMine license.
144
+ - [Klaxit](https://www.github.com/klaxit)
145
+ - Goldfish Ads
130
146
 
131
147
  RGeo calls the GEOS library to handle most Cartesian geometric calculations,
132
148
  and the Proj4 library to handle projections and coordinate transformations.
@@ -1045,12 +1045,13 @@ static VALUE method_geometry_invalid_reason(VALUE self)
1045
1045
  self_geom = self_data->geom;
1046
1046
  if (self_geom) {
1047
1047
  str = GEOSisValidReason_r(self_data->geos_context, self_geom);
1048
- if (str) {
1049
- result = rb_str_new2(str);
1050
- }
1051
- else {
1052
- result = rb_str_new2("Exception");
1053
- }
1048
+ // Per documentation, a valid geometry should give an empty string.
1049
+ // However it seems not to be the case. Hence the comparison against
1050
+ // the string that is really given: `"Valid Geometry"`.
1051
+ // See https://github.com/libgeos/geos/issues/431.
1052
+ if (str) result = (str[0] == '\0' || !strcmp(str, "Valid Geometry")) ? Qnil : rb_str_new2(str);
1053
+ else result = rb_str_new2("Exception");
1054
+ GEOSFree_r(self_data->geos_context, str);
1054
1055
  }
1055
1056
  return result;
1056
1057
  }
@@ -174,7 +174,6 @@ module RGeo
174
174
  # operation that would benefit from it is called. The latter
175
175
  # never automatically generates a prepared geometry (unless you
176
176
  # generate one explicitly using the <tt>prepare!</tt> method).
177
-
178
177
  def factory(opts = {})
179
178
  if supported?
180
179
  native_interface = opts[:native_interface] || Geos.preferred_native_interface
@@ -9,6 +9,8 @@
9
9
  module RGeo
10
10
  module ImplHelper # :nodoc:
11
11
  module BasicGeometryCollectionMethods # :nodoc:
12
+ include Enumerable
13
+
12
14
  attr_reader :elements
13
15
 
14
16
  def initialize(factory, elements)
@@ -37,6 +39,10 @@ module RGeo
37
39
  @elements.each(&block)
38
40
  end
39
41
 
42
+ def geometries
43
+ @elements
44
+ end
45
+
40
46
  def dimension
41
47
  @dimension ||= @elements.map(&:dimension).max || -1
42
48
  end
data/lib/rgeo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RGeo
4
- VERSION = "2.2.0"
4
+ VERSION = "2.3.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgeo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-11-19 00:00:00.000000000 Z
12
+ date: 2021-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi-geos
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '12.0'
48
+ version: '13.0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '12.0'
55
+ version: '13.0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake-compiler
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -73,14 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '0.51'
76
+ version: 1.8.1
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '0.51'
83
+ version: 1.8.1
84
84
  description: RGeo is a geospatial data library for Ruby. It provides an implementation
85
85
  of the Open Geospatial Consortium's Simple Features Specification, used by most
86
86
  standard spatial/geographic data storage systems such as PostGIS. A number of add-on
@@ -201,14 +201,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
201
201
  requirements:
202
202
  - - ">="
203
203
  - !ruby/object:Gem::Version
204
- version: 2.4.0
204
+ version: 2.5.0
205
205
  required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  requirements:
207
207
  - - ">="
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  requirements: []
211
- rubygems_version: 3.0.3
211
+ rubygems_version: 3.2.3
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: RGeo is a geospatial data library for Ruby.