rgeo 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/History.rdoc +6 -0
  2. data/README.rdoc +10 -7
  3. data/Version +1 -1
  4. data/ext/geos_c_impl/extconf.rb +42 -34
  5. data/ext/geos_c_impl/factory.c +56 -39
  6. data/ext/geos_c_impl/factory.h +55 -45
  7. data/ext/geos_c_impl/geometry.c +137 -93
  8. data/ext/geos_c_impl/geometry_collection.c +67 -46
  9. data/ext/geos_c_impl/line_string.c +79 -54
  10. data/ext/geos_c_impl/point.c +37 -24
  11. data/ext/geos_c_impl/polygon.c +40 -25
  12. data/ext/proj4_c_impl/extconf.rb +44 -36
  13. data/lib/rgeo/coord_sys.rb +3 -1
  14. data/lib/rgeo/geos.rb +3 -1
  15. data/lib/rgeo/geos/impl_additions.rb +12 -10
  16. data/test/coord_sys/tc_proj4.rb +1 -1
  17. data/test/geos/tc_factory.rb +1 -1
  18. data/test/geos/tc_geometry_collection.rb +1 -1
  19. data/test/geos/tc_line_string.rb +1 -1
  20. data/test/geos/tc_misc.rb +1 -1
  21. data/test/geos/tc_multi_line_string.rb +1 -1
  22. data/test/geos/tc_multi_point.rb +1 -1
  23. data/test/geos/tc_multi_polygon.rb +1 -1
  24. data/test/geos/tc_point.rb +1 -1
  25. data/test/geos/tc_polygon.rb +1 -1
  26. data/test/geos/tc_zmfactory.rb +1 -1
  27. data/test/projected_geographic/tc_geometry_collection.rb +1 -1
  28. data/test/projected_geographic/tc_line_string.rb +1 -1
  29. data/test/projected_geographic/tc_multi_line_string.rb +1 -1
  30. data/test/projected_geographic/tc_multi_point.rb +1 -1
  31. data/test/projected_geographic/tc_multi_polygon.rb +1 -1
  32. data/test/projected_geographic/tc_point.rb +1 -1
  33. data/test/projected_geographic/tc_polygon.rb +1 -1
  34. data/test/simple_cartesian/tc_calculations.rb +1 -1
  35. data/test/tc_oneoff.rb +5 -5
  36. data/test/wkrep/tc_wkt_parser.rb +4 -4
  37. metadata +3 -3
data/test/geos/tc_misc.rb CHANGED
@@ -69,4 +69,4 @@ module RGeo
69
69
 
70
70
  end
71
71
  end
72
- end
72
+ end if ::RGeo::Geos.supported?
@@ -59,4 +59,4 @@ module RGeo
59
59
 
60
60
  end
61
61
  end
62
- end
62
+ end if ::RGeo::Geos.supported?
@@ -59,4 +59,4 @@ module RGeo
59
59
 
60
60
  end
61
61
  end
62
- end
62
+ end if ::RGeo::Geos.supported?
@@ -60,4 +60,4 @@ module RGeo
60
60
 
61
61
  end
62
62
  end
63
- end
63
+ end if ::RGeo::Geos.supported?
@@ -83,4 +83,4 @@ module RGeo
83
83
 
84
84
  end
85
85
  end
86
- end
86
+ end if ::RGeo::Geos.supported?
@@ -59,4 +59,4 @@ module RGeo
59
59
 
60
60
  end
61
61
  end
62
- end
62
+ end if ::RGeo::Geos.supported?
@@ -82,4 +82,4 @@ module RGeo
82
82
 
83
83
  end
84
84
  end
85
- end
85
+ end if ::RGeo::Geos.supported?
@@ -59,4 +59,4 @@ module RGeo
59
59
 
60
60
  end
61
61
  end
62
- end
62
+ end if ::RGeo::CoordSys::Proj4.supported?
@@ -59,4 +59,4 @@ module RGeo
59
59
 
60
60
  end
61
61
  end
62
- end
62
+ end if ::RGeo::CoordSys::Proj4.supported?
@@ -59,4 +59,4 @@ module RGeo
59
59
 
60
60
  end
61
61
  end
62
- end
62
+ end if ::RGeo::CoordSys::Proj4.supported?
@@ -59,4 +59,4 @@ module RGeo
59
59
 
60
60
  end
61
61
  end
62
- end
62
+ end if ::RGeo::CoordSys::Proj4.supported?
@@ -60,4 +60,4 @@ module RGeo
60
60
 
61
61
  end
62
62
  end
63
- end
63
+ end if ::RGeo::CoordSys::Proj4.supported?
@@ -90,4 +90,4 @@ module RGeo
90
90
 
91
91
  end
92
92
  end
