rgeo 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.2.6 / 2011-03-31
2
+
3
+ * Ring direction analysis crashed if any of the line segments were zero length. Fixed. (Reported by spara.)
4
+
1
5
  === 0.2.5 / 2011-03-21
2
6
 
3
7
  * Line segment intersection tests in the simple cartesian implementations were failing for a few cases involving collinear segments. Fixed. (Reported by Dimitry Solovyov.)
data/README.rdoc CHANGED
@@ -70,14 +70,7 @@ Install RGeo as a gem:
70
70
  gem install rgeo
71
71
 
72
72
  Note: By default, the gem installation looks for the GEOS library in the
73
- following locations:
74
-
75
- * /usr/local
76
- * /usr/local/geos
77
- * /opt/local
78
- * /opt/geos
79
- * /opt
80
- * /usr
73
+ following locations: <tt>/usr/local</tt>, <tt>/usr/local/geos</tt>, <tt>/opt/local</tt>, <tt>/opt/geos</tt>, <tt>/opt</tt>, <tt>/usr</tt>.
81
74
 
82
75
  If GEOS has been installed in a different location, you must provide its
83
76
  installation prefix directory using the "--with-geos-dir" option. This
@@ -87,16 +80,7 @@ the switches interpreted by the gem command. For example:
87
80
  gem install rgeo -- --with-geos-dir=/path/to/my/geos/installation
88
81
 
89
82
  Similarly, the gem installation looks for the Proj4 library in the
90
- following locations by default:
91
-
92
- * /usr/local
93
- * /usr/local/proj
94
- * /usr/local/proj4
95
- * /opt/local
96
- * /opt/proj
97
- * /opt/proj4
98
- * /opt
99
- * /usr
83
+ following locations by default: <tt>/usr/local</tt>, <tt>/usr/local/proj</tt>, <tt>/usr/local/proj4</tt>, <tt>/opt/local</tt>, <tt>/opt/proj</tt>, <tt>/opt/proj4</tt>, <tt>/opt</tt>, <tt>/usr</tt>.
100
84
 
101
85
  If Proj4 is installed in a different location, you must provide its
102
86
  installation prefix directory using the "--with-proj-dir" option.
@@ -143,7 +127,7 @@ Geospatial Foundation; more information is available on OSGeo's web site
143
127
 
144
128
  === License
145
129
 
146
- Copyright 2010 Daniel Azuma
130
+ Copyright 2011 Daniel Azuma
147
131
 
148
132
  All rights reserved.
149
133
 
data/Version CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.6
@@ -69,6 +69,8 @@ module RGeo
69
69
  r_ = ::Math.sqrt(x_*x_ + y_*y_)
70
70
  if r_ > 0.0
71
71
  segs_ << x_/r_ << y_/r_
72
+ else
73
+ size_ -= 1
72
74
  end
73
75
  end
74
76
  segs_ << segs_[0] << segs_[1]
@@ -123,7 +123,12 @@ module RGeo
123
123
  end
124
124
  end
125
125
  srid_ ||= coord_sys_.authority_code if coord_sys_
126
- Geographic::Factory.new('Spherical', :has_z_coordinate => opts_[:has_z_coordinate], :has_m_coordinate => opts_[:has_m_coordinate], :proj4 => proj4_ || _proj4_4055, :coord_sys => coord_sys_ || _coordsys_4055, :srid => (srid_ || 4055).to_i)
126
+ Geographic::Factory.new('Spherical',
127
+ :has_z_coordinate => opts_[:has_z_coordinate],
128
+ :has_m_coordinate => opts_[:has_m_coordinate],
129
+ :proj4 => proj4_ || _proj4_4055,
130
+ :coord_sys => coord_sys_ || _coordsys_4055,
131
+ :srid => (srid_ || 4055).to_i)
127
132
  end
128
133
 
129
134
 
@@ -181,8 +186,17 @@ module RGeo
181
186
  # more details.
182
187
 
183
188
  def simple_mercator_factory(opts_={})
184
- factory_ = Geographic::Factory.new('Projected', :proj4 => _proj4_4326, :coord_sys => _coordsys_4326, :srid => 4326, :has_z_coordinate => opts_[:has_z_coordinate], :has_m_coordinate => opts_[:has_m_coordinate])
185
- projector_ = Geographic::SimpleMercatorProjector.new(factory_, :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])
189
+ factory_ = Geographic::Factory.new('Projected',
190
+ :proj4 => _proj4_4326,
191
+ :coord_sys => _coordsys_4326,
192
+ :srid => 4326,
193
+ :has_z_coordinate => opts_[:has_z_coordinate],
194
+ :has_m_coordinate => opts_[:has_m_coordinate])
195
+ projector_ = Geographic::SimpleMercatorProjector.new(factory_,
196
+ :buffer_resolution => opts_[:buffer_resolution],
197
+ :lenient_multi_polygon_assertions => opts_[:lenient_multi_polygon_assertions],
198
+ :has_z_coordinate => opts_[:has_z_coordinate],
199
+ :has_m_coordinate => opts_[:has_m_coordinate])
186
200
  factory_._set_projector(projector_)
