rgeo 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. data/History.rdoc +6 -0
  2. data/README.rdoc +1 -1
  3. data/Version +1 -1
  4. data/ext/geos_c_impl/extconf.rb +13 -13
  5. data/ext/geos_c_impl/factory.c +30 -18
  6. data/ext/geos_c_impl/factory.h +18 -12
  7. data/ext/geos_c_impl/geometry.c +11 -11
  8. data/ext/geos_c_impl/geometry.h +7 -7
  9. data/ext/geos_c_impl/geometry_collection.c +15 -15
  10. data/ext/geos_c_impl/geometry_collection.h +8 -8
  11. data/ext/geos_c_impl/line_string.c +14 -14
  12. data/ext/geos_c_impl/line_string.h +7 -7
  13. data/ext/geos_c_impl/main.c +7 -7
  14. data/ext/geos_c_impl/point.c +9 -9
  15. data/ext/geos_c_impl/point.h +7 -7
  16. data/ext/geos_c_impl/polygon.c +9 -9
  17. data/ext/geos_c_impl/polygon.h +7 -7
  18. data/ext/geos_c_impl/preface.h +7 -7
  19. data/ext/proj4_c_impl/extconf.rb +13 -13
  20. data/ext/proj4_c_impl/main.c +12 -12
  21. data/lib/rgeo.rb +26 -26
  22. data/lib/rgeo/cartesian.rb +12 -12
  23. data/lib/rgeo/cartesian/analysis.rb +26 -26
  24. data/lib/rgeo/cartesian/bounding_box.rb +83 -83
  25. data/lib/rgeo/cartesian/calculations.rb +36 -36
  26. data/lib/rgeo/cartesian/factory.rb +78 -78
  27. data/lib/rgeo/cartesian/feature_classes.rb +74 -74
  28. data/lib/rgeo/cartesian/feature_methods.rb +34 -34
  29. data/lib/rgeo/cartesian/interface.rb +33 -33
  30. data/lib/rgeo/coord_sys.rb +15 -15
  31. data/lib/rgeo/coord_sys/cs/entities.rb +533 -534
  32. data/lib/rgeo/coord_sys/cs/factories.rb +69 -69
  33. data/lib/rgeo/coord_sys/cs/wkt_parser.rb +44 -44
  34. data/lib/rgeo/coord_sys/proj4.rb +85 -85
  35. data/lib/rgeo/coord_sys/srs_database/active_record_table.rb +31 -31
  36. data/lib/rgeo/coord_sys/srs_database/interface.rb +44 -44
  37. data/lib/rgeo/coord_sys/srs_database/proj4_data.rb +31 -31
  38. data/lib/rgeo/coord_sys/srs_database/sr_org.rb +31 -31
  39. data/lib/rgeo/coord_sys/srs_database/url_reader.rb +29 -29
  40. data/lib/rgeo/error.rb +17 -17
  41. data/lib/rgeo/feature.rb +15 -15
  42. data/lib/rgeo/feature/curve.rb +58 -58
  43. data/lib/rgeo/feature/factory.rb +84 -84
  44. data/lib/rgeo/feature/factory_generator.rb +32 -32
  45. data/lib/rgeo/feature/geometry.rb +215 -215
  46. data/lib/rgeo/feature/geometry_collection.rb +46 -46
  47. data/lib/rgeo/feature/line.rb +21 -21
  48. data/lib/rgeo/feature/line_string.rb +35 -35
  49. data/lib/rgeo/feature/linear_ring.rb +20 -20
  50. data/lib/rgeo/feature/mixins.rb +61 -61
  51. data/lib/rgeo/feature/multi_curve.rb +37 -37
  52. data/lib/rgeo/feature/multi_line_string.rb +20 -20
  53. data/lib/rgeo/feature/multi_point.rb +22 -22
  54. data/lib/rgeo/feature/multi_polygon.rb +28 -28
  55. data/lib/rgeo/feature/multi_surface.rb +39 -39
  56. data/lib/rgeo/feature/point.rb +42 -42
  57. data/lib/rgeo/feature/polygon.rb +50 -50
  58. data/lib/rgeo/feature/surface.rb +42 -42
  59. data/lib/rgeo/feature/types.rb +58 -58
  60. data/lib/rgeo/geographic.rb +14 -14
  61. data/lib/rgeo/geographic/factory.rb +87 -87
  62. data/lib/rgeo/geographic/interface.rb +55 -55
  63. data/lib/rgeo/geographic/proj4_projector.rb +35 -35
  64. data/lib/rgeo/geographic/projected_feature_classes.rb +95 -95
  65. data/lib/rgeo/geographic/projected_feature_methods.rb +81 -81
  66. data/lib/rgeo/geographic/projected_window.rb +103 -103
  67. data/lib/rgeo/geographic/simple_mercator_projector.rb +32 -32
  68. data/lib/rgeo/geographic/spherical_feature_classes.rb +93 -93
  69. data/lib/rgeo/geographic/spherical_feature_methods.rb +25 -25
  70. data/lib/rgeo/geographic/spherical_math.rb +58 -58
  71. data/lib/rgeo/geos.rb +22 -17
  72. data/lib/rgeo/geos/factory.rb +93 -93
  73. data/lib/rgeo/geos/ffi_classes.rb +306 -231
  74. data/lib/rgeo/geos/ffi_factory.rb +100 -96
  75. data/lib/rgeo/geos/impl_additions.rb +22 -22
  76. data/lib/rgeo/geos/interface.rb +45 -45
  77. data/lib/rgeo/geos/zm_factory.rb +90 -90
  78. data/lib/rgeo/geos/zm_impl.rb +167 -167
  79. data/lib/rgeo/impl_helper.rb +11 -11
  80. data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +71 -71
  81. data/lib/rgeo/impl_helper/basic_geometry_methods.rb +29 -29
  82. data/lib/rgeo/impl_helper/basic_line_string_methods.rb +61 -61
  83. data/lib/rgeo/impl_helper/basic_point_methods.rb +43 -43
  84. data/lib/rgeo/impl_helper/basic_polygon_methods.rb +35 -35
  85. data/lib/rgeo/impl_helper/math.rb +13 -13
  86. data/lib/rgeo/version.rb +10 -10
  87. data/lib/rgeo/wkrep.rb +16 -16
  88. data/lib/rgeo/wkrep/wkb_generator.rb +51 -51
  89. data/lib/rgeo/wkrep/wkb_parser.rb +52 -52
  90. data/lib/rgeo/wkrep/wkt_generator.rb +51 -51
  91. data/lib/rgeo/wkrep/wkt_parser.rb +66 -66
  92. data/lib/rgeo/yaml.rb +14 -14
  93. data/test/common/geometry_collection_tests.rb +53 -53
  94. data/test/common/line_string_tests.rb +57 -57
  95. data/test/common/multi_line_string_tests.rb +43 -43
  96. data/test/common/multi_point_tests.rb +43 -43
  97. data/test/common/multi_polygon_tests.rb +43 -43
  98. data/test/common/point_tests.rb +75 -75
  99. data/test/common/polygon_tests.rb +37 -37
  100. data/test/coord_sys/tc_active_record_table.rb +25 -25
  101. data/test/coord_sys/tc_ogc_cs.rb +72 -72
  102. data/test/coord_sys/tc_proj4.rb +51 -51
  103. data/test/coord_sys/tc_proj4_srs_data.rb +17 -17
  104. data/test/coord_sys/tc_sr_org.rb +15 -15
  105. data/test/coord_sys/tc_url_reader.rb +19 -19
  106. data/test/geos_capi/tc_factory.rb +21 -21
  107. data/test/geos_capi/tc_geometry_collection.rb +15 -15
  108. data/test/geos_capi/tc_line_string.rb +15 -15
  109. data/test/geos_capi/tc_misc.rb +33 -22
  110. data/test/geos_capi/tc_multi_line_string.rb +15 -15
  111. data/test/geos_capi/tc_multi_point.rb +15 -15
  112. data/test/geos_capi/tc_multi_polygon.rb +15 -15
  113. data/test/geos_capi/tc_parsing_unparsing.rb +19 -19
  114. data/test/geos_capi/tc_point.rb +21 -21
  115. data/test/geos_capi/tc_polygon.rb +19 -19
  116. data/test/geos_capi/tc_zmfactory.rb +17 -17
  117. data/test/geos_ffi/tc_factory.rb +21 -21
  118. data/test/geos_ffi/tc_geometry_collection.rb +15 -15
  119. data/test/geos_ffi/tc_line_string.rb +15 -15
  120. data/test/geos_ffi/tc_misc.rb +49 -15
  121. data/test/geos_ffi/tc_multi_line_string.rb +15 -15
  122. data/test/geos_ffi/tc_multi_point.rb +15 -15
  123. data/test/geos_ffi/tc_multi_polygon.rb +15 -15
  124. data/test/geos_ffi/tc_parsing_unparsing.rb +19 -19
  125. data/test/geos_ffi/tc_point.rb +21 -21
  126. data/test/geos_ffi/tc_polygon.rb +19 -19
  127. data/test/geos_ffi/tc_zmfactory.rb +17 -17
  128. data/test/projected_geographic/tc_geometry_collection.rb +15 -15
  129. data/test/projected_geographic/tc_line_string.rb +15 -15
  130. data/test/projected_geographic/tc_multi_line_string.rb +15 -15
  131. data/test/projected_geographic/tc_multi_point.rb +15 -15
  132. data/test/projected_geographic/tc_multi_polygon.rb +15 -15
  133. data/test/projected_geographic/tc_point.rb +23 -23
  134. data/test/projected_geographic/tc_polygon.rb +15 -15
  135. data/test/simple_cartesian/tc_calculations.rb +31 -31
  136. data/test/simple_cartesian/tc_geometry_collection.rb +17 -17
  137. data/test/simple_cartesian/tc_line_string.rb +17 -17
  138. data/test/simple_cartesian/tc_multi_line_string.rb +17 -17
  139. data/test/simple_cartesian/tc_multi_point.rb +17 -17
  140. data/test/simple_cartesian/tc_multi_polygon.rb +17 -17
  141. data/test/simple_cartesian/tc_point.rb +21 -21
  142. data/test/simple_cartesian/tc_polygon.rb +17 -17
  143. data/test/simple_mercator/tc_geometry_collection.rb +15 -15
  144. data/test/simple_mercator/tc_line_string.rb +15 -15
  145. data/test/simple_mercator/tc_multi_line_string.rb +15 -15
  146. data/test/simple_mercator/tc_multi_point.rb +15 -15
  147. data/test/simple_mercator/tc_multi_polygon.rb +15 -15
  148. data/test/simple_mercator/tc_point.rb +23 -23
  149. data/test/simple_mercator/tc_polygon.rb +15 -15
  150. data/test/simple_mercator/tc_window.rb +50 -50
  151. data/test/spherical_geographic/tc_calculations.rb +47 -47
  152. data/test/spherical_geographic/tc_geometry_collection.rb +17 -17
  153. data/test/spherical_geographic/tc_line_string.rb +17 -17
  154. data/test/spherical_geographic/tc_multi_line_string.rb +17 -17
  155. data/test/spherical_geographic/tc_multi_point.rb +17 -17
  156. data/test/spherical_geographic/tc_multi_polygon.rb +17 -17
  157. data/test/spherical_geographic/tc_point.rb +23 -23
  158. data/test/spherical_geographic/tc_polygon.rb +17 -17
  159. data/test/tc_cartesian_analysis.rb +23 -23
  160. data/test/tc_mixins.rb +39 -39
  161. data/test/tc_oneoff.rb +15 -15
  162. data/test/tc_types.rb +17 -17
  163. data/test/wkrep/tc_wkb_generator.rb +67 -67
  164. data/test/wkrep/tc_wkb_parser.rb +73 -73
  165. data/test/wkrep/tc_wkt_generator.rb +75 -75
  166. data/test/wkrep/tc_wkt_parser.rb +97 -97
  167. metadata +3 -3
