Module: Proj::Api
- Extended by:
- FFI::Library
- Defined in:
- lib/api/api.rb,
lib/api/api_4_9.rb,
lib/api/api_5_0.rb,
lib/api/api_5_1.rb,
lib/api/api_5_2.rb,
lib/api/api_6_0.rb,
lib/api/api_6_1.rb,
lib/api/api_6_2.rb
Defined Under Namespace
Classes: P5_FACTORS, PJ_COORD, PJ_ELLPS, PJ_ENU, PJ_GEOD, PJ_GRID_INFO, PJ_INFO, PJ_INIT_INFO, PJ_LIST, PJ_LP, PJ_LPZ, PJ_LPZT, PJ_OPK, PJ_PRIME_MERIDIANS, PJ_PROJ_INFO, PJ_UNITS, PJ_UV, PJ_UVW, PJ_UVWT, PJ_XY, PJ_XYZ, PJ_XYZT, ProjUV
Constant Summary
collapse
- PROJ_VERSION =
Gem::Version.new(version)
- ProjXY =
ProjUV
- ProjLP =
ProjUV
- PJ_OPERATIONS =
PJ_LIST
Class Method Summary
collapse
Class Method Details
.library_versions ⇒ Object
8
9
10
11
12
13
14
15
|
# File 'lib/api/api.rb', line 8
def self.library_versions
[17,
15,
14,
13,
12,
11]
end
|
.linux_search_paths ⇒ Object
37
38
39
40
41
|
# File 'lib/api/api.rb', line 37
def self.linux_search_paths
self.library_versions.map do |version|
"libproj.so.#{version}"
end
end
|
.macos_search_paths ⇒ Object
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/api/api.rb', line 43
def self.macos_search_paths
paths1 = self.library_versions.map do |version|
case version
when 15..17
"/opt/local/lib/proj6/lib/libproj.#{version}.dylib"
when 13..14
"/opt/local/lib/proj5/lib/libproj.#{version}.dylib"
when 11..12
"/opt/local/lib/proj49/lib/libproj.#{version}.dylib"
end
end
paths2 = self.library_versions.map do |version|
"/usr/local/lib/libproj.#{version}.dylib"
end
paths1 + paths2
end
|
.proj_todeg(value) ⇒ Object
87
88
89
|
# File 'lib/api/api.rb', line 87
def Api.proj_todeg(value)
value * 57.295779513082321
end
|
.proj_torad(value) ⇒ Object
83
84
85
|
# File 'lib/api/api.rb', line 83
def Api.proj_torad(value)
value * 0.017453292519943296
end
|
.search_paths ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/api/api.rb', line 17
def self.search_paths
result = case RbConfig::CONFIG['host_os']
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
self.windows_search_paths
when /darwin|mac os/
self.macos_search_paths
else
self.linux_search_paths
end
result << 'libproj'
result
end
|
.windows_search_paths ⇒ Object
31
32
33
34
35
|
# File 'lib/api/api.rb', line 31
def self.windows_search_paths
self.library_versions.map do |version|
"libproj-#{version}"
end
end
|