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
@@ -1,15 +1,15 @@
|
|
1
1
|
# -----------------------------------------------------------------------------
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# GeometryCollection 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,105 +35,105 @@
|
|
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 GeometryCollection is a geometric object that is a collection of 1
|
45
45
|
# or more geometric objects.
|
46
|
-
#
|
46
|
+
#
|
47
47
|
# All the elements in a GeometryCollection shall be in the same Spatial
|
48
48
|
# Reference. This is also the Spatial Reference for the GeometryCollection.
|
49
|
-
#
|
49
|
+
#
|
50
50
|
# GeometryCollection places no other constraints on its elements.
|
51
51
|
# Subclasses of GeometryCollection may restrict membership based on
|
52
52
|
# dimension and may also place other constraints on the degree of spatial
|
53
53
|
# overlap between elements.
|
54
|
-
#
|
54
|
+
#
|
55
55
|
# == Notes
|
56
|
-
#
|
56
|
+
#
|
57
57
|
# GeometryCollection is defined as a module and is provided primarily
|
58
58
|
# for the sake of documentation. Implementations need not necessarily
|
59
59
|
# include this module itself. Therefore, you should not depend on the
|
60
60
|
# kind_of? method to check type. Instead, use the provided check_type
|
61
61
|
# class method (or === operator) defined in the Type module.
|
62
|
-
|
62
|
+
|
63
63
|
module GeometryCollection
|
64
|
-
|
64
|
+
|
65
65
|
include Geometry
|
66
66
|
extend Type
|
67
|
-
|
67
|
+
|
68
68
|
include ::Enumerable
|
69
|
-
|
70
|
-
|
69
|
+
|
70
|
+
|
71
71
|
# === SFS 1.1 Description
|
72
|
-
#
|
72
|
+
#
|
73
73
|
# Returns the number of geometries in this GeometryCollection.
|
74
|
-
#
|
74
|
+
#
|
75
75
|
# === Notes
|
76
|
-
#
|
76
|
+
#
|
77
77
|
# Returns an integer.
|
78
|
-
|
78
|
+
|
79
79
|
def num_geometries
|
80
80
|
raise Error::UnsupportedOperation, "Method GeometryCollection#num_geometries not defined."
|
81
81
|
end
|
82
|
-
|
83
|
-
|
82
|
+
|
83
|
+
|
84
84
|
# === SFS 1.1 Description
|
85
|
-
#
|
85
|
+
#
|
86
86
|
# Returns the Nth geometry in this GeometryCollection.
|
87
|
-
#
|
87
|
+
#
|
88
88
|
# === Notes
|
89
|
-
#
|
89
|
+
#
|
90
90
|
# Returns an object that supports the Geometry interface, or nil
|
91
91
|
# if the given N is out of range. N is zero-based.
|
92
92
|
# Also note that this method is different from GeometryCollection#[]
|
93
93
|
# in that it does not support negative indexes.
|
94
|
-
|
94
|
+
|
95
95
|
def geometry_n(n_)
|
96
96
|
raise Error::UnsupportedOperation, "Method GeometryCollection#geometry_n not defined."
|
97
97
|
end
|
98
|
-
|
99
|
-
|
98
|
+
|
99
|
+
|
100
100
|
# Alias of the num_geometries method.
|
101
|
-
|
101
|
+
|
102
102
|
def size
|
103
103
|
num_geometries
|
104
104
|
end
|
105
|
-
|
106
|
-
|
105
|
+
|
106
|
+
|
107
107
|
# Returns the Nth geometry in this GeometryCollection, or nil if the
|
108
108
|
# given N is out of range. N is zero-based.
|
109
|
-
#
|
109
|
+
#
|
110
110
|
# This behaves slightly different from GeometryCollection#geometry_n.
|
111
111
|
# GeometryCollection#geometry_n accepts only nonnegative indexes,
|
112
112
|
# as specified by the SFS. However, GeometryCollection#[] also accepts
|
113
113
|
# negative indexes counting backwards from the end of the collection,
|
114
114
|
# the same way Ruby's array indexing works. Hence, geometry_n(-1)
|
115
115
|
# returns nil, where [-1] returns the last element of the collection.
|
116
|
-
|
116
|
+
|
117
117
|
def [](n_)
|
118
118
|
raise Error::UnsupportedOperation, "Method GeometryCollection#[] not defined."
|
119
119
|
end
|
120
|
-
|
121
|
-
|
120
|
+
|
121
|
+
|
122
122
|
# Iterates over the geometries of this GeometryCollection.
|
123
|
-
#
|
123
|
+
#
|
124
124
|
# This is not a standard SFS method, but is provided so that a
|
125
125
|
# GeometryCollection can behave as a Ruby enumerable.
|
126
126
|
# Note that all GeometryCollection implementations must also
|
127
127
|
# include the Enumerable mixin.
|
128
|
-
|
128
|
+
|
129
129
|
def each(&block_)
|
130
130
|
raise Error::UnsupportedOperation, "Method GeometryCollection#each not defined."
|
131
131
|
end
|
132
|
-
|
133
|
-
|
132
|
+
|
133
|
+
|
134
134
|
end
|
135
|
-
|
136
|
-
|
135
|
+
|
136
|
+
|
137
137
|
end
|
138
|
-
|
138
|
+
|
139
139
|
end
|
data/lib/rgeo/feature/line.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# -----------------------------------------------------------------------------
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Line 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,32 +35,32 @@
|
|
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 Line is a LineString with exactly 2 Points.
|
45
|
-
#
|
45
|
+
#
|
46
46
|
# == Notes
|
47
|
-
#
|
47
|
+
#
|
48
48
|
# Line 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 Line
|
55
|
-
|
56
|
-
|
55
|
+
|
56
|
+
|
57
57
|
include LineString
|
58
58
|
extend Type
|
59
|
-
|
60
|
-
|
59
|
+
|
60
|
+
|
61
61
|
end
|
62
|
-
|
63
|
-
|
62
|
+
|
63
|
+
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
# -----------------------------------------------------------------------------
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# LineString 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,68 +35,68 @@
|
|
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 LineString is a Curve with linear interpolation between Points.
|
45
45
|
# Each consecutive pair of Points defines a Line segment.
|
46
|
-
#
|
46
|
+
#
|
47
47
|
# == Notes
|
48
|
-
#
|
48
|
+
#
|
49
49
|
# LineString is defined as a module and is provided primarily
|
50
50
|
# for the sake of documentation. Implementations need not necessarily
|
51
51
|
# include this module itself. Therefore, you should not depend on the
|
52
52
|
# kind_of? method to check type. Instead, use the provided check_type
|
53
53
|
# class method (or === operator) defined in the Type module.
|
54
|
-
|
54
|
+
|
55
55
|
module LineString
|
56
|
-
|
56
|
+
|
57
57
|
include Curve
|
58
58
|
extend Type
|
59
|
-
|
60
|
-
|
59
|
+
|
60
|
+
|
61
61
|
# === SFS 1.1 Description
|
62
|
-
#
|
62
|
+
#
|
63
63
|
# The number of Points in this LineString.
|
64
|
-
#
|
64
|
+
#
|
65
65
|
# === Notes
|
66
|
-
#
|
66
|
+
#
|
67
67
|
# Returns an integer.
|
68
|
-
|
68
|
+
|
69
69
|
def num_points
|
70
70
|
raise Error::UnsupportedOperation, "Method LineString#num_points not defined."
|
71
71
|
end
|
72
|
-
|
73
|
-
|
72
|
+
|
73
|
+
|
74
74
|
# === SFS 1.1 Description
|
75
|
-
#
|
75
|
+
#
|
76
76
|
# Returns the specified Point N in this LineString.
|
77
|
-
#
|
77
|
+
#
|
78
78
|
# === Notes
|
79
|
-
#
|
79
|
+
#
|
80
80
|
# Returns an object that supports the Point interface, or nil
|
81
81
|
# if the given N is out of range. N is zero-based.
|
82
82
|
# Does not support negative indexes.
|
83
|
-
|
83
|
+
|
84
84
|
def point_n(n_)
|
85
85
|
raise Error::UnsupportedOperation, "Method LineString#point_n not defined."
|
86
86
|
end
|
87
|
-
|
88
|
-
|
87
|
+
|
88
|
+
|
89
89
|
# Returns the constituent points as an array of objects that
|
90
90
|
# support the Point interface.
|
91
|
-
|
91
|
+
|
92
92
|
def points
|
93
93
|
raise Error::UnsupportedOperation, "Method LineString#points not defined."
|
94
94
|
end
|
95
|
-
|
96
|
-
|
95
|
+
|
96
|
+
|
97
97
|
end
|
98
|
-
|
99
|
-
|
98
|
+
|
99
|
+
|
100
100
|
end
|
101
|
-
|
101
|
+
|
102
102
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
# -----------------------------------------------------------------------------
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# LinearRing 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 LinearRing is a LineString that is both closed and simple.
|
45
|
-
#
|
45
|
+
#
|
46
46
|
# == Notes
|
47
|
-
#
|
47
|
+
#
|
48
48
|
# LinearRing 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 LinearRing
|
55
|
-
|
55
|
+
|
56
56
|
include LineString
|
57
57
|
extend Type
|
58
|
-
|
59
|
-
|
58
|
+
|
59
|
+
|
60
60
|
end
|
61
|
-
|
62
|
-
|
61
|
+
|
62
|
+
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
end
|