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


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

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

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


90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/rgeo/geographic/proj4_projector.rb', line 90

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],
    :uses_lenient_assertions => opts_[:uses_lenient_assertions],
    :has_z_coordinate => opts_[:has_z_coordinate],
    :has_m_coordinate => opts_[:has_m_coordinate],
    :wkt_parser => opts_[:wkt_parser], :wkt_generator => opts_[:wkt_generator],
    :wkb_parser => opts_[:wkb_parser], :wkb_generator => opts_[:wkb_generator])
  new(geography_factory_, projection_factory_)
end

Instance Method Details

#_set_factories(geography_factory_, projection_factory_) ⇒ Object

:nodoc:


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

def _set_factories(geography_factory_, projection_factory_)  # :nodoc:
  @geography_factory = geography_factory_
  @projection_factory = projection_factory_
end

#limits_windowObject


77
78
79
# File 'lib/rgeo/geographic/proj4_projector.rb', line 77

def limits_window
  nil
end

#project(geometry_) ⇒ Object


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

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

#projection_factoryObject


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

def projection_factory
  @projection_factory
end

#unproject(geometry_) ⇒ Object


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

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

#wraps?Boolean

Returns:

  • (Boolean)

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

def wraps?
  false
end