@@ -1,15 +1,15 @@
1
1
  # -----------------------------------------------------------------------------
2
- #
2
+ #
3
3
  # Feature factory 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,39 +35,39 @@
35
35
 
36
36
 
37
37
  module RGeo
38
-
38
+
39
39
  module Feature
40
-
41
-
40
+
41
+
42
42
  # A FactoryGenerator is a callable object (usually a Proc) that
43
43
  # takes a configuration as a hash and returns a factory. These are
44
44
  # often used, e.g., by parsers to determine what factory the parsed
45
45
  # geometry should have.
46
- #
46
+ #
47
47
  # See the call method for a list of common configuration parameters.
48
48
  # Different generators will support different parameters. There is
49
49
  # no mechanism defined to reflect on the parameters understood by a
50
50
  # factory generator.
51
- #
51
+ #
52
52
  # Many of the implementations provide a factory method for creating
53
53
  # factories. For example, RGeo::Cartesian.preferred_factory can be
54
54
  # called to create a factory using the preferred Cartesian
55
55
  # implementation. Thus, to get a corresponding factory generator,
56
56
  # you can use the <tt>method</tt> method. e.g.
57
- #
57
+ #
58
58
  # factory_generator = ::RGeo::Cartesian.method(:preferred_factory)
59
- #
59
+ #
60
60
  # FactoryGenerator is defined as a module and is provided
