Class: RGeo::Geographic::Proj4Projector

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

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(geography_factory_, projection_factory_) ⇒ Proj4Projector

Returns a new instance of Proj4Projector.



10
11
12
13
# File 'lib/rgeo/geographic/proj4_projector.rb', line 10

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

Instance Attribute Details

#projection_factoryObject (readonly)

Returns the value of attribute projection_factory.



28
29
30
# File 'lib/rgeo/geographic/proj4_projector.rb', line 28

def projection_factory
  @projection_factory
end

Class Method Details

.create_from_existing_factory(geography_factory_, projection_factory_) ⇒ Object



39
40
41
# File 'lib/rgeo/geographic/proj4_projector.rb', line 39

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

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



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/rgeo/geographic/proj4_projector.rb', line 43

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:



15
16
17
18
# File 'lib/rgeo/geographic/proj4_projector.rb', line 15

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

#limits_windowObject



34
35
36
# File 'lib/rgeo/geographic/proj4_projector.rb', line 34

def limits_window
  nil
end

#project(geometry_) ⇒ Object



20
21
22
# File 'lib/rgeo/geographic/proj4_projector.rb', line 20

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

#unproject(geometry_) ⇒ Object



24
25
26
# File 'lib/rgeo/geographic/proj4_projector.rb', line 24

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

#wraps?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/rgeo/geographic/proj4_projector.rb', line 30

def wraps?
  false
end