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.


12
13
14
15
# File 'lib/rgeo/geographic/proj4_projector.rb', line 12

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


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

def projection_factory
  @projection_factory
end

Class Method Details

.create_from_existing_factory(geography_factory, projection_factory) ⇒ Object


41
42
43
# File 'lib/rgeo/geographic/proj4_projector.rb', line 41

def create_from_existing_factory(geography_factory, projection_factory)
  new(geography_factory, projection_factory)
end

.create_from_proj4(geography_factory, proj4, opts = {}) ⇒ Object


45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/rgeo/geographic/proj4_projector.rb', line 45

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

#limits_windowObject


36
37
38
# File 'lib/rgeo/geographic/proj4_projector.rb', line 36

def limits_window
  nil
end

#project(geometry) ⇒ Object


22
23
24
# File 'lib/rgeo/geographic/proj4_projector.rb', line 22

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

#set_factories(geography_factory, projection_factory) ⇒ Object


17
18
19
20
# File 'lib/rgeo/geographic/proj4_projector.rb', line 17

def set_factories(geography_factory, projection_factory)
  @geography_factory = geography_factory
  @projection_factory = projection_factory
end

#unproject(geometry) ⇒ Object


26
27
28
# File 'lib/rgeo/geographic/proj4_projector.rb', line 26

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

#wraps?Boolean

Returns:

  • (Boolean)

32
33
34
# File 'lib/rgeo/geographic/proj4_projector.rb', line 32

def wraps?
  false
end