rd_nap_to_etrs 0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4b20fc7c9e3544fb6fc4eb81731b5dfd6039d7c5
4
+ data.tar.gz: 4431fc2278679cf1acbd6ba56356c4963a60d87b
5
+ SHA512:
6
+ metadata.gz: 280e4bc23a15c8db37618bc1f38586b2727d3c9ea8d33d8ba661b0a92b495ecfae9467996dc333296e2243d80fdb51693f953294bc451a0731e420d644078fe0
7
+ data.tar.gz: 25e3f0e8ca202cfe4db9e4874879647469204d9b59fe3beca0b30f853eabbbef9620cee0c4451a9d17aeea090f5cc80dabb64eb6c642d3ec6c5e20e70a15b154
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ # Transform x and y coordinates to latitude and longitude
3
+ # usage:
4
+ # rd_nap_to_etrs 117380.1200 575040.3400 1
5
+ # will result in:
6
+ # 53.16075304161444 4.82476191243292
7
+ require 'rd_nap_to_etrs'
8
+ if $*.size > 1
9
+ point = RdNapToEtrs::Point.new x: $*[0].to_f, y: $*[1].to_f, nap: $*[2].to_f
10
+ batch = RdNapToEtrs::Batch.new
11
+ batch.trans2008 [point]
12
+
13
+ puts [point.lat, point.lng, point.h].join(' ')
14
+ else
15
+ raise "Please specify the RD x and y and possible nap values in that order respectively as arguments"
16
+ end
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,11 @@
1
+ module RdNapToEtrs
2
+ class Batch
3
+ def trans2008(points)
4
+ grid_files_dir = File.expand_path('../../../ext/rd_nap_to_etrs/', __FILE__)
5
+ Dir.chdir grid_files_dir do
6
+ _trans2008(points)
7
+ end
8
+ points
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ module RdNapToEtrs
2
+ class Point
3
+ attr_accessor :x, :y, :nap, :lat, :lng, :h
4
+
5
+ def initialize(x: nil, y: nil, nap: nil, lat: nil, lng: nil, h: nil)
6
+ @x = x
7
+ @y = y
8
+ @nap = nap
9
+ @lat = lat
10
+ @lng = lng
11
+ @h = h
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ #SOURCES:
2
+ #http://blog.x-aeon.com/2012/11/28/packaging-ruby-c-extensions-in-nice-gems/
3
+ #http://java.ociweb.com/mark/NFJS/RubyCExtensions.pdf
4
+ #http://www.angelfire.com/electronic2/issac/rb_cpp_ext_tut.txt
5
+ #
6
+ #Now tested in the fpi-info project inside the lib/rd_nap_to_etrs direcory with:
7
+ # ruby -Ilib -Iext bin/rd_nap_to_etrs 117380.1200 575040.3400
8
+ require 'rd_nap_to_etrs/point'
9
+ require 'rd_nap_to_etrs/batch'
10
+ require "rd_nap_to_etrs/trans2008"
11
+ require 'pry'
12
+ batch = RdNapToEtrs::Batch.new
13
+ point = RdNapToEtrs::Point.new(x: 117380.1200, y: 575040.3400)
14
+ # batch.trans2008 [point]
15
+ #binding.pry
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rd_nap_to_etrs
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.2'
5
+ platform: ruby
6
+ authors:
7
+ - Benjamin ter Kuile
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ description: Convert RD/NAP coordinates to ETRS following the 2008 standards
28
+ email: bterkuile@gmail.com
29
+ executables:
30
+ - rd_nap_to_etrs
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - bin/rd_nap_to_etrs
35
+ - ext/rd_nap_to_etrs/nlgeo04.grd
36
+ - ext/rd_nap_to_etrs/trans2008.bundle
37
+ - ext/rd_nap_to_etrs/x2c.grd
38
+ - ext/rd_nap_to_etrs/y2c.grd
39
+ - lib/rd_nap_to_etrs.rb
40
+ - lib/rd_nap_to_etrs/batch.rb
41
+ - lib/rd_nap_to_etrs/point.rb
42
+ homepage: http://github.com/bterkuile/rd_nap_to_etrs
43
+ licenses: []
44
+ metadata: {}
45
+ post_install_message:
46
+ rdoc_options: []
47
+ require_paths:
48
+ - lib
49
+ - ext
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.4.3
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Convert RD/NAP coordinates to ETRS
66
+ test_files: []
67
+ has_rdoc: