rgeo 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +29 -0
- data/ext/geos_c_impl/Makefile_2.2.3 +260 -0
- data/ext/geos_c_impl/coordinates.c +65 -0
- data/ext/geos_c_impl/coordinates.h +2 -0
- data/ext/geos_c_impl/extconf.rb +19 -43
- data/ext/geos_c_impl/geometry.c +24 -0
- data/ext/geos_c_impl/geometry_collection.c +99 -1
- data/ext/geos_c_impl/geos_c_impl_2.2.3.bundle +0 -0
- data/ext/geos_c_impl/line_string.c +38 -0
- data/ext/geos_c_impl/mkmf.log +123 -0
- data/ext/geos_c_impl/point.c +27 -0
- data/ext/geos_c_impl/polygon.c +26 -0
- data/ext/proj4_c_impl/Makefile_2.2.3 +260 -0
- data/ext/proj4_c_impl/extconf.rb +32 -32
- data/ext/proj4_c_impl/mkmf.log +47 -0
- data/ext/proj4_c_impl/proj4_c_impl_2.2.3.bundle +0 -0
- data/lib/rgeo.rb +10 -11
- data/lib/rgeo/cartesian.rb +7 -12
- data/lib/rgeo/cartesian/analysis.rb +13 -26
- data/lib/rgeo/cartesian/bounding_box.rb +45 -114
- data/lib/rgeo/cartesian/calculations.rb +3 -21
- data/lib/rgeo/cartesian/factory.rb +101 -122
- data/lib/rgeo/cartesian/feature_classes.rb +9 -59
- data/lib/rgeo/cartesian/feature_methods.rb +15 -45
- data/lib/rgeo/cartesian/interface.rb +6 -17
- data/lib/rgeo/coord_sys.rb +9 -15
- data/lib/rgeo/coord_sys/cs/entities.rb +84 -330
- data/lib/rgeo/coord_sys/cs/factories.rb +2 -32
- data/lib/rgeo/coord_sys/cs/wkt_parser.rb +52 -80
- data/lib/rgeo/coord_sys/proj4.rb +28 -67
- data/lib/rgeo/coord_sys/proj4_c_impl.bundle +0 -0
- data/lib/rgeo/coord_sys/srs_database/interface.rb +4 -24
- data/lib/rgeo/coord_sys/srs_database/proj4_data.rb +20 -38
- data/lib/rgeo/coord_sys/srs_database/sr_org.rb +6 -22
- data/lib/rgeo/coord_sys/srs_database/url_reader.rb +6 -21
- data/lib/rgeo/error.rb +0 -6
- data/lib/rgeo/feature.rb +18 -23
- data/lib/rgeo/feature/curve.rb +0 -14
- data/lib/rgeo/feature/factory.rb +13 -38
- data/lib/rgeo/feature/factory_generator.rb +4 -16
- data/lib/rgeo/feature/geometry.rb +18 -60
- data/lib/rgeo/feature/geometry_collection.rb +3 -17
- data/lib/rgeo/feature/line.rb +0 -10
- data/lib/rgeo/feature/line_string.rb +1 -13
- data/lib/rgeo/feature/linear_ring.rb +0 -9
- data/lib/rgeo/feature/mixins.rb +11 -36
- data/lib/rgeo/feature/multi_curve.rb +0 -11
- data/lib/rgeo/feature/multi_line_string.rb +0 -9
- data/lib/rgeo/feature/multi_point.rb +0 -9
- data/lib/rgeo/feature/multi_polygon.rb +0 -9
- data/lib/rgeo/feature/multi_surface.rb +0 -12
- data/lib/rgeo/feature/point.rb +0 -13
- data/lib/rgeo/feature/polygon.rb +1 -14
- data/lib/rgeo/feature/surface.rb +0 -12
- data/lib/rgeo/feature/types.rb +19 -61
- data/lib/rgeo/geographic.rb +10 -15
- data/lib/rgeo/geographic/factory.rb +126 -147
- data/lib/rgeo/geographic/interface.rb +67 -81
- data/lib/rgeo/geographic/proj4_projector.rb +13 -37
- data/lib/rgeo/geographic/projected_feature_classes.rb +7 -66
- data/lib/rgeo/geographic/projected_feature_methods.rb +15 -80
- data/lib/rgeo/geographic/projected_window.rb +15 -67
- data/lib/rgeo/geographic/simple_mercator_projector.rb +32 -56
- data/lib/rgeo/geographic/spherical_feature_classes.rb +9 -68
- data/lib/rgeo/geographic/spherical_feature_methods.rb +18 -51
- data/lib/rgeo/geographic/spherical_math.rb +26 -51
- data/lib/rgeo/geos.rb +23 -20
- data/lib/rgeo/geos/capi_factory.rb +125 -131
- data/lib/rgeo/geos/capi_feature_classes.rb +21 -88
- data/lib/rgeo/geos/ffi_factory.rb +90 -143
- data/lib/rgeo/geos/ffi_feature_classes.rb +8 -63
- data/lib/rgeo/geos/ffi_feature_methods.rb +46 -162
- data/lib/rgeo/geos/geos_c_impl.bundle +0 -0
- data/lib/rgeo/geos/interface.rb +4 -23
- data/lib/rgeo/geos/utils.rb +4 -19
- data/lib/rgeo/geos/zm_factory.rb +82 -131
- data/lib/rgeo/geos/zm_feature_classes.rb +8 -63
- data/lib/rgeo/geos/zm_feature_methods.rb +34 -107
- data/lib/rgeo/impl_helper.rb +8 -13
- data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +27 -71
- data/lib/rgeo/impl_helper/basic_geometry_methods.rb +10 -28
- data/lib/rgeo/impl_helper/basic_line_string_methods.rb +21 -57
- data/lib/rgeo/impl_helper/basic_point_methods.rb +12 -30
- data/lib/rgeo/impl_helper/basic_polygon_methods.rb +9 -28
- data/lib/rgeo/impl_helper/math.rb +4 -10
- data/lib/rgeo/impl_helper/utils.rb +2 -10
- data/lib/rgeo/version.rb +1 -1
- data/lib/rgeo/wkrep.rb +4 -9
- data/lib/rgeo/wkrep/wkb_generator.rb +22 -46
- data/lib/rgeo/wkrep/wkb_parser.rb +25 -52
- data/lib/rgeo/wkrep/wkt_generator.rb +39 -69
- data/lib/rgeo/wkrep/wkt_parser.rb +52 -89
- data/lib/rgeo/yaml.rb +1 -7
- data/test/common/factory_tests.rb +4 -19
- data/test/common/geometry_collection_tests.rb +6 -39
- data/test/common/line_string_tests.rb +10 -39
- data/test/common/multi_line_string_tests.rb +10 -30
- data/test/common/multi_point_tests.rb +15 -34
- data/test/common/multi_polygon_tests.rb +26 -28
- data/test/common/point_tests.rb +37 -59
- data/test/common/polygon_tests.rb +16 -25
- data/test/coord_sys/tc_ogc_cs.rb +151 -186
- data/test/coord_sys/tc_proj4.rb +35 -60
- data/test/coord_sys/tc_proj4_srs_data.rb +15 -24
- data/test/coord_sys/tc_sr_org.rb +11 -19
- data/test/coord_sys/tc_url_reader.rb +13 -23
- data/test/geos_capi/tc_factory.rb +7 -16
- data/test/geos_capi/tc_geometry_collection.rb +6 -14
- data/test/geos_capi/tc_line_string.rb +7 -15
- data/test/geos_capi/tc_misc.rb +26 -41
- data/test/geos_capi/tc_multi_line_string.rb +6 -14
- data/test/geos_capi/tc_multi_point.rb +7 -15
- data/test/geos_capi/tc_multi_polygon.rb +8 -18
- data/test/geos_capi/tc_parsing_unparsing.rb +11 -21
- data/test/geos_capi/tc_point.rb +12 -26
- data/test/geos_capi/tc_polygon.rb +52 -17
- data/test/geos_capi/tc_zmfactory.rb +7 -18
- data/test/geos_ffi/tc_factory.rb +7 -16
- data/test/geos_ffi/tc_geometry_collection.rb +7 -15
- data/test/geos_ffi/tc_line_string.rb +7 -15
- data/test/geos_ffi/tc_misc.rb +8 -18
- data/test/geos_ffi/tc_multi_line_string.rb +7 -15
- data/test/geos_ffi/tc_multi_point.rb +8 -16
- data/test/geos_ffi/tc_multi_polygon.rb +9 -18
- data/test/geos_ffi/tc_parsing_unparsing.rb +14 -24
- data/test/geos_ffi/tc_point.rb +13 -28
- data/test/geos_ffi/tc_polygon.rb +7 -17
- data/test/geos_ffi/tc_zmfactory.rb +8 -19
- data/test/projected_geographic/tc_factory.rb +7 -15
- data/test/projected_geographic/tc_geometry_collection.rb +7 -15
- data/test/projected_geographic/tc_line_string.rb +7 -15
- data/test/projected_geographic/tc_multi_line_string.rb +7 -16
- data/test/projected_geographic/tc_multi_point.rb +8 -17
- data/test/projected_geographic/tc_multi_polygon.rb +8 -16
- data/test/projected_geographic/tc_point.rb +11 -23
- data/test/projected_geographic/tc_polygon.rb +7 -15
- data/test/simple_cartesian/tc_calculations.rb +6 -22
- data/test/simple_cartesian/tc_factory.rb +7 -16
- data/test/simple_cartesian/tc_geometry_collection.rb +6 -15
- data/test/simple_cartesian/tc_line_string.rb +6 -15
- data/test/simple_cartesian/tc_multi_line_string.rb +6 -15
- data/test/simple_cartesian/tc_multi_point.rb +7 -16
- data/test/simple_cartesian/tc_multi_polygon.rb +7 -16
- data/test/simple_cartesian/tc_point.rb +10 -21
- data/test/simple_cartesian/tc_polygon.rb +6 -15
- data/test/simple_mercator/tc_factory.rb +6 -14
- data/test/simple_mercator/tc_geometry_collection.rb +6 -14
- data/test/simple_mercator/tc_line_string.rb +6 -14
- data/test/simple_mercator/tc_multi_line_string.rb +6 -15
- data/test/simple_mercator/tc_multi_point.rb +7 -16
- data/test/simple_mercator/tc_multi_polygon.rb +7 -15
- data/test/simple_mercator/tc_point.rb +11 -24
- data/test/simple_mercator/tc_polygon.rb +6 -14
- data/test/simple_mercator/tc_window.rb +10 -34
- data/test/spherical_geographic/tc_calculations.rb +5 -32
- data/test/spherical_geographic/tc_factory.rb +6 -15
- data/test/spherical_geographic/tc_geometry_collection.rb +6 -15
- data/test/spherical_geographic/tc_line_string.rb +6 -15
- data/test/spherical_geographic/tc_multi_line_string.rb +6 -15
- data/test/spherical_geographic/tc_multi_point.rb +7 -16
- data/test/spherical_geographic/tc_multi_polygon.rb +7 -16
- data/test/spherical_geographic/tc_point.rb +10 -22
- data/test/spherical_geographic/tc_polygon.rb +6 -15
- data/test/tc_cartesian_analysis.rb +4 -16
- data/test/tc_cartesian_bbox.rb +7 -21
- data/test/tc_mixins.rb +8 -25
- data/test/tc_oneoff.rb +5 -13
- data/test/tc_types.rb +7 -16
- data/test/wkrep/tc_wkb_generator.rb +63 -97
- data/test/wkrep/tc_wkb_parser.rb +63 -100
- data/test/wkrep/tc_wkt_generator.rb +54 -92
- data/test/wkrep/tc_wkt_parser.rb +84 -133
- metadata +39 -9
- data/lib/rgeo/coord_sys/srs_database/active_record_table.rb +0 -166
- data/test/coord_sys/tc_active_record_table.rb +0 -79
@@ -4,22 +4,15 @@
|
|
4
4
|
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
require
|
8
|
-
|
7
|
+
require "net/http"
|
9
8
|
|
10
9
|
module RGeo
|
11
|
-
|
12
10
|
module CoordSys
|
13
|
-
|
14
11
|
module SRSDatabase
|
15
|
-
|
16
|
-
|
17
12
|
# A spatial reference database implementation that fetches data
|
18
13
|
# from the spatialreference.org website.
|
19
14
|
|
20
15
|
class SrOrg
|
21
|
-
|
22
|
-
|
23
16
|
# Create a database backed by the given catalog of the
|
24
17
|
# spatialreference.org website. Catalogs currently supported by
|
25
18
|
# spatialreference.org are "epsg", "esri", "iau2000" and "sr-org".
|
@@ -31,16 +24,14 @@ module RGeo
|
|
31
24
|
# is requested again, the result is served from cache rather
|
32
25
|
# than issuing another HTTP request. Default is false.
|
33
26
|
|
34
|
-
def initialize(catalog_, opts_={})
|
27
|
+
def initialize(catalog_, opts_ = {})
|
35
28
|
@catalog = catalog_.to_s.downcase
|
36
29
|
@cache = opts_[:cache] ? {} : nil
|
37
30
|
end
|
38
31
|
|
39
|
-
|
40
32
|
# The spatialreference.org catalog used by this database.
|
41
33
|
attr_reader :catalog
|
42
34
|
|
43
|
-
|
44
35
|
# Retrieve the Entry from a spatialreference.org catalog given an
|
45
36
|
# integer ID.
|
46
37
|
|
@@ -49,30 +40,23 @@ module RGeo
|
|
49
40
|
return @cache[ident_] if @cache && @cache.include?(ident_)
|
50
41
|
coord_sys_ = nil
|
51
42
|
proj4_ = nil
|
52
|
-
::Net::HTTP.start(
|
43
|
+
::Net::HTTP.start("spatialreference.org") do |http_|
|
53
44
|
response_ = http_.request_get("/ref/#{@catalog}/#{ident_}/ogcwkt/")
|
54
|
-
coord_sys_ = response_.body if response_.
|
45
|
+
coord_sys_ = response_.body if response_.is_a?(::Net::HTTPSuccess)
|
55
46
|
response_ = http_.request_get("/ref/#{@catalog}/#{ident_}/proj4/")
|
56
|
-
proj4_ = response_.body if response_.
|
47
|
+
proj4_ = response_.body if response_.is_a?(::Net::HTTPSuccess)
|
57
48
|
end
|
58
|
-
result_ = Entry.new(ident_, :
|
49
|
+
result_ = Entry.new(ident_, coord_sys: coord_sys_.strip, proj4: proj4_.strip)
|
59
50
|
@cache[ident_] = result_ if @cache
|
60
51
|
result_
|
61
52
|
end
|
62
53
|
|
63
|
-
|
64
54
|
# Clear the cache if one exists.
|
65
55
|
|
66
56
|
def clear_cache
|
67
57
|
@cache.clear if @cache
|
68
58
|
end
|
69
|
-
|
70
|
-
|
71
59
|
end
|
72
|
-
|
73
|
-
|
74
60
|
end
|
75
|
-
|
76
61
|
end
|
77
|
-
|
78
62
|
end
|
@@ -4,22 +4,15 @@
|
|
4
4
|
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
require
|
8
|
-
|
7
|
+
require "net/http"
|
9
8
|
|
10
9
|
module RGeo
|
11
|
-
|
12
10
|
module CoordSys
|
13
|
-
|
14
11
|
module SRSDatabase
|
15
|
-
|
16
|
-
|
17
12
|
# A spatial reference database implementation that fetches data from
|
18
13
|
# internet URLs.
|
19
14
|
|
20
15
|
class UrlReader
|
21
|
-
|
22
|
-
|
23
16
|
# Create a URL-based spatial reference database.
|
24
17
|
#
|
25
18
|
# Options:
|
@@ -29,11 +22,10 @@ module RGeo
|
|
29
22
|
# is requested again, the result is served from cache rather
|
30
23
|
# than issuing another HTTP request. Default is false.
|
31
24
|
|
32
|
-
def initialize(opts_={})
|
25
|
+
def initialize(opts_ = {})
|
33
26
|
@cache = opts_[:cache] ? {} : nil
|
34
27
|
end
|
35
28
|
|
36
|
-
|
37
29
|
# Retrieve the given URL and return an Entry.
|
38
30
|
# Returns nil if the URL cannot be read as an OGC WKT or Proj4
|
39
31
|
# coordinate system
|
@@ -47,12 +39,12 @@ module RGeo
|
|
47
39
|
request_ = uri_.path
|
48
40
|
request_ = "#{request_}?#{uri_.query}" if uri_.query
|
49
41
|
response_ = http_.request_get(request_)
|
50
|
-
if response_.
|
42
|
+
if response_.is_a?(::Net::HTTPSuccess)
|
51
43
|
response_ = response_.body.strip
|
52
|
-
if response_[0,1] ==
|
53
|
-
result_ = Entry.new(ident_, :
|
44
|
+
if response_[0, 1] == "+"
|
45
|
+
result_ = Entry.new(ident_, proj4: response_)
|
54
46
|
else
|
55
|
-
result_ = Entry.new(ident_, :
|
47
|
+
result_ = Entry.new(ident_, coord_sys: response_)
|
56
48
|
end
|
57
49
|
end
|
58
50
|
end
|
@@ -60,19 +52,12 @@ module RGeo
|
|
60
52
|
result_
|
61
53
|
end
|
62
54
|
|
63
|
-
|
64
55
|
# Clear the cache if one is present.
|
65
56
|
|
66
57
|
def clear_cache
|
67
58
|
@cache.clear if @cache
|
68
59
|
end
|
69
|
-
|
70
|
-
|
71
60
|
end
|
72
|
-
|
73
|
-
|
74
61
|
end
|
75
|
-
|
76
62
|
end
|
77
|
-
|
78
63
|
end
|
data/lib/rgeo/error.rb
CHANGED
@@ -5,12 +5,9 @@
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
7
|
module RGeo
|
8
|
-
|
9
|
-
|
10
8
|
# All RGeo errors are members of this namespace.
|
11
9
|
|
12
10
|
module Error
|
13
|
-
|
14
11
|
# Base class for all RGeo-related exceptions
|
15
12
|
class RGeoError < ::RuntimeError
|
16
13
|
end
|
@@ -26,8 +23,5 @@ module RGeo
|
|
26
23
|
# Parsing failed
|
27
24
|
class ParseError < RGeoError
|
28
25
|
end
|
29
|
-
|
30
26
|
end
|
31
|
-
|
32
|
-
|
33
27
|
end
|
data/lib/rgeo/feature.rb
CHANGED
@@ -5,8 +5,6 @@
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
7
|
module RGeo
|
8
|
-
|
9
|
-
|
10
8
|
# The Feature namespace contains interfaces and general tools for
|
11
9
|
# implementations of the Open Geospatial Consortium Simple Features
|
12
10
|
# Specification (SFS), version 1.1.0.
|
@@ -33,27 +31,24 @@ module RGeo
|
|
33
31
|
|
34
32
|
module Feature
|
35
33
|
end
|
36
|
-
|
37
|
-
|
38
34
|
end
|
39
35
|
|
40
|
-
|
41
36
|
# Implementation files
|
42
|
-
require
|
43
|
-
require
|
44
|
-
require
|
45
|
-
require
|
46
|
-
require
|
47
|
-
require
|
48
|
-
require
|
49
|
-
require
|
50
|
-
require
|
51
|
-
require
|
52
|
-
require
|
53
|
-
require
|
54
|
-
require
|
55
|
-
require
|
56
|
-
require
|
57
|
-
require
|
58
|
-
require
|
59
|
-
require
|
37
|
+
require "rgeo/feature/factory"
|
38
|
+
require "rgeo/feature/mixins"
|
39
|
+
require "rgeo/feature/types"
|
40
|
+
require "rgeo/feature/geometry"
|
41
|
+
require "rgeo/feature/point"
|
42
|
+
require "rgeo/feature/curve"
|
43
|
+
require "rgeo/feature/line_string"
|
44
|
+
require "rgeo/feature/linear_ring"
|
45
|
+
require "rgeo/feature/line"
|
46
|
+
require "rgeo/feature/surface"
|
47
|
+
require "rgeo/feature/polygon"
|
48
|
+
require "rgeo/feature/geometry_collection"
|
49
|
+
require "rgeo/feature/multi_point"
|
50
|
+
require "rgeo/feature/multi_curve"
|
51
|
+
require "rgeo/feature/multi_line_string"
|
52
|
+
require "rgeo/feature/multi_surface"
|
53
|
+
require "rgeo/feature/multi_polygon"
|
54
|
+
require "rgeo/feature/factory_generator"
|
data/lib/rgeo/feature/curve.rb
CHANGED
@@ -5,10 +5,7 @@
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
7
|
module RGeo
|
8
|
-
|
9
8
|
module Feature
|
10
|
-
|
11
|
-
|
12
9
|
# == SFS 1.1 Description
|
13
10
|
#
|
14
11
|
# A Curve is a 1-dimensional geometric object usually stored as a
|
@@ -43,11 +40,9 @@ module RGeo
|
|
43
40
|
# Some implementations may support higher dimensional points.
|
44
41
|
|
45
42
|
module Curve
|
46
|
-
|
47
43
|
include Geometry
|
48
44
|
extend Type
|
49
45
|
|
50
|
-
|
51
46
|
# === SFS 1.1 Description
|
52
47
|
#
|
53
48
|
# The length of this Curve in its associated spatial reference.
|
@@ -60,7 +55,6 @@ module RGeo
|
|
60
55
|
raise Error::UnsupportedOperation, "Method Curve#length not defined."
|
61
56
|
end
|
62
57
|
|
63
|
-
|
64
58
|
# === SFS 1.1 Description
|
65
59
|
#
|
66
60
|
# The start Point of this Curve.
|
@@ -73,7 +67,6 @@ module RGeo
|
|
73
67
|
raise Error::UnsupportedOperation, "Method Curve#start_point not defined."
|
74
68
|
end
|
75
69
|
|
76
|
-
|
77
70
|
# === SFS 1.1 Description
|
78
71
|
#
|
79
72
|
# The end Point of this Curve.
|
@@ -86,7 +79,6 @@ module RGeo
|
|
86
79
|
raise Error::UnsupportedOperation, "Method Curve#end_point not defined."
|
87
80
|
end
|
88
81
|
|
89
|
-
|
90
82
|
# === SFS 1.1 Description
|
91
83
|
#
|
92
84
|
# Returns true if this Curve is closed [StartPoint() = EndPoint()].
|
@@ -100,7 +92,6 @@ module RGeo
|
|
100
92
|
raise Error::UnsupportedOperation, "Method Curve#is_closed? not defined."
|
101
93
|
end
|
102
94
|
|
103
|
-
|
104
95
|
# === SFS 1.1 Description
|
105
96
|
#
|
106
97
|
# Returns true if this Curve is closed [StartPoint() = EndPoint()]
|
@@ -115,11 +106,6 @@ module RGeo
|
|
115
106
|
def is_ring?
|
116
107
|
raise Error::UnsupportedOperation, "Method Curve#is_ring? not defined."
|
117
108
|
end
|
118
|
-
|
119
|
-
|
120
109
|
end
|
121
|
-
|
122
|
-
|
123
110
|
end
|
124
|
-
|
125
111
|
end
|
data/lib/rgeo/feature/factory.rb
CHANGED
@@ -5,10 +5,7 @@
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
7
|
module RGeo
|
8
|
-
|
9
8
|
module Feature
|
10
|
-
|
11
|
-
|
12
9
|
# This is a standard interface for factories of features.
|
13
10
|
# Generally, each Feature implementation will implement these
|
14
11
|
# methods as a standard way to create features.
|
@@ -33,8 +30,6 @@ module RGeo
|
|
33
30
|
# <tt>===</tt>, and case-when constructs.
|
34
31
|
|
35
32
|
module Factory
|
36
|
-
|
37
|
-
|
38
33
|
# All factory implementations MUST include this submodule.
|
39
34
|
# This serves as a marker that may be used to test an object for
|
40
35
|
# factory-ness.
|
@@ -42,7 +37,6 @@ module RGeo
|
|
42
37
|
module Instance
|
43
38
|
end
|
44
39
|
|
45
|
-
|
46
40
|
# Returns meta-information about this factory, by key. This
|
47
41
|
# information may involve support for optional functionality,
|
48
42
|
# properties of the coordinate system, or other characteristics.
|
@@ -78,27 +72,24 @@ module RGeo
|
|
78
72
|
# information is present about whether the coordinate system is
|
79
73
|
# meant to be so interpreted.
|
80
74
|
|
81
|
-
def property(
|
75
|
+
def property(_name_)
|
82
76
|
nil
|
83
77
|
end
|
84
78
|
|
85
|
-
|
86
79
|
# Parse the given string in well-known-text format and return the
|
87
80
|
# resulting feature. Returns nil if the string couldn't be parsed.
|
88
81
|
|
89
|
-
def parse_wkt(
|
82
|
+
def parse_wkt(_str_)
|
90
83
|
nil
|
91
84
|
end
|
92
85
|
|
93
|
-
|
94
86
|
# Parse the given string in well-known-binary format and return the
|
95
87
|
# resulting feature. Returns nil if the string couldn't be parsed.
|
96
88
|
|
97
|
-
def parse_wkb(
|
89
|
+
def parse_wkb(_str_)
|
98
90
|
nil
|
99
91
|
end
|
100
92
|
|
101
|
-
|
102
93
|
# Create a feature of type Point.
|
103
94
|
# The x and y parameters should be Float values.
|
104
95
|
#
|
@@ -106,11 +97,10 @@ module RGeo
|
|
106
97
|
# supported. If both Z and M coordinates are supported, Z should
|
107
98
|
# be passed first.
|
108
99
|
|
109
|
-
def point(
|
100
|
+
def point(_x_, _y_, *_extra_)
|
110
101
|
nil
|
111
102
|
end
|
112
103
|
|
113
|
-
|
114
104
|
# Create a feature of type LineString.
|
115
105
|
# The given points argument should be an Enumerable of Point
|
116
106
|
# objects, or objects that can be cast to Point.
|
@@ -120,11 +110,10 @@ module RGeo
|
|
120
110
|
# result of building geometries from objects of the wrong factory
|
121
111
|
# is undefined.
|
122
112
|
|
123
|
-
def line_string(
|
113
|
+
def line_string(_points_)
|
124
114
|
nil
|
125
115
|
end
|
126
116
|
|
127
|
-
|
128
117
|
# Create a feature of type Line.
|
129
118
|
# The given point arguments should be Point objects, or objects
|
130
119
|
# that can be cast to Point.
|
@@ -134,11 +123,10 @@ module RGeo
|
|
134
123
|
# result of building geometries from objects of the wrong factory
|
135
124
|
# is undefined.
|
136
125
|
|
137
|
-
def line(
|
126
|
+
def line(_start_, _end_)
|
138
127
|
nil
|
139
128
|
end
|
140
129
|
|
141
|
-
|
142
130
|
# Create a feature of type LinearRing.
|
143
131
|
# The given points argument should be an Enumerable of Point
|
144
132
|
# objects, or objects that can be cast to Point.
|
@@ -151,11 +139,10 @@ module RGeo
|
|
151
139
|
# result of building geometries from objects of the wrong factory
|
152
140
|
# is undefined.
|
153
141
|
|
154
|
-
def linear_ring(
|
142
|
+
def linear_ring(_points_)
|
155
143
|
nil
|
156
144
|
end
|
157
145
|
|
158
|
-
|
159
146
|
# Create a feature of type Polygon.
|
160
147
|
# The outer_ring should be a LinearRing, or an object that can be
|
161
148
|
# cast to LinearRing.
|
@@ -168,11 +155,10 @@ module RGeo
|
|
168
155
|
# result of building geometries from objects of the wrong factory
|
169
156
|
# is undefined.
|
170
157
|
|
171
|
-
def polygon(
|
158
|
+
def polygon(_outer_ring_, _inner_rings_ = nil)
|
172
159
|
nil
|
173
160
|
end
|
174
161
|
|
175
|
-
|
176
162
|
# Create a feature of type GeometryCollection.
|
177
163
|
# The elems should be an Enumerable of Geometry objects.
|
178
164
|
#
|
@@ -181,11 +167,10 @@ module RGeo
|
|
181
167
|
# result of building geometries from objects of the wrong factory
|
182
168
|
# is undefined.
|
183
169
|
|
184
|
-
def collection(
|
170
|
+
def collection(_elems_)
|
185
171
|
nil
|
186
172
|
end
|
187
173
|
|
188
|
-
|
189
174
|
# Create a feature of type MultiPoint.
|
190
175
|
# The elems should be an Enumerable of Point objects, or objects
|
191
176
|
# that can be cast to Point.
|
@@ -197,11 +182,10 @@ module RGeo
|
|
197
182
|
# result of building geometries from objects of the wrong factory
|
198
183
|
# is undefined.
|
199
184
|
|
200
|
-
def multi_point(
|
185
|
+
def multi_point(_elems_)
|
201
186
|
nil
|
202
187
|
end
|
203
188
|
|
204
|
-
|
205
189
|
# Create a feature of type MultiLineString.
|
206
190
|
# The elems should be an Enumerable of objects that are or can be
|
207
191
|
# cast to LineString or any of its subclasses.
|
@@ -213,11 +197,10 @@ module RGeo
|
|
213
197
|
# result of building geometries from objects of the wrong factory
|
214
198
|
# is undefined.
|
215
199
|
|
216
|
-
def multi_line_string(
|
200
|
+
def multi_line_string(_elems_)
|
217
201
|
nil
|
218
202
|
end
|
219
203
|
|
220
|
-
|
221
204
|
# Create a feature of type MultiPolygon.
|
222
205
|
# The elems should be an Enumerable of objects that are or can be
|
223
206
|
# cast to Polygon or any of its subclasses.
|
@@ -231,11 +214,10 @@ module RGeo
|
|
231
214
|
# result of building geometries from objects of the wrong factory
|
232
215
|
# is undefined.
|
233
216
|
|
234
|
-
def multi_polygon(
|
217
|
+
def multi_polygon(_elems_)
|
235
218
|
nil
|
236
219
|
end
|
237
220
|
|
238
|
-
|
239
221
|
# Returns a RGeo::CoordSys::Proj4 representing the projection for
|
240
222
|
# the coordinate system of features created by this factory, or nil
|
241
223
|
# if there is no such proj4 projection.
|
@@ -244,7 +226,6 @@ module RGeo
|
|
244
226
|
nil
|
245
227
|
end
|
246
228
|
|
247
|
-
|
248
229
|
# Returns the coordinate system specification for the features
|
249
230
|
# created by this factory, or nil if there is no such coordinate
|
250
231
|
# system.
|
@@ -257,7 +238,6 @@ module RGeo
|
|
257
238
|
nil
|
258
239
|
end
|
259
240
|
|
260
|
-
|
261
241
|
# This is an optional method that may be implemented to customize
|
262
242
|
# casting for this factory. Basically, RGeo defines standard ways
|
263
243
|
# to cast certain types of objects from one factory to another and
|
@@ -290,14 +270,9 @@ module RGeo
|
|
290
270
|
# algorithm to cast the object. Therefore, by default, you should
|
291
271
|
# return false.
|
292
272
|
|
293
|
-
def override_cast(
|
273
|
+
def override_cast(_original_, _type_, _flags_)
|
294
274
|
false
|
295
275
|
end
|
296
|
-
|
297
|
-
|
298
276
|
end
|
299
|
-
|
300
|
-
|
301
277
|
end
|
302
|
-
|
303
278
|
end
|