61
61
  # primarily for the sake of documentation. Implementations need not
62
62
  # necessarily include this module itself. Therefore, you should not
63
63
  # depend on the kind_of? method to determine if an object is a
64
64
  # factory generator.
65
-
65
+
66
66
  module FactoryGenerator
67
-
68
-
67
+
68
+
69
69
  # Generate a factory given a configuration as a hash.
70
- #
70
+ #
71
71
  # If the generator does not recognize or does not support a given
72
72
  # configuration value, the behavior is usually determined by the
73
73
  # <tt>:strict</tt> configuration element. If <tt>strict</tt> is
@@ -75,11 +75,11 @@ module RGeo
75
75
  # raising an exception. If it is set to false, the generator should
76
76
  # attempt to do the best it can, even if it means returning a
77
77
  # factory that does not match the requested configuration.
78
- #
78
+ #
79
79
  # Common parameters are as follows. These are intended as a
80
80
  # recommendation only. There is no hard requirement for any
81
81
  # particular factory generator to support them.
82
- #
82
+ #
83
83
  # [<tt>:strict</tt>]
84
84
  # If true, return nil or raise an exception if any configuration
85
85
  # was not recognized or not supportable. Otherwise, if false,
@@ -106,33 +106,33 @@ module RGeo
106
106
  # Support Z coordinates. Default is usually false.
107
107
  # [<tt>:has_m_coordinate</tt>]
108
108
  # Support M coordinates. Default is usually false.
109
-
109
+
110
110
  def call(config_={})
111
111
  nil
112
112
  end
113
-
114
-
113
+
114
+
115
115
  # Return a new FactoryGenerator that always returns the given
116
116
  # factory.
117
-
117
+
118
118
  def self.single(factory_)
119
119
  ::Proc.new{ |c_| factory_ }
