proj4rb 2.2.2 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +71 -66
- data/Gemfile +4 -4
- data/README.rdoc +5 -6
- data/Rakefile +27 -27
- data/lib/api/api.rb +11 -4
- data/lib/api/api_6_0.rb +1 -1
- data/lib/{area.rb → proj/area.rb} +0 -0
- data/lib/{config.rb → proj/config.rb} +0 -0
- data/lib/{context.rb → proj/context.rb} +0 -0
- data/lib/{coordinate.rb → proj/coordinate.rb} +0 -0
- data/lib/{crs.rb → proj/crs.rb} +0 -0
- data/lib/{ellipsoid.rb → proj/ellipsoid.rb} +0 -0
- data/lib/{error.rb → proj/error.rb} +0 -0
- data/lib/{operation.rb → proj/operation.rb} +0 -0
- data/lib/{pj_object.rb → proj/pj_object.rb} +0 -0
- data/lib/{point.rb → proj/point.rb} +0 -0
- data/lib/{prime_meridian.rb → proj/prime_meridian.rb} +0 -0
- data/lib/{projection.rb → proj/projection.rb} +0 -0
- data/lib/{transformation.rb → proj/transformation.rb} +0 -0
- data/lib/{unit.rb → proj/unit.rb} +0 -0
- data/lib/proj.rb +15 -15
- data/proj4rb.gemspec +32 -32
- data/test/abstract_test.rb +7 -7
- data/test/coordinate_test.rb +34 -34
- data/test/crs_test.rb +372 -372
- data/test/ellipsoid_test.rb +34 -34
- data/test/operation_test.rb +29 -29
- data/test/prime_meridians_test.rb +33 -33
- data/test/proj_test.rb +16 -16
- data/test/projection_test.rb +225 -223
- data/test/transformation_test.rb +67 -67
- data/test/unit_test.rb +47 -47
- metadata +21 -21
data/test/ellipsoid_test.rb
CHANGED
@@ -1,34 +1,34 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
require_relative './abstract_test'
|
4
|
-
|
5
|
-
class EllipsoidTest < AbstractTest
|
6
|
-
def test_get_all
|
7
|
-
ellipsoids = Proj::Ellipsoid.list.map {|ellipsoid| ellipsoid.id }
|
8
|
-
assert(ellipsoids.include?('WGS84'))
|
9
|
-
assert(ellipsoids.include?('bessel'))
|
10
|
-
assert(ellipsoids.include?('lerch'))
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_one
|
14
|
-
ellipsoid = Proj::Ellipsoid.get('bessel')
|
15
|
-
assert_kind_of Proj::Ellipsoid, ellipsoid
|
16
|
-
assert_equal('bessel', ellipsoid.id)
|
17
|
-
assert_equal('a=6377397.155', ellipsoid.major)
|
18
|
-
assert_equal('rf=299.1528128', ellipsoid.ell)
|
19
|
-
assert_equal('Bessel 1841', ellipsoid.name)
|
20
|
-
assert_equal('bessel', ellipsoid.to_s)
|
21
|
-
assert_equal('#<Proj::Ellipsoid id="bessel", major="a=6377397.155", ell="rf=299.1528128", name="Bessel 1841">', ellipsoid.inspect)
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_equal
|
25
|
-
e1 = Proj::Ellipsoid.get('bessel')
|
26
|
-
e2 = Proj::Ellipsoid.get('bessel')
|
27
|
-
assert e1 == e2
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_failed_get
|
31
|
-
ellipsoid = Proj::Ellipsoid.get('foo')
|
32
|
-
assert_nil ellipsoid
|
33
|
-
end
|
34
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require_relative './abstract_test'
|
4
|
+
|
5
|
+
class EllipsoidTest < AbstractTest
|
6
|
+
def test_get_all
|
7
|
+
ellipsoids = Proj::Ellipsoid.list.map {|ellipsoid| ellipsoid.id }
|
8
|
+
assert(ellipsoids.include?('WGS84'))
|
9
|
+
assert(ellipsoids.include?('bessel'))
|
10
|
+
assert(ellipsoids.include?('lerch'))
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_one
|
14
|
+
ellipsoid = Proj::Ellipsoid.get('bessel')
|
15
|
+
assert_kind_of Proj::Ellipsoid, ellipsoid
|
16
|
+
assert_equal('bessel', ellipsoid.id)
|
17
|
+
assert_equal('a=6377397.155', ellipsoid.major)
|
18
|
+
assert_equal('rf=299.1528128', ellipsoid.ell)
|
19
|
+
assert_equal('Bessel 1841', ellipsoid.name)
|
20
|
+
assert_equal('bessel', ellipsoid.to_s)
|
21
|
+
assert_equal('#<Proj::Ellipsoid id="bessel", major="a=6377397.155", ell="rf=299.1528128", name="Bessel 1841">', ellipsoid.inspect)
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_equal
|
25
|
+
e1 = Proj::Ellipsoid.get('bessel')
|
26
|
+
e2 = Proj::Ellipsoid.get('bessel')
|
27
|
+
assert e1 == e2
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_failed_get
|
31
|
+
ellipsoid = Proj::Ellipsoid.get('foo')
|
32
|
+
assert_nil ellipsoid
|
33
|
+
end
|
34
|
+
end
|
data/test/operation_test.rb
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
require_relative './abstract_test'
|
4
|
-
|
5
|
-
class OperationTest < AbstractTest
|
6
|
-
def test_get_all
|
7
|
-
operations = Proj::Operation.list.map {|operation| operation.id}
|
8
|
-
assert(operations.include?('aea'))
|
9
|
-
assert(operations.include?('wintri'))
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_one
|
13
|
-
operation = Proj::Operation.get('rouss')
|
14
|
-
assert_kind_of(Proj::Operation, operation)
|
15
|
-
assert_equal('rouss', operation.id)
|
16
|
-
assert_equal("Roussilhe Stereographic\n\tAzi, Ell", operation.description)
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_equal
|
20
|
-
e1 = Proj::Operation.get('rouss')
|
21
|
-
e2 = Proj::Operation.get('rouss')
|
22
|
-
assert(e1 == e2)
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_failed_get
|
26
|
-
operation = Proj::Operation.get('foo')
|
27
|
-
assert_nil(operation)
|
28
|
-
end
|
29
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require_relative './abstract_test'
|
4
|
+
|
5
|
+
class OperationTest < AbstractTest
|
6
|
+
def test_get_all
|
7
|
+
operations = Proj::Operation.list.map {|operation| operation.id}
|
8
|
+
assert(operations.include?('aea'))
|
9
|
+
assert(operations.include?('wintri'))
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_one
|
13
|
+
operation = Proj::Operation.get('rouss')
|
14
|
+
assert_kind_of(Proj::Operation, operation)
|
15
|
+
assert_equal('rouss', operation.id)
|
16
|
+
assert_equal("Roussilhe Stereographic\n\tAzi, Ell", operation.description)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_equal
|
20
|
+
e1 = Proj::Operation.get('rouss')
|
21
|
+
e2 = Proj::Operation.get('rouss')
|
22
|
+
assert(e1 == e2)
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_failed_get
|
26
|
+
operation = Proj::Operation.get('foo')
|
27
|
+
assert_nil(operation)
|
28
|
+
end
|
29
|
+
end
|
@@ -1,33 +1,33 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
require_relative './abstract_test'
|
4
|
-
|
5
|
-
class PrimeMeridiansTest < AbstractTest
|
6
|
-
def test_get_all
|
7
|
-
prime_meridians = Proj::PrimeMeridian.list.sort.collect {|prime_meridian| prime_meridian.id}
|
8
|
-
assert prime_meridians.index('greenwich')
|
9
|
-
assert prime_meridians.index('athens')
|
10
|
-
assert prime_meridians.index('lisbon')
|
11
|
-
assert prime_meridians.index('rome')
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_one
|
15
|
-
prime_meridian = Proj::PrimeMeridian.get('lisbon')
|
16
|
-
assert_kind_of(Proj::PrimeMeridian, prime_meridian)
|
17
|
-
assert_equal('lisbon', prime_meridian.id)
|
18
|
-
assert_equal('9d07\'54.862"W', prime_meridian.defn)
|
19
|
-
assert_equal('#<Proj::PrimeMeridian id="lisbon", defn="9d07\'54.862"W">', prime_meridian.inspect)
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_compare
|
23
|
-
u1 = Proj::PrimeMeridian.get('lisbon')
|
24
|
-
u2 = Proj::PrimeMeridian.get('lisbon')
|
25
|
-
assert u1 == u2
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_failed_get
|
29
|
-
prime_meridian = Proj::PrimeMeridian.get('foo')
|
30
|
-
assert_nil prime_meridian
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require_relative './abstract_test'
|
4
|
+
|
5
|
+
class PrimeMeridiansTest < AbstractTest
|
6
|
+
def test_get_all
|
7
|
+
prime_meridians = Proj::PrimeMeridian.list.sort.collect {|prime_meridian| prime_meridian.id}
|
8
|
+
assert prime_meridians.index('greenwich')
|
9
|
+
assert prime_meridians.index('athens')
|
10
|
+
assert prime_meridians.index('lisbon')
|
11
|
+
assert prime_meridians.index('rome')
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_one
|
15
|
+
prime_meridian = Proj::PrimeMeridian.get('lisbon')
|
16
|
+
assert_kind_of(Proj::PrimeMeridian, prime_meridian)
|
17
|
+
assert_equal('lisbon', prime_meridian.id)
|
18
|
+
assert_equal('9d07\'54.862"W', prime_meridian.defn)
|
19
|
+
assert_equal('#<Proj::PrimeMeridian id="lisbon", defn="9d07\'54.862"W">', prime_meridian.inspect)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_compare
|
23
|
+
u1 = Proj::PrimeMeridian.get('lisbon')
|
24
|
+
u2 = Proj::PrimeMeridian.get('lisbon')
|
25
|
+
assert u1 == u2
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_failed_get
|
29
|
+
prime_meridian = Proj::PrimeMeridian.get('foo')
|
30
|
+
assert_nil prime_meridian
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
data/test/proj_test.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
require_relative './abstract_test'
|
4
|
-
|
5
|
-
class ProjTest < AbstractTest
|
6
|
-
def test_info
|
7
|
-
info = Proj.info
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
refute_nil(info[:searchpath])
|
14
|
-
refute(info[:paths].null?)
|
15
|
-
assert_equal(1, info[:path_count])
|
16
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require_relative './abstract_test'
|
4
|
+
|
5
|
+
class ProjTest < AbstractTest
|
6
|
+
def test_info
|
7
|
+
info = Proj.info
|
8
|
+
assert([4,6,7,8].include?(info[:major]))
|
9
|
+
assert([0,1,2,3].include?(info[:minor]))
|
10
|
+
assert([0,1,2,3].include?(info[:patch]))
|
11
|
+
refute_nil(info[:release])
|
12
|
+
assert_match(/\d\.\d\.\d/, info[:version])
|
13
|
+
refute_nil(info[:searchpath])
|
14
|
+
refute(info[:paths].null?)
|
15
|
+
assert_equal(1, info[:path_count])
|
16
|
+
end
|
17
17
|
end
|