93
- end
93
+ end if ::RGeo::CoordSys::Proj4.supported?
@@ -59,4 +59,4 @@ module RGeo
59
59
 
60
60
  end
61
61
  end
62
- end
62
+ end if ::RGeo::CoordSys::Proj4.supported?
@@ -46,7 +46,7 @@ module RGeo
46
46
 
47
47
 
48
48
  def setup
49
- @factory = ::RGeo::Geos.factory
49
+ @factory = ::RGeo::Cartesian.simple_factory
50
50
  @point1 = @factory.point(3, 4)
51
51
  @point2 = @factory.point(5, 5)
52
52
  @point3 = @factory.point(6, 4)
data/test/tc_oneoff.rb CHANGED
@@ -45,11 +45,11 @@ module RGeo
45
45
 
46
46
 
47
47
  def setup
48
- @mercator_factory = ::RGeo::Geographic.simple_mercator_factory
49
- @spherical_factory = ::RGeo::Geographic.spherical_factory(:has_z_coordinate => true)
50
- @projected_factory = ::RGeo::Geographic.projected_factory(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857, :has_z_coordinate => true)
51
- @geos_factory = ::RGeo::Geos.factory(:srid => 4326, :has_z_coordinate => true)
52
- @cartesian_factory = ::RGeo::Cartesian.simple_factory(:srid => 1, :has_z_coordinate => true)
48
+ # @mercator_factory = ::RGeo::Geographic.simple_mercator_factory
49
+ # @spherical_factory = ::RGeo::Geographic.spherical_factory(:has_z_coordinate => true)
50
+ # @projected_factory = ::RGeo::Geographic.projected_factory(:projection_proj4 => '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', :projection_srid => 3857, :has_z_coordinate => true)
51
+ # @geos_factory = ::RGeo::Geos.factory(:srid => 4326, :has_z_coordinate => true)
52
+ # @cartesian_factory = ::RGeo::Cartesian.simple_factory(:srid => 1, :has_z_coordinate => true)
53
53
  end
54
54
 
55
55
 
@@ -320,11 +320,11 @@ module RGeo
320
320
  def test_polygon_basic
321
321
  factory_ = ::RGeo::Cartesian.preferred_factory
322
322
  parser_ = ::RGeo::WKRep::WKTParser.new(factory_)
323
- obj_ = parser_.parse('POLYGON((1 2, 3 4, 5 6, 1 2))')
323
+ obj_ = parser_.parse('POLYGON((1 2, 3 4, 5 7, 1 2))')
324
324
  assert_equal(::RGeo::Feature::Polygon, obj_.geometry_type)
325
325
  assert_equal(4, obj_.exterior_ring.num_points)
326
326
  assert_equal(1, obj_.exterior_ring.point_n(0).x)
327
- assert_equal(6, obj_.exterior_ring.point_n(2).y)
327
+ assert_equal(7, obj_.exterior_ring.point_n(2).y)
328
328
  end
329
329
 
330
330
 
@@ -394,12 +394,12 @@ module RGeo
394
394
  def test_multipolygon_basic
395
395
  factory_ = ::RGeo::Cartesian.preferred_factory(:has_z_coordinate => true)
396
396
  parser_ = ::RGeo::WKRep::WKTParser.new(factory_)
397
- obj_ = parser_.parse('MULTIPOLYGON(((-1 -2 0, -3 -4 0, -5 -6 0, -1 -2 0)),((0 0 -1, 10 0 -2, 10 10 -3, 0 10 -4, 0 0 -5),(1 1 -6, 2 3 -7, 3 1 -8, 1 1 -9)))')
397
+ obj_ = parser_.parse('MULTIPOLYGON(((-1 -2 0, -3 -4 0, -5 -7 0, -1 -2 0)),((0 0 -1, 10 0 -2, 10 10 -3, 0 10 -4, 0 0 -5),(1 1 -6, 2 3 -7, 3 1 -8, 1 1 -9)))')
398
398
  assert_equal(::RGeo::Feature::MultiPolygon, obj_.geometry_type)
399
399
  assert_equal(2, obj_.num_geometries)
400
400
  assert_equal(4, obj_[0].exterior_ring.num_points)
401
401
  assert_equal(-1, obj_[0].exterior_ring.point_n(0).x)
402
- assert_equal(-6, obj_[0].exterior_ring.point_n(2).y)
402
+ assert_equal(-7, obj_[0].exterior_ring.point_n(2).y)
403
403
  assert_equal(5, obj_[1].exterior_ring.num_points)
404
404
  assert_equal(0, obj_[1].exterior_ring.point_n(0).x)
405
405
  assert_equal(10, obj_[1].exterior_ring.point_n(2).y)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Azuma
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-07 00:00:00 -08:00
17
+ date: 2010-12-09 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies: []
20
20