rgeo 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +22 -0
- data/README.rdoc +124 -0
- data/Version +1 -0
- data/ext/geos_c_impl/extconf.rb +72 -0
- data/ext/geos_c_impl/factory.c +468 -0
- data/ext/geos_c_impl/factory.h +217 -0
- data/ext/geos_c_impl/geometry.c +644 -0
- data/ext/geos_c_impl/geometry.h +65 -0
- data/ext/geos_c_impl/geometry_collection.c +580 -0
- data/ext/geos_c_impl/geometry_collection.h +79 -0
- data/ext/geos_c_impl/globals.h +58 -0
- data/ext/geos_c_impl/line_string.c +468 -0
- data/ext/geos_c_impl/line_string.h +74 -0
- data/ext/geos_c_impl/main.c +65 -0
- data/ext/geos_c_impl/point.c +201 -0
- data/ext/geos_c_impl/point.h +77 -0
- data/ext/geos_c_impl/polygon.c +259 -0
- data/ext/geos_c_impl/polygon.h +76 -0
- data/ext/geos_c_impl/preface.h +42 -0
- data/lib/rgeo.rb +68 -0
- data/lib/rgeo/errors.rb +59 -0
- data/lib/rgeo/features.rb +89 -0
- data/lib/rgeo/features/curve.rb +155 -0
- data/lib/rgeo/features/factory.rb +191 -0
- data/lib/rgeo/features/geometry.rb +560 -0
- data/lib/rgeo/features/geometry_collection.rb +118 -0
- data/lib/rgeo/features/line.rb +65 -0
- data/lib/rgeo/features/line_string.rb +101 -0
- data/lib/rgeo/features/linear_ring.rb +65 -0
- data/lib/rgeo/features/multi_curve.rb +112 -0
- data/lib/rgeo/features/multi_line_string.rb +65 -0
- data/lib/rgeo/features/multi_point.rb +72 -0
- data/lib/rgeo/features/multi_polygon.rb +96 -0
- data/lib/rgeo/features/multi_surface.rb +115 -0
- data/lib/rgeo/features/point.rb +97 -0
- data/lib/rgeo/features/polygon.rb +141 -0
- data/lib/rgeo/features/surface.rb +121 -0
- data/lib/rgeo/geo_json.rb +58 -0
- data/lib/rgeo/geo_json/coder.rb +305 -0
- data/lib/rgeo/geo_json/entities.rb +284 -0
- data/lib/rgeo/geo_json/interface.rb +95 -0
- data/lib/rgeo/geography.rb +75 -0
- data/lib/rgeo/geography/common/geometry_collection_methods.rb +206 -0
- data/lib/rgeo/geography/common/geometry_methods.rb +92 -0
- data/lib/rgeo/geography/common/helper.rb +102 -0
- data/lib/rgeo/geography/common/line_string_methods.rb +187 -0
- data/lib/rgeo/geography/common/point_methods.rb +149 -0
- data/lib/rgeo/geography/common/polygon_methods.rb +122 -0
- data/lib/rgeo/geography/factories.rb +136 -0
- data/lib/rgeo/geography/factory.rb +246 -0
- data/lib/rgeo/geography/projected_window.rb +467 -0
- data/lib/rgeo/geography/simple_mercator/feature_classes.rb +320 -0
- data/lib/rgeo/geography/simple_mercator/feature_methods.rb +291 -0
- data/lib/rgeo/geography/simple_mercator/projector.rb +116 -0
- data/lib/rgeo/geography/simple_spherical/calculations.rb +70 -0
- data/lib/rgeo/geography/simple_spherical/geometry_collection_impl.rb +66 -0
- data/lib/rgeo/geography/simple_spherical/geometry_methods.rb +59 -0
- data/lib/rgeo/geography/simple_spherical/line_string_impl.rb +104 -0
- data/lib/rgeo/geography/simple_spherical/multi_line_string_impl.rb +67 -0
- data/lib/rgeo/geography/simple_spherical/multi_point_impl.rb +67 -0
- data/lib/rgeo/geography/simple_spherical/multi_polygon_impl.rb +67 -0
- data/lib/rgeo/geography/simple_spherical/point_impl.rb +85 -0
- data/lib/rgeo/geography/simple_spherical/polygon_impl.rb +66 -0
- data/lib/rgeo/geos.rb +72 -0
- data/lib/rgeo/geos/factory.rb +260 -0
- data/lib/rgeo/geos/impl_additions.rb +57 -0
- data/lib/rgeo/geos/interface.rb +74 -0
- data/lib/rgeo/version.rb +52 -0
- data/tests/geos/tc_factory.rb +91 -0
- data/tests/geos/tc_geometry_collection.rb +226 -0
- data/tests/geos/tc_line_string.rb +310 -0
- data/tests/geos/tc_misc.rb +72 -0
- data/tests/geos/tc_multi_line_string.rb +211 -0
- data/tests/geos/tc_multi_point.rb +202 -0
- data/tests/geos/tc_multi_polygon.rb +210 -0
- data/tests/geos/tc_point.rb +305 -0
- data/tests/geos/tc_polygon.rb +240 -0
- data/tests/simple_mercator/tc_point.rb +303 -0
- data/tests/simple_mercator/tc_window.rb +219 -0
- data/tests/tc_geojson.rb +230 -0
- data/tests/tc_oneoff.rb +61 -0
- metadata +162 -0
@@ -0,0 +1,65 @@
|
|
1
|
+
# -----------------------------------------------------------------------------
|
2
|
+
#
|
3
|
+
# MultiLineString feature interface
|
4
|
+
#
|
5
|
+
# -----------------------------------------------------------------------------
|
6
|
+
# Copyright 2010 Daniel Azuma
|
7
|
+
#
|
8
|
+
# All rights reserved.
|
9
|
+
#
|
10
|
+
# Redistribution and use in source and binary forms, with or without
|
11
|
+
# modification, are permitted provided that the following conditions are met:
|
12
|
+
#
|
13
|
+
# * Redistributions of source code must retain the above copyright notice,
|
14
|
+
# this list of conditions and the following disclaimer.
|
15
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
16
|
+
# this list of conditions and the following disclaimer in the documentation
|
17
|
+
# and/or other materials provided with the distribution.
|
18
|
+
# * Neither the name of the copyright holder, nor the names of any other
|
19
|
+
# contributors to this software, may be used to endorse or promote products
|
20
|
+
# derived from this software without specific prior written permission.
|
21
|
+
#
|
22
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
25
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
26
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
27
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
28
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
29
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
30
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
31
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
32
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
33
|
+
# -----------------------------------------------------------------------------
|
34
|
+
;
|
35
|
+
|
36
|
+
|
37
|
+
module RGeo
|
38
|
+
|
39
|
+
module Features
|
40
|
+
|
41
|
+
|
42
|
+
# == SFS 1.1 Description
|
43
|
+
#
|
44
|
+
# A MultiLineString is a MultiCurve whose elements are LineStrings.
|
45
|
+
#
|
46
|
+
# == Notes
|
47
|
+
#
|
48
|
+
# MultiLineString is defined as a module and is provided primarily
|
49
|
+
# for the sake of documentation. Implementations need not necessarily
|
50
|
+
# include this module itself. Therefore, you should not depend on the
|
51
|
+
# kind_of? method to check type. Instead, use the provided check_type
|
52
|
+
# class method. A corresponding === operator is also provided to
|
53
|
+
# to support case-when constructs.
|
54
|
+
|
55
|
+
module MultiLineString
|
56
|
+
|
57
|
+
include MultiCurve
|
58
|
+
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# -----------------------------------------------------------------------------
|
2
|
+
#
|
3
|
+
# MultiPoint feature interface
|
4
|
+
#
|
5
|
+
# -----------------------------------------------------------------------------
|
6
|
+
# Copyright 2010 Daniel Azuma
|
7
|
+
#
|
8
|
+
# All rights reserved.
|
9
|
+
#
|
10
|
+
# Redistribution and use in source and binary forms, with or without
|
11
|
+
# modification, are permitted provided that the following conditions are met:
|
12
|
+
#
|
13
|
+
# * Redistributions of source code must retain the above copyright notice,
|
14
|
+
# this list of conditions and the following disclaimer.
|
15
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
16
|
+
# this list of conditions and the following disclaimer in the documentation
|
17
|
+
# and/or other materials provided with the distribution.
|
18
|
+
# * Neither the name of the copyright holder, nor the names of any other
|
19
|
+
# contributors to this software, may be used to endorse or promote products
|
20
|
+
# derived from this software without specific prior written permission.
|
21
|
+
#
|
22
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
25
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
26
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
27
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
28
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
29
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
30
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
31
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
32
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
33
|
+
# -----------------------------------------------------------------------------
|
34
|
+
;
|
35
|
+
|
36
|
+
|
37
|
+
module RGeo
|
38
|
+
|
39
|
+
module Features
|
40
|
+
|
41
|
+
|
42
|
+
# == SFS 1.1 Description
|
43
|
+
#
|
44
|
+
# A MultiPoint is a 0-dimensional GeometryCollection. The elements of
|
45
|
+
# a MultiPoint are restricted to Points. The Points are not connected
|
46
|
+
# or ordered.
|
47
|
+
#
|
48
|
+
# A MultiPoint is simple if no two Points in the MultiPoint are equal
|
49
|
+
# (have identical coordinate values).
|
50
|
+
#
|
51
|
+
# The boundary of a MultiPoint is the empty set.
|
52
|
+
#
|
53
|
+
# == Notes
|
54
|
+
#
|
55
|
+
# MultiPoint is defined as a module and is provided primarily
|
56
|
+
# for the sake of documentation. Implementations need not necessarily
|
57
|
+
# include this module itself. Therefore, you should not depend on the
|
58
|
+
# kind_of? method to check type. Instead, use the provided check_type
|
59
|
+
# class method. A corresponding === operator is also provided to
|
60
|
+
# to support case-when constructs.
|
61
|
+
|
62
|
+
module MultiPoint
|
63
|
+
|
64
|
+
include GeometryCollection
|
65
|
+
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# -----------------------------------------------------------------------------
|
2
|
+
#
|
3
|
+
# MultiPolygon feature interface
|
4
|
+
#
|
5
|
+
# -----------------------------------------------------------------------------
|
6
|
+
# Copyright 2010 Daniel Azuma
|
7
|
+
#
|
8
|
+
# All rights reserved.
|
9
|
+
#
|
10
|
+
# Redistribution and use in source and binary forms, with or without
|
11
|
+
# modification, are permitted provided that the following conditions are met:
|
12
|
+
#
|
13
|
+
# * Redistributions of source code must retain the above copyright notice,
|
14
|
+
# this list of conditions and the following disclaimer.
|
15
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
16
|
+
# this list of conditions and the following disclaimer in the documentation
|
17
|
+
# and/or other materials provided with the distribution.
|
18
|
+
# * Neither the name of the copyright holder, nor the names of any other
|
19
|
+
# contributors to this software, may be used to endorse or promote products
|
20
|
+
# derived from this software without specific prior written permission.
|
21
|
+
#
|
22
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
25
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
26
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
27
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
28
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
29
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
30
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
31
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
32
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
33
|
+
# -----------------------------------------------------------------------------
|
34
|
+
;
|
35
|
+
|
36
|
+
|
37
|
+
module RGeo
|
38
|
+
|
39
|
+
module Features
|
40
|
+
|
41
|
+
|
42
|
+
# == SFS 1.1 Description
|
43
|
+
#
|
44
|
+
# A MultiPolygon is a MultiSurface whose elements are Polygons.
|
45
|
+
#
|
46
|
+
# The assertions for MultiPolygons are as follows.
|
47
|
+
#
|
48
|
+
# a) The interiors of 2 Polygons that are elements of a MultiPolygon
|
49
|
+
# may not intersect.
|
50
|
+
#
|
51
|
+
# b) The boundaries of any 2 Polygons that are elements of a
|
52
|
+
# MultiPolygon may not "cross" and may touch at only a finite number
|
53
|
+
# of Points. NOTE: Crossing is prevented by assertion (a) above.
|
54
|
+
#
|
55
|
+
# c) A MultiPolygon is defined as topologically closed.
|
56
|
+
#
|
57
|
+
# d) A MultiPolygon may not have cut lines, spikes or punctures, a
|
58
|
+
# MultiPolygon is a regular closed Point set:
|
59
|
+
#
|
60
|
+
# e) The interior of a MultiPolygon with more than 1 Polygon is not
|
61
|
+
# connected, the number of connected components of the interior of a
|
62
|
+
# MultiPolygon is equal to the number of Polygons in the MultiPolygon.
|
63
|
+
#
|
64
|
+
# The boundary of a MultiPolygon is a set of closed Curves
|
65
|
+
# (LineStrings) corresponding to the boundaries of its element
|
66
|
+
# Polygons. Each Curve in the boundary of the MultiPolygon is in the
|
67
|
+
# boundary of exactly 1 element Polygon, and every Curve in the
|
68
|
+
# boundary of an element Polygon is in the boundary of the
|
69
|
+
# MultiPolygon.
|
70
|
+
#
|
71
|
+
# NOTE: The subclass of Surface named Polyhedral Surface is a faceted
|
72
|
+
# Surface whose facets are Polygons. A Polyhedral Surface is not a
|
73
|
+
# MultiPolygon because it violates the rule for MultiPolygons that the
|
74
|
+
# boundaries of the element Polygons intersect only at a finite number
|
75
|
+
# of Points.
|
76
|
+
#
|
77
|
+
# == Notes
|
78
|
+
#
|
79
|
+
# MultiPolygon is defined as a module and is provided primarily
|
80
|
+
# for the sake of documentation. Implementations need not necessarily
|
81
|
+
# include this module itself. Therefore, you should not depend on the
|
82
|
+
# kind_of? method to check type. Instead, use the provided check_type
|
83
|
+
# class method. A corresponding === operator is also provided to
|
84
|
+
# to support case-when constructs.
|
85
|
+
|
86
|
+
module MultiPolygon
|
87
|
+
|
88
|
+
include MultiSurface
|
89
|
+
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
# -----------------------------------------------------------------------------
|
2
|
+
#
|
3
|
+
# MultiSurface feature interface
|
4
|
+
#
|
5
|
+
# -----------------------------------------------------------------------------
|
6
|
+
# Copyright 2010 Daniel Azuma
|
7
|
+
#
|
8
|
+
# All rights reserved.
|
9
|
+
#
|
10
|
+
# Redistribution and use in source and binary forms, with or without
|
11
|
+
# modification, are permitted provided that the following conditions are met:
|
12
|
+
#
|
13
|
+
# * Redistributions of source code must retain the above copyright notice,
|
14
|
+
# this list of conditions and the following disclaimer.
|
15
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
16
|
+
# this list of conditions and the following disclaimer in the documentation
|
17
|
+
# and/or other materials provided with the distribution.
|
18
|
+
# * Neither the name of the copyright holder, nor the names of any other
|
19
|
+
# contributors to this software, may be used to endorse or promote products
|
20
|
+
# derived from this software without specific prior written permission.
|
21
|
+
#
|
22
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
25
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
26
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
27
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
28
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
29
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
30
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
31
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
32
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
33
|
+
# -----------------------------------------------------------------------------
|
34
|
+
;
|
35
|
+
|
36
|
+
|
37
|
+
module RGeo
|
38
|
+
|
39
|
+
module Features
|
40
|
+
|
41
|
+
|
42
|
+
# == SFS 1.1 Description
|
43
|
+
#
|
44
|
+
# A MultiSurface is a 2-dimensional GeometryCollection whose elements
|
45
|
+
# are Surfaces. The interiors of any two Surfaces in a MultiSurface may
|
46
|
+
# not intersect. The boundaries of any two elements in a MultiSurface
|
47
|
+
# may intersect, at most, at a finite number of Points.
|
48
|
+
#
|
49
|
+
# MultiSurface is a non-instantiable class in this International
|
50
|
+
# Standard. It defines a set of methods for its subclasses and is
|
51
|
+
# included for reasons of extensibility. The instantiable subclass of
|
52
|
+
# MultiSurface is MultiPolygon, corresponding to a collection of
|
53
|
+
# Polygons.
|
54
|
+
#
|
55
|
+
# == Notes
|
56
|
+
#
|
57
|
+
# MultiSurface is defined as a module and is provided primarily
|
58
|
+
# for the sake of documentation. Implementations need not necessarily
|
59
|
+
# include this module itself. Therefore, you should not depend on the
|
60
|
+
# kind_of? method to check type. Instead, use the provided check_type
|
61
|
+
# class method. A corresponding === operator is also provided to
|
62
|
+
# to support case-when constructs.
|
63
|
+
|
64
|
+
module MultiSurface
|
65
|
+
|
66
|
+
include GeometryCollection
|
67
|
+
|
68
|
+
|
69
|
+
# === SFS 1.1 Description
|
70
|
+
#
|
71
|
+
# The area of this MultiSurface, as measured in the spatial reference
|
72
|
+
# system of this MultiSurface.
|
73
|
+
#
|
74
|
+
# === Notes
|
75
|
+
#
|
76
|
+
# Returns a floating-point scalar value.
|
77
|
+
|
78
|
+
def area
|
79
|
+
raise Errors::MethodUnimplemented
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
# === SFS 1.1 Description
|
84
|
+
#
|
85
|
+
# The mathematical centroid for this MultiSurface as a Point. The
|
86
|
+
# result is not guaranteed to be on this MultiSurface.
|
87
|
+
#
|
88
|
+
# === Notes
|
89
|
+
#
|
90
|
+
# Returns an object that supports the Point interface.
|
91
|
+
|
92
|
+
def centroid
|
93
|
+
raise Errors::MethodUnimplemented
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
# === SFS 1.1 Description
|
98
|
+
#
|
99
|
+
# A Point guaranteed to be on this MultiSurface.
|
100
|
+
#
|
101
|
+
# === Notes
|
102
|
+
#
|
103
|
+
# Returns an object that supports the Point interface.
|
104
|
+
|
105
|
+
def point_on_surface
|
106
|
+
raise Errors::MethodUnimplemented
|
107
|
+
end
|
108
|
+
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# -----------------------------------------------------------------------------
|
2
|
+
#
|
3
|
+
# Point feature interface
|
4
|
+
#
|
5
|
+
# -----------------------------------------------------------------------------
|
6
|
+
# Copyright 2010 Daniel Azuma
|
7
|
+
#
|
8
|
+
# All rights reserved.
|
9
|
+
#
|
10
|
+
# Redistribution and use in source and binary forms, with or without
|
11
|
+
# modification, are permitted provided that the following conditions are met:
|
12
|
+
#
|
13
|
+
# * Redistributions of source code must retain the above copyright notice,
|
14
|
+
# this list of conditions and the following disclaimer.
|
15
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
16
|
+
# this list of conditions and the following disclaimer in the documentation
|
17
|
+
# and/or other materials provided with the distribution.
|
18
|
+
# * Neither the name of the copyright holder, nor the names of any other
|
19
|
+
# contributors to this software, may be used to endorse or promote products
|
20
|
+
# derived from this software without specific prior written permission.
|
21
|
+
#
|
22
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
25
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
26
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
27
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
28
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
29
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
30
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
31
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
32
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
33
|
+
# -----------------------------------------------------------------------------
|
34
|
+
;
|
35
|
+
|
36
|
+
|
37
|
+
module RGeo
|
38
|
+
|
39
|
+
module Features
|
40
|
+
|
41
|
+
|
42
|
+
# == SFS 1.1 Description
|
43
|
+
#
|
44
|
+
# A Point is a 0-dimensional geometric object and represents a single
|
45
|
+
# location in coordinate space. A Point has an x-coordinate value and
|
46
|
+
# a y-coordinate value.
|
47
|
+
#
|
48
|
+
# The boundary of a Point is the empty set.
|
49
|
+
#
|
50
|
+
# == Notes
|
51
|
+
#
|
52
|
+
# Point is defined as a module and is provided primarily
|
53
|
+
# for the sake of documentation. Implementations need not necessarily
|
54
|
+
# include this module itself. Therefore, you should not depend on the
|
55
|
+
# kind_of? method to check type. Instead, use the provided check_type
|
56
|
+
# class method. A corresponding === operator is also provided to
|
57
|
+
# to support case-when constructs.
|
58
|
+
#
|
59
|
+
# Some implementations may support higher dimensional points.
|
60
|
+
|
61
|
+
module Point
|
62
|
+
|
63
|
+
include Geometry
|
64
|
+
|
65
|
+
|
66
|
+
# === SFS 1.1 Description
|
67
|
+
#
|
68
|
+
# The x-coordinate value for this Point.
|
69
|
+
#
|
70
|
+
# === Notes
|
71
|
+
#
|
72
|
+
# Returns a floating-point scalar value.
|
73
|
+
|
74
|
+
def x
|
75
|
+
raise Errors::MethodUnimplemented
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
# === SFS 1.1 Description
|
80
|
+
#
|
81
|
+
# The y-coordinate value for this Point.
|
82
|
+
#
|
83
|
+
# === Notes
|
84
|
+
#
|
85
|
+
# Returns a floating-point scalar value.
|
86
|
+
|
87
|
+
def y
|
88
|
+
raise Errors::MethodUnimplemented
|
89
|
+
end
|
90
|
+
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|