swissgrid 0.0.3 → 0.1.0
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.
- checksums.yaml +13 -5
- data/README.md +10 -0
- data/lib/swissgrid/version.rb +1 -1
- data/lib/swissgrid/wgs84.rb +3 -3
- data/spec/swissgrid_spec.rb +12 -3
- data/swissgrid.gemspec +2 -0
- metadata +37 -10
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NGEzZjZhYjc0ZTA4NmVkOTNjNGRlNGY0ZDc4ZjcxZmMwYTJjZWIyYQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzNhYTA1MDZlMmZkZDg0NzI0OWI3YTRmYjU3YmMxNzZiMDFjYWI5NQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
OGMwN2E5YjVkN2UwZmRlZDE3YWQwNDA3N2YzNjNiZGQxZTA3MWU3MzQ4Njdk
|
10
|
+
NGRmNzVlY2M1YWQ2OWNlMGY0ZDdjOTU2ZWQwZTBiYWQxNzhkM2YxY2I3Y2M2
|
11
|
+
NTNkZWI2NzAxNTgxODBiOGI2NDk1OGM1NGIzZDA3NWIyYTMyZjM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YjVkNzA4MmUwMzNjNzc1NTIyNDlkN2IzYWY3NTMxMTZlZWMzZGRjMjQwNDFk
|
14
|
+
NDM0MWZiMzFkMmM1MTRkMjc1ZmY3NWI1YTUxYTgyMDAwNWRiNjFlNTQ1NDZm
|
15
|
+
NGFlZDNmY2Y1ZGQ2OGIzNTE0MDhhYjVhMDMyOTE5OWE5OGEyNzI=
|
data/README.md
CHANGED
@@ -49,12 +49,22 @@ require 'swissgrid'
|
|
49
49
|
```
|
50
50
|
|
51
51
|
##Changelog
|
52
|
+
* 0.1.0
|
53
|
+
* Fix ch1903 to wgs84 conversion bug. Thanks @christianmeichtry.
|
52
54
|
* 0.0.3
|
53
55
|
* Update Readme.
|
54
56
|
* 0.0.2
|
55
57
|
* Add homepage link to gemspec.
|
56
58
|
* 0.0.1
|
57
59
|
* Publish first version.
|
60
|
+
|
61
|
+
##Specification CH1903 <=> WGS84
|
62
|
+
For more details about the conversion see [Swisstopo Referenzsysteme](http://www.swisstopo.admin.ch/internet/swisstopo/en/home/products/software/products/skripts.parsysrelated1.45237.downloadList.10374.DownloadFile.tmp/swissprojectionen.pdf).
|
63
|
+
|
64
|
+
##Other tools and scripts
|
65
|
+
Swisstopo has also created some scripts and tools for other languages like Java, Python and PHP.
|
66
|
+
|
67
|
+
For more details see [Swisstopo Scripts and Tools](http://www.swisstopo.admin.ch/internet/swisstopo/en/home/products/software/products/skripts.html).
|
58
68
|
|
59
69
|
## Contributing
|
60
70
|
|
data/lib/swissgrid/version.rb
CHANGED
data/lib/swissgrid/wgs84.rb
CHANGED
data/spec/swissgrid_spec.rb
CHANGED
@@ -4,7 +4,7 @@ module Swissgrid
|
|
4
4
|
|
5
5
|
describe Swissgrid do
|
6
6
|
|
7
|
-
it "
|
7
|
+
it "tests conversion from wgs84 to ch1903" do
|
8
8
|
gps_point = [46.881908, 7.471829]
|
9
9
|
swiss_coord = Swissgrid::CH1903(gps_point)
|
10
10
|
expect(swiss_coord[0]).to be_within(0.5).of(602530.221)
|
@@ -13,14 +13,23 @@ module Swissgrid
|
|
13
13
|
end
|
14
14
|
|
15
15
|
|
16
|
-
it "
|
17
|
-
ch1903_point = [
|
16
|
+
it "tests conversion from ch1903 to wgs84" do
|
17
|
+
ch1903_point = [600_000, 200_000]
|
18
18
|
wgs84_coord = Swissgrid::WGS84(ch1903_point)
|
19
19
|
expect(wgs84_coord[0]).to be_within(0.1/3600).of(46.951082877)
|
20
20
|
expect(wgs84_coord[1]).to be_within(0.1/3600).of(7.438632495)
|
21
21
|
pp wgs84_coord
|
22
22
|
end
|
23
23
|
|
24
|
+
it "tests conversion from Thun ch1903 point to wgs 84 point" do
|
25
|
+
ch1903_point = [611_202, 177_630]
|
26
|
+
expected_wgs_point = [46.7497613025, 7.58523830611]
|
27
|
+
wgs84_coord = Swissgrid::WGS84(ch1903_point)
|
28
|
+
expect(wgs84_coord[0]).to be_within(0.5).of(expected_wgs_point[0])
|
29
|
+
expect(wgs84_coord[1]).to be_within(0.5).of(expected_wgs_point[1])
|
30
|
+
pp wgs84_coord
|
31
|
+
end
|
32
|
+
|
24
33
|
end
|
25
34
|
|
26
35
|
end
|
data/swissgrid.gemspec
CHANGED
metadata
CHANGED
@@ -1,43 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swissgrid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Rueedlinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec-core
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
description: Swissgrid is a library to convert gps points into the Swiss coordinate
|
42
70
|
system (CH1903).
|
43
71
|
email:
|
@@ -46,7 +74,7 @@ executables: []
|
|
46
74
|
extensions: []
|
47
75
|
extra_rdoc_files: []
|
48
76
|
files:
|
49
|
-
-
|
77
|
+
- .gitignore
|
50
78
|
- Gemfile
|
51
79
|
- LICENSE.txt
|
52
80
|
- README.md
|
@@ -68,12 +96,12 @@ require_paths:
|
|
68
96
|
- lib
|
69
97
|
required_ruby_version: !ruby/object:Gem::Requirement
|
70
98
|
requirements:
|
71
|
-
- -
|
99
|
+
- - ! '>='
|
72
100
|
- !ruby/object:Gem::Version
|
73
101
|
version: '0'
|
74
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
103
|
requirements:
|
76
|
-
- -
|
104
|
+
- - ! '>='
|
77
105
|
- !ruby/object:Gem::Version
|
78
106
|
version: '0'
|
79
107
|
requirements: []
|
@@ -85,4 +113,3 @@ summary: A library to convert gps points into the Swiss coordinate system (CH190
|
|
85
113
|
test_files:
|
86
114
|
- spec/spec_helper.rb
|
87
115
|
- spec/swissgrid_spec.rb
|
88
|
-
has_rdoc:
|