120
120
  end
121
-
122
-
121
+
122
+
123
123
  # Return a new FactoryGenerator that calls the given delegate, but
124
124
  # modifies the configuration passed to it. You can provide defaults
125
125
  # for configuration values not explicitly specified, and you can
126
126
  # force certain values to override the given configuration.
127
-
127
+
128
128
  def self.decorate(delegate_, default_config_={}, force_config_={})
129
129
  ::Proc.new{ |c_| delegate_.call(default_config_.merge(c_).merge(force_config_)) }
130
130
  end
131
-
132
-
131
+
132
+
133
133
  end
134
-
135
-
134
+
135
+
136
136
  end
137
-
137
+
138
138
  end
@@ -1,15 +1,15 @@
1
1
  # -----------------------------------------------------------------------------
2
- #
2
+ #
3
3
  # Geometry 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,40 +35,40 @@
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
  # Geometry is the root class of the hierarchy. Geometry is an abstract
45
45
  # (non-instantiable) class.
46
- #
46
+ #
47
47
  # The instantiable subclasses of Geometry defined in this International
48
48
  # Standard are restricted to 0, 1 and 2-dimensional geometric objects
49
49
  # that exist in 2-dimensional coordinate space (R2).
50
- #
50
+ #
51
51
  # All instantiable Geometry classes described in this part of ISO 19125
52
52
  # are defined so that valid instances of a Geometry class are
53
53
  # topologically closed, i.e. all defined geometries include their
54
54
  # boundary.
55
- #
55
+ #
56
56
  # == Notes
57
- #
57
+ #
58
58
  # Geometry is defined as a module and is provided primarily for the
59
59
  # sake of documentation. Implementations need not necessarily include
60
60
  # this module itself. Therefore, you should not depend on the result
61
61
  # of <tt>is_a?(Geometry)</tt> to check type. Instead, use the
62
62
  # provided check_type class method (or === operator) defined in the
63
63
  # Type module.
64
- #
64
+ #
65
65
  # Some implementations may support higher dimensional objects or
66
66
  # coordinate systems, despite the limits of the SFS.
67
- #
67
+ #
68
68
  # == Forms of equivalence
69
- #
69
+ #
70
70
  # The Geometry model defines three forms of equivalence.
71
- #
71
+ #
72
72
  # * <b>Spatial equivalence</b> is the weakest form of equivalence,
73
73
  # indicating that the objects represent the same region of space,
74
74
  # but may be different representations of that region. For example,
@@ -77,8 +77,8 @@ module RGeo
77
77
  # GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0, 10 10, 0 0)).
78
78
  # As a general rule, objects must have factories that are
79
79
  # Factory#eql? in order to be spatially equivalent.
80
- #
81
- # * <b>Objective equivalence</b> is a stronger form of equivalence,
80
+ #
81
+ # * <b>Objective equivalence</b> is a stronger form of equivalence,
82
82
  # indicating that the objects are the same representation, but may
83
83
  # be different objects. All objectively equivalent objects are
84
84
  # spatially equivalent, but not all spatially equivalent objects are
@@ -86,543 +86,543 @@ module RGeo
86
86
  # spatial equivalence section above are objectively equivalent.
87
87
  # However, two separate objects that both represent POINT(1 2) are
88
88
  # objectively equivalent as well as spatially equivalent.
89
- #
89
+ #
90
90
  # * <b>Objective identity</b> is the strongest form, indicating that
91
91
  # the references refer to the same object. Of course, all pairs of
92
92
  # references with the same objective identity are both objectively
93
93
  # equivalent and spatially equivalent.
94
- #
94
+ #
95
95
  # Different methods test for different types of equivalence:
96
- #
96
+ #
97
97
  # * <tt>equals?</tt> and <tt>==</tt> test for spatial equivalence.
98
98
  # * <tt>eql?</tt> tests for objective equivalence.
99
99
  # * <tt>equal?</tt> tests for objective identity.
100
-
100
+
101
101
  module Geometry
102
-
102
+
103
103
  extend Type
104
-
105
-
104
+
105
+
106
106
  # Returns a factory for creating features related to this one.
107
107
  # This does not necessarily need to be the same factory that created
108
108
  # this object, but it should create objects that are "compatible"
109
109
  # with this one. (i.e. they should be in the same spatial reference
110
110
  # system by default, and it should be possible to perform relational
111
111
  # operations on them.)
112
-
112
+
113
113
  def factory
114
114
  raise Error::UnsupportedOperation, "Method Geometry#factory not defined."
115
115
  end
116
-
117
-
116
+
117
+
118
118
  # Returns true if this geometric object is objectively equivalent
119
119
  # to the given object.
120
-
120
+
121
121
  def eql?(another_geometry_)
122
122
  raise Error::UnsupportedOperation, "Method Geometry#eql? not defined."
123
123
  end
124
-
125
-
124
+
125
+
126
126
  # === SFS 1.1 Description
127
- #
127
+ #
128
128
  # The inherent dimension of this geometric object, which must be less
129
129
  # than or equal to the coordinate dimension. This specification is
