module Proj
Constants
- CelestialBody
- Param
Public Class Methods
Convert string of degrees, minutes and seconds to radians.
see proj.org/development/reference/functions.html#c.proj_dmstor proj_dmstor
@param value [String] Value to be converted to radians
@return [Float]
# File lib/proj.rb, line 107 def self.degrees_minutes_seconds_to_radians(value) ptr = FFI::MemoryPointer.new(:string) Api.proj_dmstor(value, ptr) end
Converts degrees to radians
see proj.org/development/reference/functions.html#c.proj_torad proj_torad
@param value [Float] Value in degrees to convert
@return [Float]
# File lib/proj.rb, line 85 def self.degrees_to_radians(value) Api.proj_torad(value) end
Returns information about the Proj
library
@see proj.org/development/reference/functions.html#c.proj_info proj_info
@return [PJ_INFO]
# File lib/proj.rb, line 45 def self.info Api.proj_info end
Return information about the specific init file
@see proj.org/development/reference/functions.html#c.proj_init_info proj_init_info
@param file_name [String] The name of the init file (not the path)
@return [PJ_INIT_INFO]
# File lib/proj.rb, line 74 def self.init_file_info(file_name) Api.proj_init_info(file_name) end
Converts radians degrees
see proj.org/development/reference/functions.html#c.proj_todeg proj_todeg
@param value [Float] Value in radians to convert
@return [Float]
# File lib/proj.rb, line 96 def self.radians_to_degrees(value) Api.proj_todeg(value) end
Convert radians to a string representation of degrees, minutes and seconds
@see proj.org/development/reference/functions.html#c.proj_rtodms proj_rtodms @see proj.org/development/reference/functions.html#c.proj_rtodms2 proj_rtodms2
@param value [Float] Value to be converted in radians @param positive [String] Character denoting positive direction, typically ‘N’ or ‘E’. Default ‘N’ @param negative [String] Character denoting negative direction, typically ‘S’ or ‘W’. Default ‘S’
@return [String]
# File lib/proj.rb, line 122 def self.radians_to_degrees_minutes_seconds(value, positive='N', negative='S') ptr = FFI::MemoryPointer.new(:char, 100) if Api::PROJ_VERSION < Gem::Version.new('9.2.0') Api.proj_rtodms(ptr, value, positive.ord, negative.ord) else Api.proj_rtodms2(ptr, ptr.size, value, positive.ord, negative.ord) end ptr.read_string_to_null end
Returns default search paths
@see proj.org/development/reference/functions.html#c.proj_info proj_info
@return [Array<String>] List of search paths
# File lib/proj.rb, line 63 def self.search_paths self.info[:searchpath].split(";") end
Returns the Proj
version
@see proj.org/development/reference/functions.html#c.proj_info proj_info
@return [String]
# File lib/proj.rb, line 54 def self.version self.info[:version] end