rgeo 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +6 -0
- data/README.rdoc +10 -7
- data/Version +1 -1
- data/ext/geos_c_impl/extconf.rb +42 -34
- data/ext/geos_c_impl/factory.c +56 -39
- data/ext/geos_c_impl/factory.h +55 -45
- data/ext/geos_c_impl/geometry.c +137 -93
- data/ext/geos_c_impl/geometry_collection.c +67 -46
- data/ext/geos_c_impl/line_string.c +79 -54
- data/ext/geos_c_impl/point.c +37 -24
- data/ext/geos_c_impl/polygon.c +40 -25
- data/ext/proj4_c_impl/extconf.rb +44 -36
- data/lib/rgeo/coord_sys.rb +3 -1
- data/lib/rgeo/geos.rb +3 -1
- data/lib/rgeo/geos/impl_additions.rb +12 -10
- data/test/coord_sys/tc_proj4.rb +1 -1
- data/test/geos/tc_factory.rb +1 -1
- data/test/geos/tc_geometry_collection.rb +1 -1
- data/test/geos/tc_line_string.rb +1 -1
- data/test/geos/tc_misc.rb +1 -1
- data/test/geos/tc_multi_line_string.rb +1 -1
- data/test/geos/tc_multi_point.rb +1 -1
- data/test/geos/tc_multi_polygon.rb +1 -1
- data/test/geos/tc_point.rb +1 -1
- data/test/geos/tc_polygon.rb +1 -1
- data/test/geos/tc_zmfactory.rb +1 -1
- data/test/projected_geographic/tc_geometry_collection.rb +1 -1
- data/test/projected_geographic/tc_line_string.rb +1 -1
- data/test/projected_geographic/tc_multi_line_string.rb +1 -1
- data/test/projected_geographic/tc_multi_point.rb +1 -1
- data/test/projected_geographic/tc_multi_polygon.rb +1 -1
- data/test/projected_geographic/tc_point.rb +1 -1
- data/test/projected_geographic/tc_polygon.rb +1 -1
- data/test/simple_cartesian/tc_calculations.rb +1 -1
- data/test/tc_oneoff.rb +5 -5
- data/test/wkrep/tc_wkt_parser.rb +4 -4
- metadata +3 -3
data/test/geos/tc_misc.rb
CHANGED
data/test/geos/tc_multi_point.rb
CHANGED
data/test/geos/tc_point.rb
CHANGED
data/test/geos/tc_polygon.rb
CHANGED
data/test/geos/tc_zmfactory.rb
CHANGED
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
|
|
data/test/wkrep/tc_wkt_parser.rb
CHANGED
@@ -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
|
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(
|
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 -
|
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(-
|
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
|
-
-
|
9
|
-
version: 0.2.
|
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-
|
17
|
+
date: 2010-12-09 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|