130
130
  # restricted to geometries in 2-dimensional coordinate space.
131
- #
131
+ #
132
132
  # === Notes
133
- #
133
+ #
134
134
  # Returns an integer. This value is -1 for an empty geometry, 0 for
135
135
  # point geometries, 1 for curves, and 2 for surfaces.
136
-
136
+
137
137
  def dimension
138
138
  raise Error::UnsupportedOperation, "Method Geometry#dimension not defined."
139
139
  end
140
-
141
-
140
+
141
+
142
142
  # === SFS 1.1 Description
143
- #
143
+ #
144
144
  # Returns the instantiable subtype of Geometry of which this
145
145
  # geometric object is an instantiable member.
146
- #
146
+ #
147
147
  # === Notes
148
- #
148
+ #
149
149
  # Returns one of the type modules in RGeo::Feature. e.g. a point
150
150
  # object would return RGeo::Feature::Point. Note that this is
151
151
  # different from the SFS specification, which stipulates that the
152
152
  # string name of the type is returned. To obtain the name string,
153
153
  # call the +type_name+ method of the returned module.
154
-
154
+
155
155
  def geometry_type
156
156
  raise Error::UnsupportedOperation, "Method Geometry#geometry_type not defined."
157
157
  end
158
-
159
-
158
+
159
+
160
160
  # === SFS 1.1 Description
161
- #
161
+ #
162
162
  # Returns the Spatial Reference System ID for this geometric object.
163
- #
163
+ #
164
164
  # === Notes
165
- #
165
+ #
166
166
  # Returns an integer.
167
- #
167
+ #
168
168
  # This will normally be a foreign key to an index of reference systems
169
169
  # stored in either the same or some other datastore.
170
-
170
+
171
171
  def srid
172
172
  raise Error::UnsupportedOperation, "Method Geometry#srid not defined."
173
173
  end
174
-
175
-
174
+
175
+
176
176
  # === SFS 1.1 Description
177
- #
177
+ #
178
178
  # The minimum bounding box for this Geometry, returned as a Geometry.
179
179
  # The polygon is defined by the corner points of the bounding box
180
180
  # [(MINX, MINY), (MAXX, MINY), (MAXX, MAXY), (MINX, MAXY), (MINX, MINY)].
181
- #
181
+ #
182
182
  # === Notes
183
- #
183
+ #
184
184
  # Returns an object that supports the Geometry interface.
185
-
185
+
186
186
  def envelope
187
187
  raise Error::UnsupportedOperation, "Method Geometry#envelope not defined."
188
188
  end
189
-
190
-
189
+
190
+
191
191
  # === SFS 1.1 Description
192
- #
192
+ #
193
193
  # Exports this geometric object to a specific Well-known Text
194
194
  # Representation of Geometry.
195
- #
195
+ #
196
196
  # === Notes
197
- #
197
+ #
198
198
  # Returns an ASCII string.
199
-
199
+
200
200
  def as_text
201
201
  raise Error::UnsupportedOperation, "Method Geometry#as_text not defined."
202
202
  end
203
-
204
-
203
+
204
+
205
205
  # === SFS 1.1 Description
206
- #
206
+ #
207
207
  # Exports this geometric object to a specific Well-known Binary
208
208
  # Representation of Geometry.
209
- #
209
+ #
210
210
  # === Notes
211
- #
211
+ #
212
212
  # Returns a binary string.
213
-
213
+
214
214
  def as_binary
215
215
  raise Error::UnsupportedOperation, "Method Geometry#as_binary not defined."
216
216
  end
217
-
218
-
217
+
218
+
219
219
  # === SFS 1.1 Description
220
- #
220
+ #
221
221
  # Returns true if this geometric object is the empty Geometry. If true,
222
222
  # then this geometric object represents the empty point set for the
223
223
  # coordinate space.
224
- #
224
+ #
225
225
  # === Notes
226
- #
226
+ #
227
227
  # Returns a boolean value. Note that this is different from the SFS
228
228
  # specification, which stipulates an integer return value.
229
-
229
+
230
230
  def is_empty?
231
231
  raise Error::UnsupportedOperation, "Method Geometry#is_empty? not defined."
232
232
  end
233
-
234
-
233
+
234
+
235
235
  # === SFS 1.1 Description
236
- #
236
+ #
237
237
  # Returns true if this geometric object has no anomalous geometric
238
238
  # points, such as self intersection or self tangency. The description
239
239
  # of each instantiable geometric class will include the specific
240
240
  # conditions that cause an instance of that class to be classified as
241
241
  # not simple.
242
- #
242
+ #
243
243
  # === Notes
244
- #
244
+ #
245
245
  # Returns a boolean value. Note that this is different from the SFS
246
246
  # specification, which stipulates an integer return value.
247
-
247
+
248
248
  def is_simple?
249
249
  raise Error::UnsupportedOperation, "Method Geometry#is_simple? not defined."
250
250
  end
251
-
252
-
251
+
252
+
253
253
  # === SFS 1.1 Description
254
- #
254
+ #
255
255
  # Returns the closure of the combinatorial boundary of this geometric
256
256
  # object. Because the result of this function is a closure, and hence
