rgeo-proj4 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/proj4_c_impl/extconf.rb +3 -2
- data/ext/proj4_c_impl/main.c +1 -1
- data/lib/rgeo/coord_sys/proj4.rb +14 -19
- data/lib/rgeo/coord_sys/srs_database/proj4_data.rb +3 -3
- data/lib/rgeo/proj4/version.rb +1 -1
- metadata +6 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05e81871744567d55f6b9d11e115954040f5262e9d3317b9792973f1806f655a
|
4
|
+
data.tar.gz: 0a3f2943bf7c80eb4c9d0680b382ab0c9eed83543ef1f4383326e4bdfb6da250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74ad26d2f7f983b9415b1b301180fe0352a09d4df7425227c2d012220468e147d9b1787c41de2b13f2db9cb5bf9e8a35038beee362393427911854cbff4c49f8
|
7
|
+
data.tar.gz: bcd150775bfa449dad65dd8035f9ceb4e23192dac1f258de2c0b3edf58362e6c48a4b7da7c710bcf3b43de61c92ca64b159f7b6eec2cdaa1ca0cda7a1a1a5ff0
|
data/ext/proj4_c_impl/extconf.rb
CHANGED
@@ -45,9 +45,10 @@ else
|
|
45
45
|
|
46
46
|
found_proj_ = false
|
47
47
|
header_dirs_, lib_dirs_ = dir_config("proj", header_dirs_, lib_dirs_)
|
48
|
-
|
48
|
+
dflag = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"
|
49
|
+
if have_header("proj_api.h", nil, dflag)
|
49
50
|
$libs << " -lproj"
|
50
|
-
if have_func("pj_init_plus", "proj_api.h")
|
51
|
+
if have_func("pj_init_plus", "proj_api.h", dflag)
|
51
52
|
found_proj_ = true
|
52
53
|
else
|
53
54
|
$libs.gsub!(" -lproj", "")
|
data/ext/proj4_c_impl/main.c
CHANGED
data/lib/rgeo/coord_sys/proj4.rb
CHANGED
@@ -44,7 +44,7 @@ module RGeo
|
|
44
44
|
def eql?(rhs_)
|
45
45
|
rhs_.class == self.class && rhs_.canonical_hash == canonical_hash && rhs_._radians? == _radians?
|
46
46
|
end
|
47
|
-
|
47
|
+
alias == eql?
|
48
48
|
|
49
49
|
# Marshal support
|
50
50
|
|
@@ -78,9 +78,7 @@ module RGeo
|
|
78
78
|
def canonical_str
|
79
79
|
unless defined?(@canonical_str)
|
80
80
|
@canonical_str = _canonical_str
|
81
|
-
if @canonical_str.respond_to?(:force_encoding)
|
82
|
-
@canonical_str.force_encoding("US-ASCII")
|
83
|
-
end
|
81
|
+
@canonical_str.force_encoding("US-ASCII") if @canonical_str.respond_to?(:force_encoding)
|
84
82
|
end
|
85
83
|
@canonical_str
|
86
84
|
end
|
@@ -174,9 +172,7 @@ module RGeo
|
|
174
172
|
if defn_.is_a?(::Hash)
|
175
173
|
defn_ = defn_.map { |k_, v_| v_ ? "+#{k_}=#{v_}" : "+#{k_}" }.join(" ")
|
176
174
|
end
|
177
|
-
unless defn_ =~ /^\s*\+/
|
178
|
-
defn_ = defn_.sub(/^(\s*)/, '\1+').gsub(/(\s+)([^+\s])/, '\1+\2')
|
179
|
-
end
|
175
|
+
defn_ = defn_.sub(/^(\s*)/, '\1+').gsub(/(\s+)([^+\s])/, '\1+\2') unless defn_ =~ /^\s*\+/
|
180
176
|
result_ = _create(defn_, opts_[:radians])
|
181
177
|
result_ = nil unless result_._valid?
|
182
178
|
end
|
@@ -202,9 +198,7 @@ module RGeo
|
|
202
198
|
|
203
199
|
def new(defn_, opts_ = {})
|
204
200
|
result_ = create(defn_, opts_)
|
205
|
-
unless result_
|
206
|
-
raise Error::UnsupportedOperation, "Proj4 not supported in this installation"
|
207
|
-
end
|
201
|
+
raise Error::UnsupportedOperation, "Proj4 not supported in this installation" unless result_
|
208
202
|
result_
|
209
203
|
end
|
210
204
|
|
@@ -270,16 +264,17 @@ module RGeo
|
|
270
264
|
y_ *= ImplHelper::Math::RADIANS_PER_DEGREE
|
271
265
|
end
|
272
266
|
coords_ = _transform_coords(from_proj_, to_proj_, x_, y_, from_has_z_ ? from_point_.z : nil)
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
267
|
+
return unless coords_
|
268
|
+
if !to_proj_._radians? && to_proj_._geographic?
|
269
|
+
coords_[0] *= ImplHelper::Math::DEGREES_PER_RADIAN
|
270
|
+
coords_[1] *= ImplHelper::Math::DEGREES_PER_RADIAN
|
271
|
+
end
|
272
|
+
extras_ = []
|
273
|
+
extras_ << coords_[2].to_f if to_has_z_
|
274
|
+
if to_has_m_
|
275
|
+
extras_ << from_has_m_ ? from_point_.m : 0.0
|
282
276
|
end
|
277
|
+
to_factory_.point(coords_[0], coords_[1], *extras_)
|
283
278
|
end
|
284
279
|
|
285
280
|
def transform_linear_ring(from_proj_, from_ring_, to_proj_, to_factory_)
|
@@ -79,7 +79,7 @@ module RGeo
|
|
79
79
|
|
80
80
|
def get(ident_)
|
81
81
|
ident_ = ident_.to_s
|
82
|
-
return @cache[ident_] if @cache
|
82
|
+
return @cache[ident_] if @cache&.include?(ident_)
|
83
83
|
result_ = nil
|
84
84
|
if @populate_state == 0
|
85
85
|
data_ = search_file(ident_)
|
@@ -96,7 +96,7 @@ module RGeo
|
|
96
96
|
# Clear the cache if one exists.
|
97
97
|
|
98
98
|
def clear_cache
|
99
|
-
@cache
|
99
|
+
@cache&.clear
|
100
100
|
@populate_state = 1 if @populate_state == 2
|
101
101
|
end
|
102
102
|
|
@@ -109,7 +109,7 @@ module RGeo
|
|
109
109
|
cur_text_ = nil
|
110
110
|
file_.each do |line_|
|
111
111
|
line_.strip!
|
112
|
-
if (comment_delim_ = line_.index(
|
112
|
+
if (comment_delim_ = line_.index("#"))
|
113
113
|
cur_name_ = line_[comment_delim_ + 1..-1].strip
|
114
114
|
line_ = line_[0..comment_delim_ - 1].strip
|
115
115
|
end
|
data/lib/rgeo/proj4/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgeo-proj4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tee Parham, Daniel Azuma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rgeo
|
@@ -25,19 +25,19 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '5.11'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '5.11'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: test-unit
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3.0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3.0'
|
83
69
|
description: Proj4 extension for rgeo.
|
84
70
|
email:
|
85
71
|
- parhameter@gmail.com, dazuma@gmail.com
|
@@ -114,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
100
|
- !ruby/object:Gem::Version
|
115
101
|
version: '0'
|
116
102
|
requirements: []
|
117
|
-
|
118
|
-
rubygems_version: 2.7.8
|
103
|
+
rubygems_version: 3.0.3
|
119
104
|
signing_key:
|
120
105
|
specification_version: 4
|
121
106
|
summary: Proj4 extension for rgeo.
|