rgeo 1.1.2 → 2.0.0
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/ext/geos_c_impl/extconf.rb +5 -3
- data/ext/geos_c_impl/factory.c +4 -4
- data/ext/geos_c_impl/geometry.c +1 -1
- data/lib/rgeo.rb +2 -4
- data/lib/rgeo/cartesian.rb +6 -16
- data/lib/rgeo/cartesian/analysis.rb +22 -20
- data/lib/rgeo/cartesian/bounding_box.rb +83 -79
- data/lib/rgeo/cartesian/calculations.rb +40 -38
- data/lib/rgeo/cartesian/factory.rb +134 -169
- data/lib/rgeo/cartesian/feature_classes.rb +2 -18
- data/lib/rgeo/cartesian/feature_methods.rb +37 -39
- data/lib/rgeo/cartesian/interface.rb +11 -9
- data/lib/rgeo/coord_sys.rb +9 -8
- data/lib/rgeo/coord_sys/cs/entities.rb +345 -303
- data/lib/rgeo/coord_sys/cs/factories.rb +30 -28
- data/lib/rgeo/coord_sys/cs/wkt_parser.rb +128 -126
- data/lib/rgeo/coord_sys/srs_database/{interface.rb → entry.rb} +26 -32
- data/lib/rgeo/coord_sys/srs_database/sr_org.rb +19 -17
- data/lib/rgeo/coord_sys/srs_database/url_reader.rb +21 -19
- data/lib/rgeo/error.rb +3 -1
- data/lib/rgeo/feature.rb +23 -34
- data/lib/rgeo/feature/curve.rb +2 -0
- data/lib/rgeo/feature/factory.rb +15 -13
- data/lib/rgeo/feature/factory_generator.rb +7 -5
- data/lib/rgeo/feature/geometry.rb +31 -29
- data/lib/rgeo/feature/geometry_collection.rb +6 -4
- data/lib/rgeo/feature/line.rb +2 -0
- data/lib/rgeo/feature/line_string.rb +3 -1
- data/lib/rgeo/feature/linear_ring.rb +2 -0
- data/lib/rgeo/feature/multi_curve.rb +2 -0
- data/lib/rgeo/feature/multi_line_string.rb +2 -0
- data/lib/rgeo/feature/multi_point.rb +2 -0
- data/lib/rgeo/feature/multi_polygon.rb +2 -0
- data/lib/rgeo/feature/multi_surface.rb +2 -0
- data/lib/rgeo/feature/point.rb +2 -0
- data/lib/rgeo/feature/polygon.rb +3 -1
- data/lib/rgeo/feature/surface.rb +2 -0
- data/lib/rgeo/feature/types.rb +107 -103
- data/lib/rgeo/geographic.rb +17 -27
- data/lib/rgeo/geographic/factory.rb +154 -199
- data/lib/rgeo/geographic/interface.rb +141 -137
- data/lib/rgeo/geographic/proj4_projector.rb +28 -23
- data/lib/rgeo/geographic/projected_feature_classes.rb +2 -18
- data/lib/rgeo/geographic/projected_feature_methods.rb +59 -49
- data/lib/rgeo/geographic/projected_window.rb +4 -2
- data/lib/rgeo/geographic/simple_mercator_projector.rb +41 -39
- data/lib/rgeo/geographic/spherical_feature_classes.rb +2 -18
- data/lib/rgeo/geographic/spherical_feature_methods.rb +67 -67
- data/lib/rgeo/geographic/spherical_math.rb +81 -87
- data/lib/rgeo/geos.rb +23 -34
- data/lib/rgeo/geos/capi_factory.rb +106 -135
- data/lib/rgeo/geos/capi_feature_classes.rb +19 -37
- data/lib/rgeo/geos/ffi_factory.rb +276 -297
- data/lib/rgeo/geos/ffi_feature_classes.rb +2 -20
- data/lib/rgeo/geos/ffi_feature_methods.rb +170 -166
- data/lib/rgeo/geos/interface.rb +25 -23
- data/lib/rgeo/geos/utils.rb +47 -39
- data/lib/rgeo/geos/zm_factory.rb +171 -185
- data/lib/rgeo/geos/zm_feature_classes.rb +2 -20
- data/lib/rgeo/geos/zm_feature_methods.rb +76 -72
- data/lib/rgeo/impl_helper.rb +1 -11
- data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +72 -75
- data/lib/rgeo/impl_helper/basic_geometry_methods.rb +21 -23
- data/lib/rgeo/impl_helper/basic_line_string_methods.rb +57 -49
- data/lib/rgeo/impl_helper/basic_point_methods.rb +29 -25
- data/lib/rgeo/impl_helper/basic_polygon_methods.rb +31 -27
- data/lib/rgeo/impl_helper/math.rb +2 -0
- data/lib/rgeo/impl_helper/utils.rb +9 -15
- data/lib/rgeo/version.rb +3 -1
- data/lib/rgeo/wkrep.rb +20 -30
- data/lib/rgeo/wkrep/wkb_generator.rb +87 -84
- data/lib/rgeo/wkrep/wkb_parser.rb +93 -93
- data/lib/rgeo/wkrep/wkt_generator.rb +67 -63
- data/lib/rgeo/wkrep/wkt_parser.rb +172 -168
- metadata +17 -32
- data/lib/rgeo/feature/mixins.rb +0 -143
metadata
CHANGED
@@ -1,71 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgeo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma, Tee Parham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '12.0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '12.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rdoc
|
14
|
+
name: ffi-geos
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
19
|
+
version: '1.2'
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
26
|
+
version: '1.2'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
28
|
+
name: rake
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
33
|
+
version: '12.0'
|
48
34
|
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
40
|
+
version: '12.0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
42
|
+
name: rake-compiler
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
47
|
+
version: '1.0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
54
|
+
version: '1.0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rubocop
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,19 +67,19 @@ dependencies:
|
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '0.51'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
70
|
+
name: test-unit
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
75
|
+
version: '3.0'
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
82
|
+
version: '3.0'
|
97
83
|
description: RGeo is a geospatial data library for Ruby. It provides an implementation
|
98
84
|
of the Open Geospatial Consortium's Simple Features Specification, used by most
|
99
85
|
standard spatial/geographic data storage systems such as PostGIS. A number of add-on
|
@@ -136,7 +122,7 @@ files:
|
|
136
122
|
- lib/rgeo/coord_sys/cs/entities.rb
|
137
123
|
- lib/rgeo/coord_sys/cs/factories.rb
|
138
124
|
- lib/rgeo/coord_sys/cs/wkt_parser.rb
|
139
|
-
- lib/rgeo/coord_sys/srs_database/
|
125
|
+
- lib/rgeo/coord_sys/srs_database/entry.rb
|
140
126
|
- lib/rgeo/coord_sys/srs_database/sr_org.rb
|
141
127
|
- lib/rgeo/coord_sys/srs_database/url_reader.rb
|
142
128
|
- lib/rgeo/error.rb
|
@@ -149,7 +135,6 @@ files:
|
|
149
135
|
- lib/rgeo/feature/line.rb
|
150
136
|
- lib/rgeo/feature/line_string.rb
|
151
137
|
- lib/rgeo/feature/linear_ring.rb
|
152
|
-
- lib/rgeo/feature/mixins.rb
|
153
138
|
- lib/rgeo/feature/multi_curve.rb
|
154
139
|
- lib/rgeo/feature/multi_line_string.rb
|
155
140
|
- lib/rgeo/feature/multi_point.rb
|
@@ -206,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
206
191
|
requirements:
|
207
192
|
- - ">="
|
208
193
|
- !ruby/object:Gem::Version
|
209
|
-
version: 2.
|
194
|
+
version: 2.3.0
|
210
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
196
|
requirements:
|
212
197
|
- - ">="
|
@@ -214,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
199
|
version: '0'
|
215
200
|
requirements: []
|
216
201
|
rubyforge_project:
|
217
|
-
rubygems_version: 2.7.
|
202
|
+
rubygems_version: 2.7.8
|
218
203
|
signing_key:
|
219
204
|
specification_version: 4
|
220
205
|
summary: RGeo is a geospatial data library for Ruby.
|
data/lib/rgeo/feature/mixins.rb
DELETED
@@ -1,143 +0,0 @@
|
|
1
|
-
# -----------------------------------------------------------------------------
|
2
|
-
#
|
3
|
-
# Mixin tracker
|
4
|
-
#
|
5
|
-
# -----------------------------------------------------------------------------
|
6
|
-
|
7
|
-
module RGeo
|
8
|
-
module Feature
|
9
|
-
# MixinCollection is a mechanism for adding arbitrary methods to
|
10
|
-
# geometry objects.
|
11
|
-
#
|
12
|
-
# Normally, geometry objects respond to the methods defined in the
|
13
|
-
# feature interface for that type of geometry; e.g.
|
14
|
-
# RGeo::Feature::Geometry, RGeo::Feature::Point, etc. Some
|
15
|
-
# implementations include additional methods specific to the
|
16
|
-
# implementation. However, occasionally it is desirable also to
|
17
|
-
# include custom methods allowing objects to function in different
|
18
|
-
# contexts. To do so, provide those methods in a mixin Module, and
|
19
|
-
# add it to an appropriate MixinCollection. A MixinCollection is
|
20
|
-
# simply a collection of mixin Modules, connected to geometry types,
|
21
|
-
# that are included in objects of that type.
|
22
|
-
#
|
23
|
-
# There is a global collection, MixinCollection::GLOBAL, which
|
24
|
-
# manages mixins to be added to all implementations. In addition,
|
25
|
-
# individual implementation factories may provide additional local
|
26
|
-
# MixinCollection objects for mixins specific to objects created
|
27
|
-
# by that factory.
|
28
|
-
#
|
29
|
-
# Each mixin module added to a MixinCollection is connected to a
|
30
|
-
# specific type, which controls to which objects that mixin is added.
|
31
|
-
# For example, a mixin connected to Point is added only to Point
|
32
|
-
# objects. A mixin connected to GeometryCollection is added to
|
33
|
-
# GeometryCollection objects as well as MultiPoint, MultiLineString,
|
34
|
-
# and MultiPolygon, since those are subtypes of GeometryCollection.
|
35
|
-
# To add a mixin to all objects, connect it to the Geometry base type.
|
36
|
-
|
37
|
-
class MixinCollection
|
38
|
-
# An API point controlling a particular type.
|
39
|
-
|
40
|
-
class TypeData
|
41
|
-
def initialize(collection_, type_) # :nodoc:
|
42
|
-
@collection = collection_
|
43
|
-
@type = type_
|
44
|
-
@mixins = []
|
45
|
-
@classes = []
|
46
|
-
@rmixins = []
|
47
|
-
@rclasses = []
|
48
|
-
end
|
49
|
-
|
50
|
-
# The feature type
|
51
|
-
attr_reader :type
|
52
|
-
|
53
|
-
# The MixinCollection owning this data
|
54
|
-
attr_reader :collection
|
55
|
-
|
56
|
-
# Add a mixin to be included in implementations of this type.
|
57
|
-
|
58
|
-
def add(module_)
|
59
|
-
@mixins << module_
|
60
|
-
@classes.each { |k_| k_.class_eval { include(module_) } }
|
61
|
-
_radd(module_)
|
62
|
-
end
|
63
|
-
|
64
|
-
# A class that implements this type should call this method to
|
65
|
-
# get the appropriate mixins.
|
66
|
-
# If include_ancestry_ is set to true, then mixins connected to
|
67
|
-
# subtypes of this type are also added to the class.
|
68
|
-
|
69
|
-
def include_in_class(klass_, include_ancestry_ = false)
|
70
|
-
(include_ancestry_ ? @rmixins : @mixins).each { |m_| klass_.class_eval { include(m_) } }
|
71
|
-
(include_ancestry_ ? @rclasses : @classes) << klass_
|
72
|
-
self
|
73
|
-
end
|
74
|
-
|
75
|
-
# An object that implements this type should call this method to
|
76
|
-
# get the appropriate mixins.
|
77
|
-
# If include_ancestry_ is set to true, then mixins connected to
|
78
|
-
# subtypes of this type are also added to the object.
|
79
|
-
|
80
|
-
def include_in_object(obj_, include_ancestry_ = false)
|
81
|
-
(include_ancestry_ ? @rmixins : @mixins).each { |m_| obj_.extend(m_) }
|
82
|
-
self
|
83
|
-
end
|
84
|
-
|
85
|
-
def _radd(module_) # :nodoc:
|
86
|
-
@rmixins << module_
|
87
|
-
@rclasses.each { |k_| k_.class_eval { include(module_) } }
|
88
|
-
@type.each_immediate_subtype { |t_| @collection.for_type(t_)._radd(module_) }
|
89
|
-
self
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
# Create a new empty MixinCollection
|
94
|
-
|
95
|
-
def initialize
|
96
|
-
@types = {}
|
97
|
-
end
|
98
|
-
|
99
|
-
# Returns a TypeData for the given type.
|
100
|
-
#
|
101
|
-
# e.g. to add a module for point types, you can call:
|
102
|
-
# for_type(RGeo::Feature::Point).add(module)
|
103
|
-
|
104
|
-
def for_type(type_)
|
105
|
-
(@types[type_] ||= TypeData.new(self, type_))
|
106
|
-
end
|
107
|
-
|
108
|
-
# Add a module connected to the given type.
|
109
|
-
#
|
110
|
-
# Shorthand for:
|
111
|
-
# for_type(type_).add(module_)
|
112
|
-
|
113
|
-
def add(type_, module_)
|
114
|
-
for_type(type_).add(module_)
|
115
|
-
end
|
116
|
-
|
117
|
-
# A class that implements this type should call this method to
|
118
|
-
# get the appropriate mixins.
|
119
|
-
#
|
120
|
-
# Shorthand for:
|
121
|
-
# for_type(type_).include_in_class(klass_, include_ancestry_)
|
122
|
-
|
123
|
-
def include_in_class(type_, klass_, include_ancestry_ = false)
|
124
|
-
for_type(type_).include_in_class(klass_, include_ancestry_)
|
125
|
-
end
|
126
|
-
|
127
|
-
# An object that implements this type should call this method to
|
128
|
-
# get the appropriate mixins.
|
129
|
-
#
|
130
|
-
# Shorthand for:
|
131
|
-
# for_type(type_).include_in_object(obj_, include_ancestry_)
|
132
|
-
|
133
|
-
def include_in_object(type_, obj_, include_ancestry_ = false)
|
134
|
-
for_type(type_).include_in_object(obj_, include_ancestry_)
|
135
|
-
end
|
136
|
-
|
137
|
-
# The global MixinCollection. Mixins added to this collection are
|
138
|
-
# added to all geometry objects for all implementations.
|
139
|
-
|
140
|
-
GLOBAL = MixinCollection.new
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|