257
257
  # topologically closed, the resulting boundary can be represented using
258
258
  # representational Geometry primitives.
259
- #
259
+ #
260
260
  # === Notes
261
- #
261
+ #
262
262
  # Returns an object that supports the Geometry interface.
263
-
263
+
264
264
  def boundary
265
265
  raise Error::UnsupportedOperation, "Method Geometry#boundary not defined."
266
266
  end
267
-
268
-
267
+
268
+
269
269
  # === SFS 1.1 Description
270
- #
270
+ #
271
271
  # Returns true if this geometric object is "spatially equal" to
272
272
  # another_geometry.
273
- #
273
+ #
274
274
  # === Notes
275
- #
275
+ #
276
276
  # Returns a boolean value. Note that this is different from the SFS
277
277
  # specification, which stipulates an integer return value.
278
- #
278
+ #
279
279
  # Although implementations are free to attempt to handle
280
280
  # another_geometry values that do not share the same factory as
281
281
  # this geometry, strictly speaking, the result of comparing objects
282
282
  # of different factories is undefined.
283
-
283
+
284
284
  def equals?(another_geometry_)
285
285
  raise Error::UnsupportedOperation, "Method Geometry#equals? not defined."
286
286
  end
287
-
288
-
287
+
288
+
289
289
  # === SFS 1.1 Description
290
- #
290
+ #
291
291
  # Returns true if this geometric object is "spatially disjoint" from
292
292
  # another_geometry.
293
- #
293
+ #
294
294
  # === Notes
295
- #
295
+ #
296
296
  # Returns a boolean value. Note that this is different from the SFS
297
297
  # specification, which stipulates an integer return value.
298
- #
298
+ #
299
299
  # Although implementations are free to attempt to handle
300
300
  # another_geometry values that do not share the same factory as
301
301
  # this geometry, strictly speaking, the result of comparing objects
302
302
  # of different factories is undefined.
303
-
303
+
304
304
  def disjoint?(another_geometry_)
305
305
  raise Error::UnsupportedOperation, "Method Geometry#disjoint? not defined."
306
306
  end
307
-
308
-
307
+
308
+
309
309
  # === SFS 1.1 Description
310
- #
310
+ #
311
311
  # Returns true if this geometric object "spatially intersects"
312
312
  # another_geometry.
313
- #
313
+ #
314
314
  # === Notes
315
- #
315
+ #
316
316
  # Returns a boolean value. Note that this is different from the SFS
317
317
  # specification, which stipulates an integer return value.
318
- #
318
+ #
319
319
  # Although implementations are free to attempt to handle
320
320
  # another_geometry values that do not share the same factory as
321
321
  # this geometry, strictly speaking, the result of comparing objects
322
322
  # of different factories is undefined.
323
-
323
+
324
324
  def intersects?(another_geometry_)
325
325
  raise Error::UnsupportedOperation, "Method Geometry#intersects? not defined."
326
326
  end
327
-
328
-
327
+
328
+
329
329
  # === SFS 1.1 Description
330
- #
330
+ #
331
331
  # Returns true if this geometric object "spatially touches"
332
332
  # another_geometry.
333
- #
333
+ #
334
334
  # === Notes
335
- #
335
+ #
336
336
  # Returns a boolean value. Note that this is different from the SFS
337
337
  # specification, which stipulates an integer return value.
338
- #
338
+ #
339
339
  # Although implementations are free to attempt to handle
340
340
  # another_geometry values that do not share the same factory as
341
341
  # this geometry, strictly speaking, the result of comparing objects
342
342
  # of different factories is undefined.
343
-
343
+
344
344
  def touches?(another_geometry_)
345
345
  raise Error::UnsupportedOperation, "Method Geometry#touches? not defined."
346
346
  end
347
-
348
-
347
+
348
+
349
349
  # === SFS 1.1 Description
350
- #
350
+ #
351
351
  # Returns true if this geometric object "spatially crosses"
352
352
  # another_geometry.
353
- #
353
+ #
354
354
  # === Notes
355
- #
355
+ #
356
356
  # Returns a boolean value. Note that this is different from the SFS
357
357
  # specification, which stipulates an integer return value.
358
- #
358
+ #
359
359
  # Although implementations are free to attempt to handle
360
360
  # another_geometry values that do not share the same factory as
361
361
  # this geometry, strictly speaking, the result of comparing objects
362
362
  # of different factories is undefined.
363
-
363
+
364
364
  def crosses?(another_geometry_)
365
365
  raise Error::UnsupportedOperation, "Method Geometry#crosses? not defined."
366
366
  end
367
-
368
-
367
+
368
+
369
369
  # === SFS 1.1 Description
370
- #
370
+ #
371
371
  # Returns true if this geometric object is "spatially within"
372
372
  # another_geometry.
373
- #
373
+ #
374
374
  # === Notes
375
- #
375
+ #
376
376
  # Returns a boolean value. Note that this is different from the SFS
377
377
  # specification, which stipulates an integer return value.
378
- #
378
+ #
379
379
  # Although implementations are free to attempt to handle
