rgeo 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +6 -0
- data/README.rdoc +1 -1
- data/Version +1 -1
- data/ext/geos_c_impl/extconf.rb +13 -13
- data/ext/geos_c_impl/factory.c +30 -18
- data/ext/geos_c_impl/factory.h +18 -12
- data/ext/geos_c_impl/geometry.c +11 -11
- data/ext/geos_c_impl/geometry.h +7 -7
- data/ext/geos_c_impl/geometry_collection.c +15 -15
- data/ext/geos_c_impl/geometry_collection.h +8 -8
- data/ext/geos_c_impl/line_string.c +14 -14
- data/ext/geos_c_impl/line_string.h +7 -7
- data/ext/geos_c_impl/main.c +7 -7
- data/ext/geos_c_impl/point.c +9 -9
- data/ext/geos_c_impl/point.h +7 -7
- data/ext/geos_c_impl/polygon.c +9 -9
- data/ext/geos_c_impl/polygon.h +7 -7
- data/ext/geos_c_impl/preface.h +7 -7
- data/ext/proj4_c_impl/extconf.rb +13 -13
- data/ext/proj4_c_impl/main.c +12 -12
- data/lib/rgeo.rb +26 -26
- data/lib/rgeo/cartesian.rb +12 -12
- data/lib/rgeo/cartesian/analysis.rb +26 -26
- data/lib/rgeo/cartesian/bounding_box.rb +83 -83
- data/lib/rgeo/cartesian/calculations.rb +36 -36
- data/lib/rgeo/cartesian/factory.rb +78 -78
- data/lib/rgeo/cartesian/feature_classes.rb +74 -74
- data/lib/rgeo/cartesian/feature_methods.rb +34 -34
- data/lib/rgeo/cartesian/interface.rb +33 -33
- data/lib/rgeo/coord_sys.rb +15 -15
- data/lib/rgeo/coord_sys/cs/entities.rb +533 -534
- data/lib/rgeo/coord_sys/cs/factories.rb +69 -69
- data/lib/rgeo/coord_sys/cs/wkt_parser.rb +44 -44
- data/lib/rgeo/coord_sys/proj4.rb +85 -85
- data/lib/rgeo/coord_sys/srs_database/active_record_table.rb +31 -31
- data/lib/rgeo/coord_sys/srs_database/interface.rb +44 -44
- data/lib/rgeo/coord_sys/srs_database/proj4_data.rb +31 -31
- data/lib/rgeo/coord_sys/srs_database/sr_org.rb +31 -31
- data/lib/rgeo/coord_sys/srs_database/url_reader.rb +29 -29
- data/lib/rgeo/error.rb +17 -17
- data/lib/rgeo/feature.rb +15 -15
- data/lib/rgeo/feature/curve.rb +58 -58
- data/lib/rgeo/feature/factory.rb +84 -84
- data/lib/rgeo/feature/factory_generator.rb +32 -32
- data/lib/rgeo/feature/geometry.rb +215 -215
- data/lib/rgeo/feature/geometry_collection.rb +46 -46
- data/lib/rgeo/feature/line.rb +21 -21
- data/lib/rgeo/feature/line_string.rb +35 -35
- data/lib/rgeo/feature/linear_ring.rb +20 -20
- data/lib/rgeo/feature/mixins.rb +61 -61
- data/lib/rgeo/feature/multi_curve.rb +37 -37
- data/lib/rgeo/feature/multi_line_string.rb +20 -20
- data/lib/rgeo/feature/multi_point.rb +22 -22
- data/lib/rgeo/feature/multi_polygon.rb +28 -28
- data/lib/rgeo/feature/multi_surface.rb +39 -39
- data/lib/rgeo/feature/point.rb +42 -42
- data/lib/rgeo/feature/polygon.rb +50 -50
- data/lib/rgeo/feature/surface.rb +42 -42
- data/lib/rgeo/feature/types.rb +58 -58
- data/lib/rgeo/geographic.rb +14 -14
- data/lib/rgeo/geographic/factory.rb +87 -87
- data/lib/rgeo/geographic/interface.rb +55 -55
- data/lib/rgeo/geographic/proj4_projector.rb +35 -35
- data/lib/rgeo/geographic/projected_feature_classes.rb +95 -95
- data/lib/rgeo/geographic/projected_feature_methods.rb +81 -81
- data/lib/rgeo/geographic/projected_window.rb +103 -103
- data/lib/rgeo/geographic/simple_mercator_projector.rb +32 -32
- data/lib/rgeo/geographic/spherical_feature_classes.rb +93 -93
- data/lib/rgeo/geographic/spherical_feature_methods.rb +25 -25
- data/lib/rgeo/geographic/spherical_math.rb +58 -58
- data/lib/rgeo/geos.rb +22 -17
- data/lib/rgeo/geos/factory.rb +93 -93
- data/lib/rgeo/geos/ffi_classes.rb +306 -231
- data/lib/rgeo/geos/ffi_factory.rb +100 -96
- data/lib/rgeo/geos/impl_additions.rb +22 -22
- data/lib/rgeo/geos/interface.rb +45 -45
- data/lib/rgeo/geos/zm_factory.rb +90 -90
- data/lib/rgeo/geos/zm_impl.rb +167 -167
- data/lib/rgeo/impl_helper.rb +11 -11
- data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +71 -71
- data/lib/rgeo/impl_helper/basic_geometry_methods.rb +29 -29
- data/lib/rgeo/impl_helper/basic_line_string_methods.rb +61 -61
- data/lib/rgeo/impl_helper/basic_point_methods.rb +43 -43
- data/lib/rgeo/impl_helper/basic_polygon_methods.rb +35 -35
- data/lib/rgeo/impl_helper/math.rb +13 -13
- data/lib/rgeo/version.rb +10 -10
- data/lib/rgeo/wkrep.rb +16 -16
- data/lib/rgeo/wkrep/wkb_generator.rb +51 -51
- data/lib/rgeo/wkrep/wkb_parser.rb +52 -52
- data/lib/rgeo/wkrep/wkt_generator.rb +51 -51
- data/lib/rgeo/wkrep/wkt_parser.rb +66 -66
- data/lib/rgeo/yaml.rb +14 -14
- data/test/common/geometry_collection_tests.rb +53 -53
- data/test/common/line_string_tests.rb +57 -57
- data/test/common/multi_line_string_tests.rb +43 -43
- data/test/common/multi_point_tests.rb +43 -43
- data/test/common/multi_polygon_tests.rb +43 -43
- data/test/common/point_tests.rb +75 -75
- data/test/common/polygon_tests.rb +37 -37
- data/test/coord_sys/tc_active_record_table.rb +25 -25
- data/test/coord_sys/tc_ogc_cs.rb +72 -72
- data/test/coord_sys/tc_proj4.rb +51 -51
- data/test/coord_sys/tc_proj4_srs_data.rb +17 -17
- data/test/coord_sys/tc_sr_org.rb +15 -15
- data/test/coord_sys/tc_url_reader.rb +19 -19
- data/test/geos_capi/tc_factory.rb +21 -21
- data/test/geos_capi/tc_geometry_collection.rb +15 -15
- data/test/geos_capi/tc_line_string.rb +15 -15
- data/test/geos_capi/tc_misc.rb +33 -22
- data/test/geos_capi/tc_multi_line_string.rb +15 -15
- data/test/geos_capi/tc_multi_point.rb +15 -15
- data/test/geos_capi/tc_multi_polygon.rb +15 -15
- data/test/geos_capi/tc_parsing_unparsing.rb +19 -19
- data/test/geos_capi/tc_point.rb +21 -21
- data/test/geos_capi/tc_polygon.rb +19 -19
- data/test/geos_capi/tc_zmfactory.rb +17 -17
- data/test/geos_ffi/tc_factory.rb +21 -21
- data/test/geos_ffi/tc_geometry_collection.rb +15 -15
- data/test/geos_ffi/tc_line_string.rb +15 -15
- data/test/geos_ffi/tc_misc.rb +49 -15
- data/test/geos_ffi/tc_multi_line_string.rb +15 -15
- data/test/geos_ffi/tc_multi_point.rb +15 -15
- data/test/geos_ffi/tc_multi_polygon.rb +15 -15
- data/test/geos_ffi/tc_parsing_unparsing.rb +19 -19
- data/test/geos_ffi/tc_point.rb +21 -21
- data/test/geos_ffi/tc_polygon.rb +19 -19
- data/test/geos_ffi/tc_zmfactory.rb +17 -17
- data/test/projected_geographic/tc_geometry_collection.rb +15 -15
- data/test/projected_geographic/tc_line_string.rb +15 -15
- data/test/projected_geographic/tc_multi_line_string.rb +15 -15
- data/test/projected_geographic/tc_multi_point.rb +15 -15
- data/test/projected_geographic/tc_multi_polygon.rb +15 -15
- data/test/projected_geographic/tc_point.rb +23 -23
- data/test/projected_geographic/tc_polygon.rb +15 -15
- data/test/simple_cartesian/tc_calculations.rb +31 -31
- data/test/simple_cartesian/tc_geometry_collection.rb +17 -17
- data/test/simple_cartesian/tc_line_string.rb +17 -17
- data/test/simple_cartesian/tc_multi_line_string.rb +17 -17
- data/test/simple_cartesian/tc_multi_point.rb +17 -17
- data/test/simple_cartesian/tc_multi_polygon.rb +17 -17
- data/test/simple_cartesian/tc_point.rb +21 -21
- data/test/simple_cartesian/tc_polygon.rb +17 -17
- data/test/simple_mercator/tc_geometry_collection.rb +15 -15
- data/test/simple_mercator/tc_line_string.rb +15 -15
- data/test/simple_mercator/tc_multi_line_string.rb +15 -15
- data/test/simple_mercator/tc_multi_point.rb +15 -15
- data/test/simple_mercator/tc_multi_polygon.rb +15 -15
- data/test/simple_mercator/tc_point.rb +23 -23
- data/test/simple_mercator/tc_polygon.rb +15 -15
- data/test/simple_mercator/tc_window.rb +50 -50
- data/test/spherical_geographic/tc_calculations.rb +47 -47
- data/test/spherical_geographic/tc_geometry_collection.rb +17 -17
- data/test/spherical_geographic/tc_line_string.rb +17 -17
- data/test/spherical_geographic/tc_multi_line_string.rb +17 -17
- data/test/spherical_geographic/tc_multi_point.rb +17 -17
- data/test/spherical_geographic/tc_multi_polygon.rb +17 -17
- data/test/spherical_geographic/tc_point.rb +23 -23
- data/test/spherical_geographic/tc_polygon.rb +17 -17
- data/test/tc_cartesian_analysis.rb +23 -23
- data/test/tc_mixins.rb +39 -39
- data/test/tc_oneoff.rb +15 -15
- data/test/tc_types.rb +17 -17
- data/test/wkrep/tc_wkb_generator.rb +67 -67
- data/test/wkrep/tc_wkb_parser.rb +73 -73
- data/test/wkrep/tc_wkt_generator.rb +75 -75
- data/test/wkrep/tc_wkt_parser.rb +97 -97
- metadata +3 -3
data/lib/rgeo/feature/mixins.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# -----------------------------------------------------------------------------
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Mixin tracker
|
4
|
-
#
|
4
|
+
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
|
-
# Copyright 2010 Daniel Azuma
|
7
|
-
#
|
6
|
+
# Copyright 2010-2012 Daniel Azuma
|
7
|
+
#
|
8
8
|
# All rights reserved.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# Redistribution and use in source and binary forms, with or without
|
11
11
|
# modification, are permitted provided that the following conditions are met:
|
12
|
-
#
|
12
|
+
#
|
13
13
|
# * Redistributions of source code must retain the above copyright notice,
|
14
14
|
# this list of conditions and the following disclaimer.
|
15
15
|
# * Redistributions in binary form must reproduce the above copyright notice,
|
@@ -18,7 +18,7 @@
|
|
18
18
|
# * Neither the name of the copyright holder, nor the names of any other
|
19
19
|
# contributors to this software, may be used to endorse or promote products
|
20
20
|
# derived from this software without specific prior written permission.
|
21
|
-
#
|
21
|
+
#
|
22
22
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
23
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
24
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
@@ -35,13 +35,13 @@
|
|
35
35
|
|
36
36
|
|
37
37
|
module RGeo
|
38
|
-
|
38
|
+
|
39
39
|
module Feature
|
40
|
-
|
41
|
-
|
40
|
+
|
41
|
+
|
42
42
|
# MixinCollection is a mechanism for adding arbitrary methods to
|
43
43
|
# geometry objects.
|
44
|
-
#
|
44
|
+
#
|
45
45
|
# Normally, geometry objects respond to the methods defined in the
|
46
46
|
# feature interface for that type of geometry; e.g.
|
47
47
|
# RGeo::Feature::Geometry, RGeo::Feature::Point, etc. Some
|
@@ -52,13 +52,13 @@ module RGeo
|
|
52
52
|
# add it to an appropriate MixinCollection. A MixinCollection is
|
53
53
|
# simply a collection of mixin Modules, connected to geometry types,
|
54
54
|
# that are included in objects of that type.
|
55
|
-
#
|
55
|
+
#
|
56
56
|
# There is a global collection, MixinCollection::GLOBAL, which
|
57
57
|
# manages mixins to be added to all implementations. In addition,
|
58
58
|
# individual implementation factories may provide additional local
|
59
59
|
# MixinCollection objects for mixins specific to objects created
|
60
60
|
# by that factory.
|
61
|
-
#
|
61
|
+
#
|
62
62
|
# Each mixin module added to a MixinCollection is connected to a
|
63
63
|
# specific type, which controls to which objects that mixin is added.
|
64
64
|
# For example, a mixin connected to Point is added only to Point
|
@@ -68,13 +68,13 @@ module RGeo
|
|
68
68
|
# To add a mixin to all objects, connect it to the Geometry base type.
|
69
69
|
|
70
70
|
class MixinCollection
|
71
|
-
|
72
|
-
|
71
|
+
|
72
|
+
|
73
73
|
# An API point controlling a particular type.
|
74
|
-
|
74
|
+
|
75
75
|
class TypeData
|
76
|
-
|
77
|
-
|
76
|
+
|
77
|
+
|
78
78
|
def initialize(collection_, type_) # :nodoc:
|
79
79
|
@collection = collection_
|
80
80
|
@type = type_
|
@@ -83,116 +83,116 @@ module RGeo
|
|
83
83
|
@rmixins = []
|
84
84
|
@rclasses = []
|
85
85
|
end
|
86
|
-
|
87
|
-
|
86
|
+
|
87
|
+
|
88
88
|
# The feature type
|
89
89
|
attr_reader :type
|
90
|
-
|
90
|
+
|
91
91
|
# The MixinCollection owning this data
|
92
92
|
attr_reader :collection
|
93
|
-
|
94
|
-
|
93
|
+
|
94
|
+
|
95
95
|
# Add a mixin to be included in implementations of this type.
|
96
|
-
|
96
|
+
|
97
97
|
def add(module_)
|
98
98
|
@mixins << module_
|
99
99
|
@classes.each{ |k_| k_.class_eval{ include(module_) } }
|
100
100
|
_radd(module_)
|
101
101
|
end
|
102
|
-
|
103
|
-
|
102
|
+
|
103
|
+
|
104
104
|
# A class that implements this type should call this method to
|
105
105
|
# get the appropriate mixins.
|
106
106
|
# If include_ancestry_ is set to true, then mixins connected to
|
107
107
|
# subtypes of this type are also added to the class.
|
108
|
-
|
108
|
+
|
109
109
|
def include_in_class(klass_, include_ancestry_=false)
|
110
110
|
(include_ancestry_ ? @rmixins : @mixins).each{ |m_| klass_.class_eval{ include(m_) } }
|
111
111
|
(include_ancestry_ ? @rclasses : @classes) << klass_
|
112
112
|
self
|
113
113
|
end
|
114
|
-
|
115
|
-
|
114
|
+
|
115
|
+
|
116
116
|
# An object that implements this type should call this method to
|
117
117
|
# get the appropriate mixins.
|
118
118
|
# If include_ancestry_ is set to true, then mixins connected to
|
119
119
|
# subtypes of this type are also added to the object.
|
120
|
-
|
120
|
+
|
121
121
|
def include_in_object(obj_, include_ancestry_=false)
|
122
122
|
(include_ancestry_ ? @rmixins : @mixins).each{ |m_| obj_.extend(m_) }
|
123
123
|
self
|
124
124
|
end
|
125
|
-
|
126
|
-
|
125
|
+
|
126
|
+
|
127
127
|
def _radd(module_) # :nodoc:
|
128
128
|
@rmixins << module_
|
129
129
|
@rclasses.each{ |k_| k_.class_eval{ include(module_) } }
|
130
130
|
@type.each_immediate_subtype{ |t_| @collection.for_type(t_)._radd(module_) }
|
131
131
|
self
|
132
132
|
end
|
133
|
-
|
134
|
-
|
133
|
+
|
134
|
+
|
135
135
|
end
|
136
|
-
|
137
|
-
|
136
|
+
|
137
|
+
|
138
138
|
# Create a new empty MixinCollection
|
139
|
-
|
139
|
+
|
140
140
|
def initialize
|
141
141
|
@types = {}
|
142
142
|
end
|
143
|
-
|
144
|
-
|
143
|
+
|
144
|
+
|
145
145
|
# Returns a TypeData for the given type.
|
146
|
-
#
|
146
|
+
#
|
147
147
|
# e.g. to add a module for point types, you can call:
|
148
148
|
# for_type(::RGeo::Feature::Point).add(module)
|
149
|
-
|
149
|
+
|
150
150
|
def for_type(type_)
|
151
151
|
(@types[type_] ||= TypeData.new(self, type_))
|
152
152
|
end
|
153
|
-
|
154
|
-
|
153
|
+
|
154
|
+
|
155
155
|
# Add a module connected to the given type.
|
156
|
-
#
|
156
|
+
#
|
157
157
|
# Shorthand for:
|
158
158
|
# for_type(type_).add(module_)
|
159
|
-
|
159
|
+
|
160
160
|
def add(type_, module_)
|
161
161
|
for_type(type_).add(module_)
|
162
162
|
end
|
163
|
-
|
164
|
-
|
163
|
+
|
164
|
+
|
165
165
|
# A class that implements this type should call this method to
|
166
166
|
# get the appropriate mixins.
|
167
|
-
#
|
167
|
+
#
|
168
168
|
# Shorthand for:
|
169
169
|
# for_type(type_).include_in_class(klass_, include_ancestry_)
|
170
|
-
|
170
|
+
|
171
171
|
def include_in_class(type_, klass_, include_ancestry_=false)
|
172
172
|
for_type(type_).include_in_class(klass_, include_ancestry_)
|
173
173
|
end
|
174
|
-
|
175
|
-
|
174
|
+
|
175
|
+
|
176
176
|
# An object that implements this type should call this method to
|
177
177
|
# get the appropriate mixins.
|
178
|
-
#
|
178
|
+
#
|
179
179
|
# Shorthand for:
|
180
180
|
# for_type(type_).include_in_object(obj_, include_ancestry_)
|
181
|
-
|
181
|
+
|
182
182
|
def include_in_object(type_, obj_, include_ancestry_=false)
|
183
183
|
for_type(type_).include_in_object(obj_, include_ancestry_)
|
184
184
|
end
|
185
|
-
|
186
|
-
|
185
|
+
|
186
|
+
|
187
187
|
# The global MixinCollection. Mixins added to this collection are
|
188
188
|
# added to all geometry objects for all implementations.
|
189
|
-
|
189
|
+
|
190
190
|
GLOBAL = MixinCollection.new
|
191
|
-
|
192
|
-
|
191
|
+
|
192
|
+
|
193
193
|
end
|
194
|
-
|
195
|
-
|
194
|
+
|
195
|
+
|
196
196
|
end
|
197
|
-
|
197
|
+
|
198
198
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
# -----------------------------------------------------------------------------
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# MultiCurve feature interface
|
4
|
-
#
|
4
|
+
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
|
-
# Copyright 2010 Daniel Azuma
|
7
|
-
#
|
6
|
+
# Copyright 2010-2012 Daniel Azuma
|
7
|
+
#
|
8
8
|
# All rights reserved.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# Redistribution and use in source and binary forms, with or without
|
11
11
|
# modification, are permitted provided that the following conditions are met:
|
12
|
-
#
|
12
|
+
#
|
13
13
|
# * Redistributions of source code must retain the above copyright notice,
|
14
14
|
# this list of conditions and the following disclaimer.
|
15
15
|
# * Redistributions in binary form must reproduce the above copyright notice,
|
@@ -18,7 +18,7 @@
|
|
18
18
|
# * Neither the name of the copyright holder, nor the names of any other
|
19
19
|
# contributors to this software, may be used to endorse or promote products
|
20
20
|
# derived from this software without specific prior written permission.
|
21
|
-
#
|
21
|
+
#
|
22
22
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
23
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
24
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
@@ -35,78 +35,78 @@
|
|
35
35
|
|
36
36
|
|
37
37
|
module RGeo
|
38
|
-
|
38
|
+
|
39
39
|
module Feature
|
40
|
-
|
41
|
-
|
40
|
+
|
41
|
+
|
42
42
|
# == SFS 1.1 Description
|
43
|
-
#
|
43
|
+
#
|
44
44
|
# A MultiCurve is a 1-dimensional GeometryCollection whose elements are
|
45
45
|
# Curves.
|
46
|
-
#
|
46
|
+
#
|
47
47
|
# MultiCurve is a non-instantiable class in this specification; it
|
48
48
|
# defines a set of methods for its subclasses and is included for
|
49
49
|
# reasons of extensibility.
|
50
|
-
#
|
50
|
+
#
|
51
51
|
# A MultiCurve is simple if and only if all of its elements are simple
|
52
52
|
# and the only intersections between any two elements occur at Points
|
53
53
|
# that are on the boundaries of both elements.
|
54
|
-
#
|
54
|
+
#
|
55
55
|
# The boundary of a MultiCurve is obtained by applying the "mod 2"
|
56
56
|
# union rule: A Point is in the boundary of a MultiCurve if it is in
|
57
57
|
# the boundaries of an odd number of elements of the MultiCurve.
|
58
|
-
#
|
58
|
+
#
|
59
59
|
# A MultiCurve is closed if all of its elements are closed. The
|
60
60
|
# boundary of a closed MultiCurve is always empty.
|
61
|
-
#
|
61
|
+
#
|
62
62
|
# A MultiCurve is defined as topologically closed.
|
63
|
-
#
|
63
|
+
#
|
64
64
|
# == Notes
|
65
|
-
#
|
65
|
+
#
|
66
66
|
# MultiCurve is defined as a module and is provided primarily
|
67
67
|
# for the sake of documentation. Implementations need not necessarily
|
68
68
|
# include this module itself. Therefore, you should not depend on the
|
69
69
|
# kind_of? method to check type. Instead, use the provided check_type
|
70
70
|
# class method (or === operator) defined in the Type module.
|
71
|
-
|
71
|
+
|
72
72
|
module MultiCurve
|
73
|
-
|
73
|
+
|
74
74
|
include GeometryCollection
|
75
75
|
extend Type
|
76
|
-
|
77
|
-
|
76
|
+
|
77
|
+
|
78
78
|
# === SFS 1.1 Description
|
79
|
-
#
|
79
|
+
#
|
80
80
|
# The Length of this MultiCurve which is equal to the sum of the
|
81
81
|
# lengths of the element Curves.
|
82
|
-
#
|
82
|
+
#
|
83
83
|
# === Notes
|
84
|
-
#
|
84
|
+
#
|
85
85
|
# Returns a floating-point scalar value.
|
86
|
-
|
86
|
+
|
87
87
|
def length
|
88
88
|
raise Error::UnsupportedOperation, "Method MultiCurve#length not defined."
|
89
89
|
end
|
90
|
-
|
91
|
-
|
90
|
+
|
91
|
+
|
92
92
|
# === SFS 1.1 Description
|
93
|
-
#
|
93
|
+
#
|
94
94
|
# Returns true if this MultiCurve is closed [StartPoint() = EndPoint()
|
95
95
|
# for each Curve in this MultiCurve].
|
96
|
-
#
|
96
|
+
#
|
97
97
|
# === Notes
|
98
|
-
#
|
98
|
+
#
|
99
99
|
# Returns a boolean value. Note that this is different from the SFS
|
100
100
|
# specification, which stipulates an integer return value.
|
101
|
-
|
101
|
+
|
102
102
|
def is_closed?
|
103
103
|
raise Error::UnsupportedOperation, "Method MultiCurve#is_closed? not defined."
|
104
104
|
end
|
105
|
-
|
106
|
-
|
105
|
+
|
106
|
+
|
107
107
|
end
|
108
|
-
|
109
|
-
|
108
|
+
|
109
|
+
|
110
110
|
end
|
111
|
-
|
111
|
+
|
112
112
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
# -----------------------------------------------------------------------------
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# MultiLineString feature interface
|
4
|
-
#
|
4
|
+
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
|
-
# Copyright 2010 Daniel Azuma
|
7
|
-
#
|
6
|
+
# Copyright 2010-2012 Daniel Azuma
|
7
|
+
#
|
8
8
|
# All rights reserved.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# Redistribution and use in source and binary forms, with or without
|
11
11
|
# modification, are permitted provided that the following conditions are met:
|
12
|
-
#
|
12
|
+
#
|
13
13
|
# * Redistributions of source code must retain the above copyright notice,
|
14
14
|
# this list of conditions and the following disclaimer.
|
15
15
|
# * Redistributions in binary form must reproduce the above copyright notice,
|
@@ -18,7 +18,7 @@
|
|
18
18
|
# * Neither the name of the copyright holder, nor the names of any other
|
19
19
|
# contributors to this software, may be used to endorse or promote products
|
20
20
|
# derived from this software without specific prior written permission.
|
21
|
-
#
|
21
|
+
#
|
22
22
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
23
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
24
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
@@ -35,31 +35,31 @@
|
|
35
35
|
|
36
36
|
|
37
37
|
module RGeo
|
38
|
-
|
38
|
+
|
39
39
|
module Feature
|
40
|
-
|
41
|
-
|
40
|
+
|
41
|
+
|
42
42
|
# == SFS 1.1 Description
|
43
|
-
#
|
43
|
+
#
|
44
44
|
# A MultiLineString is a MultiCurve whose elements are LineStrings.
|
45
|
-
#
|
45
|
+
#
|
46
46
|
# == Notes
|
47
|
-
#
|
47
|
+
#
|
48
48
|
# MultiLineString is defined as a module and is provided primarily
|
49
49
|
# for the sake of documentation. Implementations need not necessarily
|
50
50
|
# include this module itself. Therefore, you should not depend on the
|
51
51
|
# kind_of? method to check type. Instead, use the provided check_type
|
52
52
|
# class method (or === operator) defined in the Type module.
|
53
|
-
|
53
|
+
|
54
54
|
module MultiLineString
|
55
|
-
|
55
|
+
|
56
56
|
include MultiCurve
|
57
57
|
extend Type
|
58
|
-
|
59
|
-
|
58
|
+
|
59
|
+
|
60
60
|
end
|
61
|
-
|
62
|
-
|
61
|
+
|
62
|
+
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
end
|