Class: GeoScript::Geom::Bounds
- Inherits:
-
ReferencedEnvelope
- Object
- ReferencedEnvelope
- GeoScript::Geom::Bounds
- Includes:
- GeoScript::Geom
- Defined in:
- lib/geoscript/geom/bounds.rb
Constant Summary
Constants included from GeoScript::Geom
Class Method Summary collapse
Instance Method Summary collapse
- #expand(other_bounds) ⇒ Object
- #get_east ⇒ Object
- #get_north ⇒ Object
- #get_projection ⇒ Object
- #get_south ⇒ Object
- #get_west ⇒ Object
-
#initialize(env, proj = nil) ⇒ Bounds
constructor
A new instance of Bounds.
- #tile(resolution) ⇒ Object
- #to_polygon ⇒ Object
Methods included from GeoScript::Geom
buffer, enhance, from_wkt, get_bounds, prepare, simplify, to_wkt
Constructor Details
#initialize(env, proj = nil) ⇒ Bounds
Returns a new instance of Bounds.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/geoscript/geom/bounds.rb', line 9 def initialize(env, proj = nil) projection = GeoScript::Projection.new proj if proj if env.kind_of? Envelope if projection super(env, projection) elsif env.respond_to? :crs if env.crs super(env, env.crs) else super(env, nil) end else super(env, nil) end else if env.kind_of? Hash if projection super(env[:x_min], env[:x_max], env[:y_min], env[:y_max], projection) else super(env[:x_min], env[:x_max], env[:y_min], env[:y_max], nil) end elsif env.kind_of? Array if projection super(env[0], env[1], env[2], env[3], projection) else super(env[0], env[1], env[2], env[3]) end else super() end end end |
Class Method Details
Instance Method Details
#expand(other_bounds) ⇒ Object
71 |
# File 'lib/geoscript/geom/bounds.rb', line 71 def (other_bounds);end |
#get_east ⇒ Object
51 52 53 |
# File 'lib/geoscript/geom/bounds.rb', line 51 def get_east self.max_x end |
#get_north ⇒ Object
55 56 57 |
# File 'lib/geoscript/geom/bounds.rb', line 55 def get_north self.max_y end |
#get_projection ⇒ Object
59 60 61 62 |
# File 'lib/geoscript/geom/bounds.rb', line 59 def get_projection crs = self.coordinate_reference_system GeoScript::Projection.new crs if crs end |
#get_south ⇒ Object
47 48 49 |
# File 'lib/geoscript/geom/bounds.rb', line 47 def get_south self.min_y end |
#get_west ⇒ Object
43 44 45 |
# File 'lib/geoscript/geom/bounds.rb', line 43 def get_west self.min_x end |
#tile(resolution) ⇒ Object
75 |
# File 'lib/geoscript/geom/bounds.rb', line 75 def tile(resolution);end |
#to_polygon ⇒ Object
73 |
# File 'lib/geoscript/geom/bounds.rb', line 73 def to_polygon;end |