380
380
  # another_geometry values that do not share the same factory as
381
381
  # this geometry, strictly speaking, the result of comparing objects
382
382
  # of different factories is undefined.
383
-
383
+
384
384
  def within?(another_geometry_)
385
385
  raise Error::UnsupportedOperation, "Method Geometry#within? not defined."
386
386
  end
387
-
388
-
387
+
388
+
389
389
  # === SFS 1.1 Description
390
- #
390
+ #
391
391
  # Returns true if this geometric object "spatially contains"
392
392
  # another_geometry.
393
- #
393
+ #
394
394
  # === Notes
395
- #
395
+ #
396
396
  # Returns a boolean value. Note that this is different from the SFS
397
397
  # specification, which stipulates an integer return value.
398
- #
398
+ #
399
399
  # Although implementations are free to attempt to handle
400
400
  # another_geometry values that do not share the same factory as
401
401
  # this geometry, strictly speaking, the result of comparing objects
402
402
  # of different factories is undefined.
403
-
403
+
404
404
  def contains?(another_geometry_)
405
405
  raise Error::UnsupportedOperation, "Method Geometry#contains? not defined."
406
406
  end
407
-
408
-
407
+
408
+
409
409
  # === SFS 1.1 Description
410
- #
410
+ #
411
411
  # Returns true if this geometric object "spatially overlaps"
412
412
  # another_geometry.
413
- #
413
+ #
414
414
  # === Notes
415
- #
415
+ #
416
416
  # Returns a boolean value. Note that this is different from the SFS
417
417
  # specification, which stipulates an integer return value.
418
- #
418
+ #
419
419
  # Although implementations are free to attempt to handle
420
420
  # another_geometry values that do not share the same factory as
421
421
  # this geometry, strictly speaking, the result of comparing objects
422
422
  # of different factories is undefined.
423
-
423
+
424
424
  def overlaps?(another_geometry_)
425
425
  raise Error::UnsupportedOperation, "Method Geometry#overlaps? not defined."
426
426
  end
427
-
428
-
427
+
428
+
429
429
  # === SFS 1.1 Description
430
- #
430
+ #
431
431
  # Returns true if this geometric object is spatially related to
432
432
  # another_geometry by testing for intersections between the interior,
433
433
  # boundary and exterior of the two geometric objects as specified by
434
434
  # the values in the intersection_pattern_matrix.
435
- #
435
+ #
436
436
  # === Notes
437
- #
437
+ #
438
438
  # The intersection_pattern_matrix is provided as a nine-character
439
439
  # string in row-major order, representing the dimensionalities of
440
440
  # the different intersections in the DE-9IM. Supported characters
441
441
  # include T, F, *, 0, 1, and 2.
442
- #
442
+ #
443
443
  # Returns a boolean value. Note that this is different from the SFS
444
444
  # specification, which stipulates an integer return value.
445
- #
445
+ #
446
446
  # Although implementations are free to attempt to handle
447
447
  # another_geometry values that do not share the same factory as
448
448
  # this geometry, strictly speaking, the result of comparing objects
449
449
  # of different factories is undefined.
450
-
450
+
451
451
  def relate(another_geometry_, intersection_pattern_matrix_)
452
452
  raise Error::UnsupportedOperation, "Method Geometry#relate not defined."
453
453
  end
454
-
455
-
454
+
455
+
456
456
  # === SFS 1.1 Description
457
- #
457
+ #
458
458
  # Returns the shortest distance between any two Points in the two
459
459
  # geometric objects as calculated in the spatial reference system of
460
460
  # this geometric object.
461
- #
461
+ #
462
462
  # === Notes
463
- #
463
+ #
464
464
  # Returns a floating-point scalar value.
465
- #
465
+ #
466
466
  # Although implementations are free to attempt to handle
467
467
  # another_geometry values that do not share the same factory as
468
468
  # this geometry, strictly speaking, the result of measuring the
469
469
  # distance between objects of different factories is undefined.
470
-
470
+
471
471
  def distance(another_geometry_)
472
472
  raise Error::UnsupportedOperation, "Method Geometry#distance not defined."
473
473
  end
474
-
475
-
474
+
475
+
476
476
  # === SFS 1.1 Description
477
- #
477
+ #
478
478
  # Returns a geometric object that represents all Points whose distance
479
479
  # from this geometric object is less than or equal to distance.
480
480
  # Calculations are in the spatial reference system of this geometric
481
481
  # object.
482
- #
482
+ #
483
483
  # === Notes
484
- #
484
+ #
485
485
  # Returns an object that supports the Geometry interface.
486
-
486
+
487
487
  def buffer(distance_)
488
488
  raise Error::UnsupportedOperation, "Method Geometry#buffer not defined."
489
489
  end
490
-
491
-
490
+
491
+
492
492
  # === SFS 1.1 Description
493
- #
493
+ #
494
494
  # Returns a geometric object that represents the convex hull of this
495
495
  # geometric object.
496
- #
496
+ #
497
497
  # === Notes
498
- #
498
+ #
499
499
  # Returns an object that supports the Geometry interface.
500
-
500
+
501
501
  def convex_hull
