proj4rb 0.4.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +9 -0
- data/README.rdoc +163 -0
- data/Rakefile +72 -0
- data/data/GL27 +22 -0
- data/data/MD +0 -0
- data/data/TN +0 -0
- data/data/WI +0 -0
- data/data/WO +0 -0
- data/data/conus +0 -0
- data/data/epsg +5443 -0
- data/data/epsg-deprecated +2 -0
- data/data/esri +5937 -0
- data/data/esri.extra +948 -0
- data/data/hawaii +0 -0
- data/data/nad.lst +142 -0
- data/data/nad27 +809 -0
- data/data/nad83 +744 -0
- data/data/ntv1_can.dat +0 -0
- data/data/null +0 -0
- data/data/other.extra +49 -0
- data/data/proj_def.dat +17 -0
- data/data/prvi +0 -0
- data/data/stgeorge +0 -0
- data/data/stlrnc +0 -0
- data/data/stpaul +0 -0
- data/data/world +212 -0
- data/example/basic.rb +18 -0
- data/example/list-datums.rb +17 -0
- data/example/list-ellipsoids.rb +17 -0
- data/example/list-errors.rb +11 -0
- data/example/list-prime-meridians.rb +17 -0
- data/example/list-projection-types.rb +17 -0
- data/example/list-units.rb +17 -0
- data/example/version.rb +8 -0
- data/ext/Makefile +212 -0
- data/ext/extconf.rb +13 -0
- data/ext/mkmf.log +25 -0
- data/ext/projrb.c +560 -0
- data/ext/vc/proj4_ruby.sln +19 -0
- data/ext/vc/proj4_ruby.vcproj +208 -0
- data/lib/1.8/proj4_ruby.so +0 -0
- data/lib/1.9/proj4_ruby.so +0 -0
- data/lib/proj4.rb +466 -0
- data/test/test_constants.rb +20 -0
- data/test/test_create_projection.rb +64 -0
- data/test/test_datums.rb +44 -0
- data/test/test_ellipsoids.rb +45 -0
- data/test/test_errors.rb +70 -0
- data/test/test_init_projection.rb +108 -0
- data/test/test_prime_meridians.rb +44 -0
- data/test/test_projection_type.rb +43 -0
- data/test/test_simple_projection.rb +57 -0
- data/test/test_transform.rb +114 -0
- data/test/test_units.rb +45 -0
- metadata +145 -0
data/data/ntv1_can.dat
ADDED
Binary file
|
data/data/null
ADDED
Binary file
|
data/data/other.extra
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
## NAD83 / BC Albers (this has been superceeded but is kept for compatibility)
|
2
|
+
<42102> +proj=aea +ellps=GRS80 +lat_0=45 +lon_0=-126.0 +lat_1=50.0 +lat_2=58.5 +x_0=1000000.0 +y_0=0 +datum=NAD83 +units=m no_defs <>
|
3
|
+
|
4
|
+
|
5
|
+
#
|
6
|
+
# OGC-defined extended codes (41000--41999)
|
7
|
+
# see http://www.digitalearth.gov/wmt/auto.html
|
8
|
+
#
|
9
|
+
# WGS84 / Simple Mercator
|
10
|
+
<41001> +proj=merc +lat_ts=0 +lon_0=0 +k=1.000000 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs no_defs <>
|
11
|
+
#
|
12
|
+
# CubeWerx-defined extended codes (42100--42199)
|
13
|
+
#
|
14
|
+
# WGS 84 / LCC Canada
|
15
|
+
<42101> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=0 +lon_0=-95 +x_0=0 +y_0=-8000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs no_defs <>
|
16
|
+
#EPSG:42102,"PROJCS[\"NAD83 / BC Albers\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS_1980\",6378137,298.257222101]],PRIMEM[\"Greenwich\",0],UNIT[\"Decimal_Degree\",0.0174532925199433]],PROJECTION[\"Albers_conic_equal_area\"],PARAMETER[\"central_meridian\",-126.0],PARAMETER[\"latitude_of_origin\",45],PARAMETER[\"standard_parallel_1\",50.0],PARAMETER[\"standard_parallel_2\",58.5],PARAMETER[\"false_easting\",1000000.0],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1]]"
|
17
|
+
# WGS 84 / LCC USA
|
18
|
+
<42103> +proj=lcc +lat_1=33 +lat_2=45 +lat_0=0 +lon_0=-100 +x_0=0 +y_0=0 +ellps=WGS72 +datum=WGS84 +units=m +no_defs no_defs <>
|
19
|
+
# NAD83 / MTM zone 8 Québec
|
20
|
+
<42104> +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.999900 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m +no_defs no_defs <>
|
21
|
+
# WGS84 / Merc NorthAm
|
22
|
+
<42105> +proj=merc +lat_ts=0 +lon_0=-96 +k=1.000000 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs no_defs <>
|
23
|
+
# WGS84 / Lambert Azim Mozambique
|
24
|
+
<42106> +proj=laea +lat_0=5 +lon_0=20 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +datum=WGS84 +units=m +no_defs no_defs <>
|
25
|
+
#
|
26
|
+
# CubeWerx-customer definitions (42300--42399)
|
27
|
+
#
|
28
|
+
# NAD27 / Polar Stereographic / CM=-98
|
29
|
+
<42301> +proj=stere +lat_0=90 +lon_0=-98 +x_0=0 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs no_defs <>
|
30
|
+
# JapanOrtho.09 09
|
31
|
+
<42302> +proj=tmerc +lat_0=36 +lon_0=139.833333333333 +k=0.999900 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs no_defs <>
|
32
|
+
# NAD83 / Albers NorthAm
|
33
|
+
<42303> +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs no_defs <>
|
34
|
+
# NAD83 / NRCan LCC Canada
|
35
|
+
<42304> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs no_defs <>
|
36
|
+
# France_II
|
37
|
+
<42305> +proj=lcc +lat_1=45.898918964419 +lat_2=47.696014502038 +lat_0=46.8 +lon_0=2.337229166666667 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356514.999904194 +pm=2.337229166666667 +units=m +no_defs no_defs <>
|
38
|
+
# NAD83/QC_LCC
|
39
|
+
<42306> +proj=lcc +lat_1=46 +lat_2=60 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs no_defs <>
|
40
|
+
# NAD83 / Texas Central - feet
|
41
|
+
<42307> +proj=lcc +lat_1=31.8833333333333 +lat_2=30.1166666666667 +lat_0=29.6666666666667 +lon_0=-100.333333333333 +x_0=700000.0000000001 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs no_defs <>
|
42
|
+
# NAD27 / California Albers
|
43
|
+
<42308> +proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=clrk66 +datum=NAD27 +units=m +no_defs no_defs <>
|
44
|
+
# NAD 83 / LCC Canada AVHRR-2
|
45
|
+
<42309> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=0 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs no_defs <>
|
46
|
+
# WGS84+GRS80 / Mercator
|
47
|
+
<42310> +proj=merc +lat_ts=0 +lon_0=0 +k=1.000000 +x_0=0 +y_0=0 +ellps=GRS80 +datum=WGS84 +units=m +no_defs no_defs <>
|
48
|
+
# NAD83 / LCC Statcan
|
49
|
+
<42311> +proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-91.86666700000001 +x_0=6200000 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs no_defs <>
|
data/data/proj_def.dat
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Projection library defaults file
|
2
|
+
# SCCSID--- @(#)proj_def.dat 4.3 94/02/23 GIE REL"
|
3
|
+
# very preliminary version
|
4
|
+
<general>
|
5
|
+
ellps=WGS84
|
6
|
+
<>
|
7
|
+
<aea> # Conterminous U.S. map
|
8
|
+
lat_1=29.5
|
9
|
+
lat_2=45.5
|
10
|
+
<>
|
11
|
+
<lcc> # Conterminous U.S. map
|
12
|
+
lat_1=33
|
13
|
+
lat_2=45
|
14
|
+
<>
|
15
|
+
<lagrng>
|
16
|
+
W=2
|
17
|
+
<>
|
data/data/prvi
ADDED
Binary file
|
data/data/stgeorge
ADDED
Binary file
|
data/data/stlrnc
ADDED
Binary file
|
data/data/stpaul
ADDED
Binary file
|
data/data/world
ADDED
@@ -0,0 +1,212 @@
|
|
1
|
+
# SCCSID @(#)world 1.2 95/08/05 GIE REL
|
2
|
+
# proj +init files for various non-U.S. coordinate systems.
|
3
|
+
#
|
4
|
+
<CH1903> # Swiss Coordinate System
|
5
|
+
+proj=somerc +lat_0=46d57'8.660"N +lon_0=7d26'22.500"E
|
6
|
+
+ellps=bessel +x_0=600000 +y_0=200000
|
7
|
+
+k_0=1. no_defs <>
|
8
|
+
<madagascar> # Laborde grid for Madagascar
|
9
|
+
proj=labrd ellps=intl lon_0=46d26'13.95E lat_0=18d54S
|
10
|
+
azi=18d54 k_0=.9995 x_0=400000 y_0=800000
|
11
|
+
no_defs <>
|
12
|
+
<new_zealand> # New Zealand Map Grid (NZMG)
|
13
|
+
proj=nzmg # Projection unique to N.Z. so all factors fixed
|
14
|
+
no_defs <>
|
15
|
+
# Secondary grids DMA TM8358.1, p. 4.3
|
16
|
+
<bwi> # British West Indies
|
17
|
+
proj=tmerc ellps=clrk80 lon_0=62W
|
18
|
+
x_0=400000 k_0=0.9995
|
19
|
+
no_defs <>
|
20
|
+
<costa-n> # Costa Rica Norte
|
21
|
+
proj=lcc ellps=clrk66 lat_1=10d28N lon_0=84d20W
|
22
|
+
x_0=500000 y_0=217820.522 k_0=0.99995696
|
23
|
+
no_defs <>
|
24
|
+
<costa-s> # Costa Rica Sud
|
25
|
+
proj=lcc ellps=clrk66 lat_1=9dN lon_0=83d40W
|
26
|
+
x_0=500000 y_0=327987.436 k_0=0.99995696
|
27
|
+
no_defs <>
|
28
|
+
<cuba-n> # Cuba Norte
|
29
|
+
proj=lcc ellps=clrk66 lat_1=22d21N lon_0=81dW
|
30
|
+
x_0=500000 y_0=280296.016 k_0=0.99993602
|
31
|
+
no_defs <>
|
32
|
+
<cuba-s> # Cuba Sud
|
33
|
+
proj=lcc ellps=clrk66 lat_1=20d43'N lon_0=76d50'W
|
34
|
+
x_0=500000 y_0=229126.939 k_0=0.99994848
|
35
|
+
no_defs <>
|
36
|
+
<domin_rep> # Dominican Republic
|
37
|
+
proj=lcc ellps=clrk66 lat_1=18d49'N lon_0=71d30'W
|
38
|
+
x_0=500000 y_0=277063.657 k_0=0.99991102
|
39
|
+
no_defs <>
|
40
|
+
<egypt-1> # Egypt
|
41
|
+
proj=tmerc ellps=intl lon_0=25d30'E x_0=300000 k_0=0.99985
|
42
|
+
no_defs <>
|
43
|
+
<egypt-2> # Egypt
|
44
|
+
proj=tmerc ellps=intl lon_0=28d30'E x_0=300000 k_0=0.99985
|
45
|
+
no_defs <>
|
46
|
+
<egypt-3> # Egypt
|
47
|
+
proj=tmerc ellps=intl lon_0=31d30'E x_0=300000 k_0=0.99985
|
48
|
+
no_defs <>
|
49
|
+
<egypt-4> # Egypt
|
50
|
+
proj=tmerc ellps=intl lon_0=34d30'E x_0=300000 k_0=0.99985
|
51
|
+
no_defs <>
|
52
|
+
<egypt-5> # Egypt
|
53
|
+
proj=tmerc ellps=intl lon_0=37d30'E x_0=300000 k_0=0.99985
|
54
|
+
no_defs <>
|
55
|
+
<el_sal> # El Salvador
|
56
|
+
proj=lcc ellps=clrk66 lat_1=13d47'N lon_0=89dW
|
57
|
+
x_0=500000 y_0=295809.184 k_0=0.99996704
|
58
|
+
no_defs <>
|
59
|
+
<guat-n> # Guatemala Norte
|
60
|
+
proj=lcc ellps=clrk66 lat_1=16d49'N lon_0=90d20'W
|
61
|
+
x_0=500000 y_0=292209.579 k_0=0.99992226
|
62
|
+
no_defs <>
|
63
|
+
<guat-s> # Guatemala Sud
|
64
|
+
proj=lcc ellps=clrk66 lat_1=14d54'N lon_0=90d20'W
|
65
|
+
x_0=500000 y_0=325992.681 k_0=0.99989906
|
66
|
+
no_defs <>
|
67
|
+
<haiti> # Haiti
|
68
|
+
proj=lcc ellps=clrk66 lat_1=18d49'N lon_0=71d30'W
|
69
|
+
x_0=500000 y_0=277063.657 k_0=0.99991102
|
70
|
+
no_defs <>
|
71
|
+
<hond-n> # Honduras Norte
|
72
|
+
proj=lcc ellps=clrk66 lat_1=15d30'N lon_0=86d10'W
|
73
|
+
x_0=500000 y_0=296917.439 k_0=0.99993273
|
74
|
+
no_defs <>
|
75
|
+
<hond-s> # Honduras Sud
|
76
|
+
proj=lcc ellps=clrk66 lat_1=13d47'N lon_0=87d10'W
|
77
|
+
x_0=500000 y_0=296215.903 k_0=0.99995140
|
78
|
+
no_defs <>
|
79
|
+
<levant> # Levant
|
80
|
+
proj=lcc ellps=clrk66 lat_1=34d39'N lon_0=37d21'E
|
81
|
+
x_0=500000 y_0=300000 k_0=0.9996256
|
82
|
+
no_defs <>
|
83
|
+
<nica-n> # Nicaragua Norte
|
84
|
+
proj=lcc ellps=clrk66 lat_1=13d52'N lon_0=85d30'W
|
85
|
+
x_0=500000 y_0=359891.816 k_0=0.99990314
|
86
|
+
no_defs <>
|
87
|
+
<nica-s> # Nicaragua Sud
|
88
|
+
proj=lcc ellps=clrk66 lat_1=11d40'N lon_0=85d30'W
|
89
|
+
x_0=500000 y_0=288876.327 k_0=0.99992228
|
90
|
+
no_defs <>
|
91
|
+
<nw-africa> # Northwest Africa
|
92
|
+
proj=lcc ellps=clrk80 lat_1=34dN lon_0=0dE
|
93
|
+
x_0=1000000 y_0=500000 k_0=0.99908
|
94
|
+
no_defs <>
|
95
|
+
<palestine> # Palestine
|
96
|
+
proj=tmerc a=6378300.79 rf=293.488307656
|
97
|
+
lat_0=31d44'2.749"N lon_0=35d12'43.490"E
|
98
|
+
x_0=170251.555 y_0=126867.909 k_0=1
|
99
|
+
no_defs <>
|
100
|
+
<panama> # Panama
|
101
|
+
proj=lcc ellps=clrk66 lat_1=8d25'N lon_0=80dW
|
102
|
+
x_0=500000 y_0=294865.303 k_0=0.99989909
|
103
|
+
no_defs <>
|
104
|
+
# other grids in DMA TM8358.1
|
105
|
+
<bng> # British National Grid
|
106
|
+
proj=tmerc ellps=airy lat_0=49dN lon_0=2dW
|
107
|
+
k_0=0.9996012717 x_0=400000 y_0=-100000
|
108
|
+
no_defs <>
|
109
|
+
<malay> # West Malaysian RSO Grid
|
110
|
+
proj=omerc a=6377295.66402 rf=300.8017 alpha=323d01'32.846"
|
111
|
+
no_uoff rot_conv lonc=102d15E lat_0=4dN k_0=0.99984 x_0=804670.240 y_0=0
|
112
|
+
no_defs <>
|
113
|
+
<india-I> # India Zone I
|
114
|
+
proj=lcc ellps=everest lon_0=68E lat_1=32d30'N
|
115
|
+
x_0=2743185.69 y_0=914395.23 k_0=.998786408
|
116
|
+
no_defs <>
|
117
|
+
<india-IIA> # India Zone IIA
|
118
|
+
proj=lcc ellps=everest lon_0=74E lat_1=26N
|
119
|
+
x_0=2743185.69 y_0=914395.23 k_0=.998786408
|
120
|
+
no_defs <>
|
121
|
+
<india-IIB> # India Zone IIB
|
122
|
+
proj=lcc ellps=everest lon_0=90E lat_1=26N
|
123
|
+
x_0=2743185.69 y_0=914395.23 k_0=.998786408
|
124
|
+
no_defs <>
|
125
|
+
<india-IIIA> # India Zone IIIA
|
126
|
+
proj=lcc ellps=everest lon_0=80E lat_1=19N
|
127
|
+
x_0=2743185.69 y_0=914395.23 k_0=.998786408
|
128
|
+
no_defs <>
|
129
|
+
<india-IIIB> # India Zone IIIB
|
130
|
+
proj=lcc ellps=everest lon_0=100E lat_1=19N
|
131
|
+
x_0=2743185.69 y_0=914395.23 k_0=.998786408
|
132
|
+
no_defs <>
|
133
|
+
<india-IVA> # India Zone IVA
|
134
|
+
proj=lcc ellps=everest lon_0=80E lat_1=12N
|
135
|
+
x_0=2743185.69 y_0=914395.23 k_0=.998786408
|
136
|
+
no_defs <>
|
137
|
+
<india-IVB> # India Zone IVB
|
138
|
+
proj=lcc ellps=everest lon_0=104E lat_1=12N
|
139
|
+
x_0=2743185.69 y_0=914395.23 k_0=.998786408
|
140
|
+
no_defs <>
|
141
|
+
<ceylon> # Ceylon Belt
|
142
|
+
proj=tmerc ellps=everest lon_0=80d46'18.160"E lat_0=7d0'1.729"N
|
143
|
+
x_0=160933.56048 y_0=160933.56048 k_0=1.
|
144
|
+
no_defs <>
|
145
|
+
<irish> # Irish Transverse Mercator Grid
|
146
|
+
proj=tmerx ellps=mod_airy lat_0=53d30'N lon_0=8W
|
147
|
+
x_0=200000 y_0=-250000 k_0=1.000035
|
148
|
+
no_defs <>
|
149
|
+
<neiez> # Netherlands East Indies Equitorial Zone
|
150
|
+
proj=merc ellps=bessel lon_0=110E
|
151
|
+
x_0=3900000 y_0=900000 k_0=0.997
|
152
|
+
no_defs <>
|
153
|
+
<n-alger> # Nord Algerie Grid
|
154
|
+
proj=lcc ellps=clrk80 lon_0=2d42E lat_0=36N
|
155
|
+
x_0=500000 y_0=300000 k_0=0.999625544
|
156
|
+
no_defs <>
|
157
|
+
<n-maroc> # Nord Maroc Grid
|
158
|
+
proj=lcc ellps=clrk80 lon_0=5d24'W lat_0=33d18'N
|
159
|
+
x_0=500000 y_0=300000 k_0=0.999625769
|
160
|
+
no_defs <>
|
161
|
+
<n-tunis> # Nord Tunisie Grid
|
162
|
+
proj=lcc ellps=clrk80 lon_0=9d54E lat_0=36N
|
163
|
+
x_0=500000 y_0=300000 k_0=0.999625544
|
164
|
+
no_defs <>
|
165
|
+
<s-alger> # Sud Algerie Grid
|
166
|
+
proj=lcc ellps=clrk80 lon_0=2d42E lat_0=33d18'N
|
167
|
+
x_0=500000 y_0=300000 k_0=0.999625769
|
168
|
+
no_defs <>
|
169
|
+
<s-maroc> # Sud Maroc Grid
|
170
|
+
proj=lcc ellps=clrk80 lon_0=5d24W lat_0=29d42'N
|
171
|
+
x_0=500000 y_0=300000 k_0=0.999615596
|
172
|
+
no_defs <>
|
173
|
+
<s-tunis> # Sud Tunisie Grid
|
174
|
+
proj=lcc ellps=clrk80 lon_0=9d54'E lat_0=33d18'N
|
175
|
+
x_0=500000 y_0=300000 k_0=0.999625769
|
176
|
+
no_defs <>
|
177
|
+
# Gauss Krueger Grid for Germany
|
178
|
+
#
|
179
|
+
# The first figure of the easting is lon_0 devided by 3
|
180
|
+
# ( 2 for 6d0E, 3 for 9d0E, 4 for 12d0E)
|
181
|
+
# For translations you have to remove this first figure
|
182
|
+
# and convert northings and eastings from km to meter .
|
183
|
+
# The other way round, devide by 1000 and add the figure.
|
184
|
+
# I made 3 entrys for the officially used grids in Germany
|
185
|
+
#
|
186
|
+
#
|
187
|
+
# Und nochmal in deutsch :
|
188
|
+
# Die erste Ziffer des Rechtswerts beschreibt den Hauptmeridian
|
189
|
+
# und ist dessen Gradzahl geteilt durch 3.
|
190
|
+
# Zum Umrechnen in Grad muss daher die erste Ziffer des Rechtswertes
|
191
|
+
# entfernt werden und evt. von km auf Metern umgerechnet werden.
|
192
|
+
# Zur Umrechnung in Gauss Krueger Koordinaten entsprechend die
|
193
|
+
# Ziffer fuer den Hauptmeridian vor dem Rechtswert ergaenzen.
|
194
|
+
# Ich hab fuer alle drei in Deutschland ueblichen Hauptmeridiane
|
195
|
+
# jeweils einen Eintrag ergaenzt.
|
196
|
+
#
|
197
|
+
#
|
198
|
+
# added by Michael Goepel <goepel@ffm.plusline.de>
|
199
|
+
#
|
200
|
+
<gk2-d> # Gauss Krueger Grid for Germany
|
201
|
+
proj=tmerc ellps=bessel lon_0=6d0E lat_0=0
|
202
|
+
x_0=500000
|
203
|
+
no_defs<>
|
204
|
+
<gk3-d> # Gauss Krueger Grid for Germany
|
205
|
+
proj=tmerc ellps=bessel lon_0=9d0E lat_0=0
|
206
|
+
x_0=500000
|
207
|
+
no_defs<>
|
208
|
+
<gk4-d> # Gauss Krueger Grid for Germany
|
209
|
+
proj=tmerc ellps=bessel lon_0=12d0E lat_0=0
|
210
|
+
x_0=500000
|
211
|
+
no_defs<>
|
212
|
+
|
data/example/basic.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
$: << File.dirname(__FILE__) + '/../lib/' << File.dirname(__FILE__) + '/../ext/'
|
4
|
+
|
5
|
+
require 'proj4'
|
6
|
+
include Proj4
|
7
|
+
|
8
|
+
# create projection object
|
9
|
+
proj = Projection.new(["proj=utm", "zone=21", "units=m", "no.defs"])
|
10
|
+
|
11
|
+
# create the point you want to project
|
12
|
+
point = Point.new(45000,2700000)
|
13
|
+
|
14
|
+
# do the projection
|
15
|
+
res = proj.inverse(point)
|
16
|
+
|
17
|
+
puts "x=#{point.x}, y=#{point.y} ==> lon=#{res.lon}, lat=#{res.lat}"
|
18
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
$: << File.dirname(__FILE__) + '/../lib/' << File.dirname(__FILE__) + '/../ext/'
|
4
|
+
|
5
|
+
require 'proj4'
|
6
|
+
include Proj4
|
7
|
+
|
8
|
+
if ARGV[0] == '-v'
|
9
|
+
puts "%-15s %-10s %-50s" % [ 'ID', 'Ellipse ID', 'Comment' ]
|
10
|
+
puts '-----------------------------------------------------------------------------'
|
11
|
+
Datum.list.sort.each do |datum|
|
12
|
+
puts "%-15s %-10s %-50s\n %s\n " % [ datum.id, datum.ellipse_id, datum.comments, datum.defn ]
|
13
|
+
end
|
14
|
+
else
|
15
|
+
puts Datum.list.sort
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
$: << File.dirname(__FILE__) + '/../lib/' << File.dirname(__FILE__) + '/../ext/'
|
4
|
+
|
5
|
+
require 'proj4'
|
6
|
+
include Proj4
|
7
|
+
|
8
|
+
if ARGV[0] == '-v'
|
9
|
+
puts "%-9s %-14s %-18s %-36s" % [ 'ID', 'a', 'b/rf', 'Name' ]
|
10
|
+
puts '-----------------------------------------------------------------------------'
|
11
|
+
Ellipsoid.list.sort.each do |ell|
|
12
|
+
puts "%-9s %-14s %-18s %-36s" % [ ell.id, ell.major, ell.ell, ell.name ]
|
13
|
+
end
|
14
|
+
else
|
15
|
+
puts Ellipsoid.list.sort
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
$: << File.dirname(__FILE__) + '/../lib/' << File.dirname(__FILE__) + '/../ext/'
|
4
|
+
|
5
|
+
require 'proj4'
|
6
|
+
include Proj4
|
7
|
+
|
8
|
+
if ARGV[0] == '-v'
|
9
|
+
puts "%-16s %-50s" % [ 'ID', 'Definition' ]
|
10
|
+
puts '-----------------------------------------------------------------------------'
|
11
|
+
PrimeMeridian.list.sort.each do |pm|
|
12
|
+
puts "%-16s %-50s" % [ pm.id, pm.defn ]
|
13
|
+
end
|
14
|
+
else
|
15
|
+
puts PrimeMeridian.list.sort
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
$: << File.dirname(__FILE__) + '/../lib/' << File.dirname(__FILE__) + '/../ext/'
|
4
|
+
|
5
|
+
require 'proj4'
|
6
|
+
include Proj4
|
7
|
+
|
8
|
+
if ARGV[0] == '-v'
|
9
|
+
puts "%-7s %-70s" % [ 'ID', 'Name/Description' ]
|
10
|
+
puts '-----------------------------------------------------------------------------'
|
11
|
+
ProjectionType.list.sort.each do |pt|
|
12
|
+
puts "%-7s %-70s" % [ pt.id, pt.descr ]
|
13
|
+
end
|
14
|
+
else
|
15
|
+
puts ProjectionType.list
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
$: << File.dirname(__FILE__) + '/../lib/' << File.dirname(__FILE__) + '/../ext/'
|
4
|
+
|
5
|
+
require 'proj4'
|
6
|
+
include Proj4
|
7
|
+
|
8
|
+
if ARGV[0] == '-v'
|
9
|
+
puts "%-8s %-20s %-50s" % [ 'ID', 'To meter', 'Name' ]
|
10
|
+
puts "------------------------------------------------------------------------------"
|
11
|
+
Unit.list.sort.each do |unit|
|
12
|
+
puts "%-8s %-20s %-50s" % [ unit.id, unit.to_meter, unit.name ]
|
13
|
+
end
|
14
|
+
else
|
15
|
+
puts Unit.list.sort
|
16
|
+
end
|
17
|
+
|
data/example/version.rb
ADDED
data/ext/Makefile
ADDED
@@ -0,0 +1,212 @@
|
|
1
|
+
|
2
|
+
SHELL = /bin/sh
|
3
|
+
|
4
|
+
# V=0 quiet, V=1 verbose. other values don't work.
|
5
|
+
V = 0
|
6
|
+
Q1 = $(V:1=)
|
7
|
+
Q = $(Q1:0=@)
|
8
|
+
ECHO1 = $(V:1=@:)
|
9
|
+
ECHO = $(ECHO1:0=@echo)
|
10
|
+
|
11
|
+
#### Start of system configuration section. ####
|
12
|
+
|
13
|
+
srcdir = .
|
14
|
+
topdir = /c/MinGW/local/ruby/include/ruby-1.9.1
|
15
|
+
hdrdir = /c/MinGW/local/ruby/include/ruby-1.9.1
|
16
|
+
arch_hdrdir = c:/MinGW/local/ruby/include/ruby-1.9.1/$(arch)
|
17
|
+
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
18
|
+
|
19
|
+
DESTDIR = c:
|
20
|
+
prefix = $(DESTDIR)/MinGW/local/ruby
|
21
|
+
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
22
|
+
exec_prefix = $(prefix)
|
23
|
+
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
24
|
+
sitehdrdir = $(rubyhdrdir)/site_ruby
|
25
|
+
rubyhdrdir = $(includedir)/$(RUBY_BASE_NAME)-$(ruby_version)
|
26
|
+
vendordir = $(rubylibprefix)/vendor_ruby
|
27
|
+
sitedir = $(rubylibprefix)/site_ruby
|
28
|
+
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
29
|
+
mandir = $(datarootdir)/man
|
30
|
+
localedir = $(datarootdir)/locale
|
31
|
+
libdir = $(exec_prefix)/lib
|
32
|
+
psdir = $(docdir)
|
33
|
+
pdfdir = $(docdir)
|
34
|
+
dvidir = $(docdir)
|
35
|
+
htmldir = $(docdir)
|
36
|
+
infodir = $(datarootdir)/info
|
37
|
+
docdir = $(datarootdir)/doc/$(PACKAGE)
|
38
|
+
oldincludedir = $(DESTDIR)/usr/include
|
39
|
+
includedir = $(prefix)/include
|
40
|
+
localstatedir = $(prefix)/var
|
41
|
+
sharedstatedir = $(prefix)/com
|
42
|
+
sysconfdir = $(prefix)/etc
|
43
|
+
datadir = $(datarootdir)
|
44
|
+
datarootdir = $(prefix)/share
|
45
|
+
libexecdir = $(exec_prefix)/libexec
|
46
|
+
sbindir = $(exec_prefix)/sbin
|
47
|
+
bindir = $(exec_prefix)/bin
|
48
|
+
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
49
|
+
archdir = $(rubylibdir)/$(arch)
|
50
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
51
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
52
|
+
vendorlibdir = $(vendordir)/$(ruby_version)
|
53
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
54
|
+
|
55
|
+
CC = gcc
|
56
|
+
CXX = g++
|
57
|
+
LIBRUBY = lib$(RUBY_SO_NAME).dll.a
|
58
|
+
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
59
|
+
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
|
60
|
+
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
61
|
+
OUTFLAG = -o
|
62
|
+
COUTFLAG = -o
|
63
|
+
|
64
|
+
RUBY_EXTCONF_H =
|
65
|
+
cflags = $(optflags) $(debugflags) $(warnflags)
|
66
|
+
optflags = -O3
|
67
|
+
debugflags = -g
|
68
|
+
warnflags = -Wall -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration
|
69
|
+
CFLAGS = $(cflags)
|
70
|
+
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
71
|
+
DEFS =
|
72
|
+
CPPFLAGS = -DHAVE_PROJ_API_H -Ic:/MinGW/local/include $(DEFS) $(cppflags)
|
73
|
+
CXXFLAGS = $(CFLAGS) $(cxxflags)
|
74
|
+
ldflags = -L. -Lc:/MinGW/local/lib
|
75
|
+
dldflags = -Wl,--enable-auto-image-base,--enable-auto-import $(DEFFILE)
|
76
|
+
ARCH_FLAG =
|
77
|
+
DLDFLAGS = $(ldflags) $(dldflags)
|
78
|
+
LDSHARED = $(CC) -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)
|
79
|
+
LDSHAREDXX = $(CXX) -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)
|
80
|
+
AR = ar
|
81
|
+
EXEEXT = .exe
|
82
|
+
|
83
|
+
RUBY_BASE_NAME = ruby
|
84
|
+
RUBY_INSTALL_NAME = ruby
|
85
|
+
RUBY_SO_NAME = msvcrt-ruby191
|
86
|
+
arch = i386-mingw32
|
87
|
+
sitearch = i386-msvcrt
|
88
|
+
ruby_version = 1.9.1
|
89
|
+
ruby = c:/MinGW/local/ruby/bin/ruby
|
90
|
+
RUBY = $(ruby)
|
91
|
+
RM = rm -f
|
92
|
+
RM_RF = $(RUBY) -run -e rm -- -rf
|
93
|
+
RMDIRS = rmdir --ignore-fail-on-non-empty -p
|
94
|
+
MAKEDIRS = /bin/mkdir -p
|
95
|
+
INSTALL = /bin/install -c
|
96
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
97
|
+
INSTALL_DATA = $(INSTALL) -m 644
|
98
|
+
COPY = cp
|
99
|
+
|
100
|
+
#### End of system configuration section. ####
|
101
|
+
|
102
|
+
preload =
|
103
|
+
|
104
|
+
libpath = . $(libdir)
|
105
|
+
LIBPATH = -L. -L$(libdir)
|
106
|
+
DEFFILE = $(TARGET)-$(arch).def
|
107
|
+
|
108
|
+
CLEANFILES = mkmf.log $(DEFFILE)
|
109
|
+
DISTCLEANFILES =
|
110
|
+
DISTCLEANDIRS =
|
111
|
+
|
112
|
+
extout =
|
113
|
+
extout_prefix =
|
114
|
+
target_prefix =
|
115
|
+
LOCAL_LIBS =
|
116
|
+
LIBS = $(LIBRUBYARG_SHARED) -lproj -lshell32 -lws2_32 -limagehlp
|
117
|
+
SRCS = projrb.c
|
118
|
+
OBJS = projrb.o
|
119
|
+
TARGET = proj4_ruby
|
120
|
+
DLLIB = $(TARGET).so
|
121
|
+
EXTSTATIC =
|
122
|
+
STATIC_LIB =
|
123
|
+
|
124
|
+
BINDIR = $(bindir)
|
125
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
126
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
127
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
128
|
+
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
129
|
+
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
130
|
+
|
131
|
+
TARGET_SO = $(DLLIB)
|
132
|
+
CLEANLIBS = $(TARGET).so
|
133
|
+
CLEANOBJS = *.o *.bak
|
134
|
+
|
135
|
+
all: $(DLLIB)
|
136
|
+
static: $(STATIC_LIB)
|
137
|
+
.PHONY: all install static install-so install-rb
|
138
|
+
.PHONY: clean clean-so clean-rb
|
139
|
+
|
140
|
+
clean-rb-default::
|
141
|
+
clean-rb::
|
142
|
+
clean-so::
|
143
|
+
clean: clean-so clean-rb-default clean-rb
|
144
|
+
@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
|
145
|
+
|
146
|
+
distclean-rb-default::
|
147
|
+
distclean-rb::
|
148
|
+
distclean-so::
|
149
|
+
distclean: clean distclean-so distclean-rb-default distclean-rb
|
150
|
+
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
151
|
+
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
152
|
+
@-$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
|
153
|
+
|
154
|
+
realclean: distclean
|
155
|
+
install: install-so install-rb
|
156
|
+
|
157
|
+
install-so: $(RUBYARCHDIR)
|
158
|
+
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
159
|
+
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
160
|
+
@-$(MAKEDIRS) $(@D)
|
161
|
+
$(INSTALL_PROG) $(DLLIB) $(@D)
|
162
|
+
install-rb: pre-install-rb install-rb-default
|
163
|
+
install-rb-default: pre-install-rb-default
|
164
|
+
pre-install-rb: Makefile
|
165
|
+
pre-install-rb-default: Makefile
|
166
|
+
pre-install-rb-default:
|
167
|
+
$(ECHO) installing default proj4_ruby libraries
|
168
|
+
$(RUBYARCHDIR):
|
169
|
+
$(Q) $(MAKEDIRS) $@
|
170
|
+
|
171
|
+
site-install: site-install-so site-install-rb
|
172
|
+
site-install-so: install-so
|
173
|
+
site-install-rb: install-rb
|
174
|
+
|
175
|
+
.SUFFIXES: .c .m .cc .mm .cxx .cpp .o
|
176
|
+
|
177
|
+
.cc.o:
|
178
|
+
$(ECHO) compiling $(<)
|
179
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
180
|
+
|
181
|
+
.mm.o:
|
182
|
+
$(ECHO) compiling $(<)
|
183
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
184
|
+
|
185
|
+
.cxx.o:
|
186
|
+
$(ECHO) compiling $(<)
|
187
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
188
|
+
|
189
|
+
.cpp.o:
|
190
|
+
$(ECHO) compiling $(<)
|
191
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
192
|
+
|
193
|
+
.c.o:
|
194
|
+
$(ECHO) compiling $(<)
|
195
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
196
|
+
|
197
|
+
.m.o:
|
198
|
+
$(ECHO) compiling $(<)
|
199
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
200
|
+
|
201
|
+
$(DLLIB): $(DEFFILE) $(OBJS) Makefile
|
202
|
+
$(ECHO) linking shared-object $(DLLIB)
|
203
|
+
@-$(RM) $(@)
|
204
|
+
$(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
$(DEFFILE):
|
209
|
+
$(ECHO) generating $(@)
|
210
|
+
$(Q) $(RUBY) -e "puts 'EXPORTS', '' + 'Init_$(TARGET)'.sub(/\..*\z/,'')" > $@
|
211
|
+
|
212
|
+
$(OBJS): $(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h
|