Class: RGeo::Geographic::Proj4Projector

Inherits:
Object
  • Object
show all
Defined in:
lib/rgeo/geographic/proj4_projector.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(geography_factory_, projection_factory_) ⇒ Proj4Projector

Returns a new instance of Proj4Projector.



45
46
47
48
# File 'lib/rgeo/geographic/proj4_projector.rb', line 45

def initialize(geography_factory_, projection_factory_)
  @geography_factory = geography_factory_
  @projection_factory = projection_factory_
end

Class Method Details

.create_from_existing_factory(geography_factory_, projection_factory_) ⇒ Object



79
80
81
# File 'lib/rgeo/geographic/proj4_projector.rb', line 79

def create_from_existing_factory(geography_factory_, projection_factory_)
  new(geography_factory_, projection_factory_)
end

.create_from_proj4(geography_factory_, proj4_, opts_ = {}) ⇒ Object



84
85
86
87
# File 'lib/rgeo/geographic/proj4_projector.rb', line 84

def create_from_proj4(geography_factory_, proj4_, opts_={})
  projection_factory_ = Cartesian.preferred_factory(:proj4 => proj4_, :coord_sys => opts_[:coord_sys], :srid => opts_[:srid], :buffer_resolution => opts_[:buffer_resolution], :lenient_multi_polygon_assertions => opts_[:lenient_multi_polygon_assertions], :has_z_coordinate => opts_[:has_z_coordinate], :has_m_coordinate => opts_[:has_m_coordinate])
  new(geography_factory_, projection_factory_)
end

Instance Method Details

#limits_windowObject



71
72
73
# File 'lib/rgeo/geographic/proj4_projector.rb', line 71

def limits_window
  nil
end

#project(geometry_) ⇒ Object



51
52
53
# File 'lib/rgeo/geographic/proj4_projector.rb', line 51

def project(geometry_)
  Feature.cast(geometry_, @projection_factory, :project)
end

#projection_factoryObject



61
62
63
# File 'lib/rgeo/geographic/proj4_projector.rb', line 61

def projection_factory
  @projection_factory
end

#unproject(geometry_) ⇒ Object



56
57
58
# File 'lib/rgeo/geographic/proj4_projector.rb', line 56

def unproject(geometry_)
  Feature.cast(geometry_, @geography_factory, :project)
end

#wraps?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/rgeo/geographic/proj4_projector.rb', line 66

def wraps?
  false
end