502
502
  raise Error::UnsupportedOperation, "Method Geometry#convex_hull not defined."
503
503
  end
504
-
505
-
504
+
505
+
506
506
  # === SFS 1.1 Description
507
- #
507
+ #
508
508
  # Returns a geometric object that represents the Point set
509
509
  # intersection of this geometric object with another_geometry.
510
- #
510
+ #
511
511
  # === Notes
512
- #
512
+ #
513
513
  # Returns an object that supports the Geometry interface.
514
- #
514
+ #
515
515
  # Although implementations are free to attempt to handle
516
516
  # another_geometry values that do not share the same factory as
517
517
  # this geometry, strictly speaking, the result of performing
518
518
  # operations on objects of different factories is undefined.
519
-
519
+
520
520
  def intersection(another_geometry_)
521
521
  raise Error::UnsupportedOperation, "Method Geometry#intersection not defined."
522
522
  end
523
-
524
-
523
+
524
+
525
525
  # === SFS 1.1 Description
526
- #
526
+ #
527
527
  # Returns a geometric object that represents the Point set
528
528
  # union of this geometric object with another_geometry.
529
- #
529
+ #
530
530
  # === Notes
531
- #
531
+ #
532
532
  # Returns an object that supports the Geometry interface.
533
- #
533
+ #
534
534
  # Although implementations are free to attempt to handle
535
535
  # another_geometry values that do not share the same factory as
536
536
  # this geometry, strictly speaking, the result of performing
537
537
  # operations on objects of different factories is undefined.
538
-
538
+
539
539
  def union(another_geometry_)
540
540
  raise Error::UnsupportedOperation, "Method Geometry#union not defined."
541
541
  end
542
-
543
-
542
+
543
+
544
544
  # === SFS 1.1 Description
545
- #
545
+ #
546
546
  # Returns a geometric object that represents the Point set
547
547
  # difference of this geometric object with another_geometry.
548
- #
548
+ #
549
549
  # === Notes
550
- #
550
+ #
551
551
  # Returns an object that supports the Geometry interface.
552
- #
552
+ #
553
553
  # Although implementations are free to attempt to handle
554
554
  # another_geometry values that do not share the same factory as
555
555
  # this geometry, strictly speaking, the result of performing
556
556
  # operations on objects of different factories is undefined.
557
-
557
+
558
558
  def difference(another_geometry_)
559
559
  raise Error::UnsupportedOperation, "Method Geometry#difference not defined."
560
560
  end
561
-
562
-
561
+
562
+
563
563
  # === SFS 1.1 Description
564
- #
564
+ #
565
565
  # Returns a geometric object that represents the Point set symmetric
566
566
  # difference of this geometric object with another_geometry.
567
- #
567
+ #
568
568
  # === Notes
569
- #
569
+ #
570
570
  # Returns an object that supports the Geometry interface.
571
- #
571
+ #
572
572
  # Although implementations are free to attempt to handle
573
573
  # another_geometry values that do not share the same factory as
574
574
  # this geometry, strictly speaking, the result of performing
575
575
  # operations on objects of different factories is undefined.
576
-
576
+
577
577
  def sym_difference(another_geometry_)
578
578
  raise Error::UnsupportedOperation, "Method Geometry#sym_difference not defined."
579
579
  end
580
-
581
-
580
+
581
+
582
582
  # This operator should behave almost the same as the equals? method.
583
583
  # The difference is that the == operator is required to handle rhs
584
584
  # values that are not geometry objects (returning false in such cases)
585
585
  # in order to fulfill the standard Ruby contract for the == operator,
586
586
  # whereas the equals? method may assume that any rhs is a geometry.
587
-
587
+
588
588
  def ==(rhs_)
589
589
  rhs_.kind_of?(::RGeo::Feature::Instance) ? equals?(rhs_) : false
590
590
  end
591
-
592
-
591
+
592
+
593
593
  # If the given rhs is a geometry object, this operator must behave
594
594
  # the same as the difference method. The behavior for other rhs
595
595
  # types is not specified; an implementation may choose to provide
596
596
  # additional capabilities as appropriate.
597
-
597
+
598
598
  def -(rhs_)
599
599
  difference(rhs_)
600
600
  end
601
-
602
-
601
+
602
+
603
603
  # If the given rhs is a geometry object, this operator must behave
604
604
  # the same as the union method. The behavior for other rhs types
605
605
  # is not specified; an implementation may choose to provide
606
606
  # additional capabilities as appropriate.
607
-
607
+
608
608
  def +(rhs_)
609
609
  union(rhs_)
610
610
  end
611
-
612
-
611
+
612
+
613
613
  # If the given rhs is a geometry object, this operator must behave
614
614
  # the same as the intersection method. The behavior for other rhs
615
615
  # types is not specified; an implementation may choose to provide
616
616
  # additional capabilities as appropriate.
617
-
617
+
618
618
  def *(rhs_)
619
619
  intersection(rhs_)
620
620
  end
621
-
622
-
621
+
622
+
623
623
  end
624
-
625
-
624
+
625
+
626
626
  end
627
-
627
+
628
628
  end