187
201
  factory_
188
202
  end
@@ -314,8 +328,14 @@ module RGeo
314
328
  srid_ ||= coord_sys_.authority_code if coord_sys_
315
329
  srid_ ||= 4326
316
330
  # Now we should have all the coordinate system info.
317
- factory_ = Geographic::Factory.new('Projected', :proj4 => proj4_, :coord_sys => coord_sys_, :srid => srid_.to_i, :has_z_coordinate => projection_factory_.property(:has_z_coordinate), :has_m_coordinate => projection_factory_.property(:has_m_coordinate))
318
- projector_ = Geographic::Proj4Projector.create_from_existing_factory(factory_, projection_factory_)
331
+ factory_ = Geographic::Factory.new('Projected',
332
+ :proj4 => proj4_,
333
+ :coord_sys => coord_sys_,
334
+ :srid => srid_.to_i,
335
+ :has_z_coordinate => projection_factory_.property(:has_z_coordinate),
336
+ :has_m_coordinate => projection_factory_.property(:has_m_coordinate))
337
+ projector_ = Geographic::Proj4Projector.create_from_existing_factory(factory_,
338
+ projection_factory_)
319
339
  else
320
340
  # Determine projection coordinate system. First check the parameters.
321
341
  projection_proj4_ = opts_[:projection_proj4]
@@ -363,8 +383,20 @@ module RGeo
363
383
  srid_ ||= coord_sys_.authority_code if coord_sys_
364
384
  srid_ ||= 4326
365
385
  # Now we should have all the coordinate system info.
366
- factory_ = Geographic::Factory.new('Projected', :proj4 => proj4_, :coord_sys => coord_sys_, :srid => srid_.to_i, :has_z_coordinate => opts_[:has_z_coordinate], :has_m_coordinate => opts_[:has_m_coordinate])
367
- projector_ = Geographic::Proj4Projector.create_from_proj4(factory_, projection_proj4_, :srid => projection_srid_, :coord_sys => projection_coord_sys_, :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])
386
+ factory_ = Geographic::Factory.new('Projected',
387
+ :proj4 => proj4_,
388
+ :coord_sys => coord_sys_,
389
+ :srid => srid_.to_i,
390
+ :has_z_coordinate => opts_[:has_z_coordinate],
391
+ :has_m_coordinate => opts_[:has_m_coordinate])
392
+ projector_ = Geographic::Proj4Projector.create_from_proj4(factory_,
393
+ projection_proj4_,
394
+ :srid => projection_srid_,
395
+ :coord_sys => projection_coord_sys_,
396
+ :buffer_resolution => opts_[:buffer_resolution],
397
+ :lenient_multi_polygon_assertions => opts_[:lenient_multi_polygon_assertions],
398
+ :has_z_coordinate => opts_[:has_z_coordinate],
399
+ :has_m_coordinate => opts_[:has_m_coordinate])
368
400
  end
369
401
  factory_._set_projector(projector_)
370
402
  factory_
@@ -101,7 +101,8 @@ module RGeo
101
101
 
102
102
  def eql?(obj_) # :nodoc:
103
103
  return false unless obj_.kind_of?(ProjectedWindow)
104
- @factory == obj_.factory && @x_min == obj_.x_min && @x_max == obj_.x_max && @y_min = obj_.y_min && @y_max = obj_.y_max
104
+ @factory == obj_.factory && @x_min == obj_.x_min && @x_max == obj_.x_max &&
105
+ @y_min = obj_.y_min && @y_max = obj_.y_max
105
106
  end
106
107
  alias_method :==, :eql?
107
108
 
@@ -359,7 +360,8 @@ module RGeo
359
360
  def with_margin(x_margin_, y_margin_=nil)
360
361
  y_margin_ ||= x_margin_
361
362
  if x_margin_ != 0.0 || y_margin_ != 0.0
362
- ProjectedWindow.new(@factory, @x_min - x_margin_, @y_min - y_margin_, @x_max + x_margin_, @y_max + y_margin_)
363
+ ProjectedWindow.new(@factory, @x_min - x_margin_, @y_min - y_margin_,
364
+ @x_max + x_margin_, @y_max + y_margin_)
363
365
  else
364
366
  self
365
367
  end
@@ -393,7 +395,7 @@ module RGeo
393
395
  factory_ = point_.factory
394
396
  projection_ = factory_.project(point_)
395
397
  ProjectedWindow.new(factory_, projection_.x - x_margin_, projection_.y - y_margin_,
396
- projection_.x + x_margin_, projection_.y + y_margin_)
398
+ projection_.x + x_margin_, projection_.y + y_margin_)
397
399
  end
398
400
 
399
401
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rgeo
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.5
5
+ version: 0.2.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Daniel Azuma
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-21 00:00:00 -07:00
13
+ date: 2011-03-31 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies: []
16
16