Statistics
| Revision:

svn-gvsig-desktop / branches / F2 / libraries / libJCRS / src / org / gvsig / crs / Proj4.java @ 11389

History | View | Annotate | Download (111 KB)

1
package org.gvsig.crs;
2

    
3
import java.util.ArrayList;
4

    
5
import javax.units.ConversionException;
6
import javax.units.Unit;
7

    
8
import org.idr.geotools.referencing.crs.DefaultGeographicCRS;
9
import org.idr.geotools.referencing.crs.DefaultProjectedCRS;
10
import org.idr.geotools.referencing.datum.DefaultGeodeticDatum;
11
import org.idr.geotools.referencing.datum.DefaultPrimeMeridian;
12
import org.opengis.metadata.Identifier;
13
import org.opengis.referencing.crs.CoordinateReferenceSystem;
14
import org.opengis.referencing.crs.ProjectedCRS;
15
import org.opengis.referencing.datum.Ellipsoid;
16
import org.opengis.referencing.datum.PrimeMeridian;
17

    
18
public class Proj4 {        
19

    
20
        private static ArrayList projectionNameList= new ArrayList();
21
        private static ArrayList unitNameList= new ArrayList();
22
        private static ArrayList projectionParameterNameList= new ArrayList();
23
        private static ArrayList projectionParameterList= new ArrayList();
24
        private static ArrayList projectionParameterDefaultValueList= new ArrayList();
25
        private static ArrayList projectionParameterMaxValueList= new ArrayList();
26
        private static ArrayList projectionParameterMinValueList= new ArrayList();
27
        private static ArrayList projectionParameterUnitList= new ArrayList();
28
        private static ArrayList projectionAcronymList= new ArrayList();
29
        private static ArrayList projectionParameterAcronymList= new ArrayList();
30
        
31
        int divider=10000;
32
        
33
        /**
34
     * Small tolerance factor for rounding errors.
35
     */
36
    private static final double EPS = 1E-8;
37
        
38
        public Proj4() throws CrsException
39
        {
40
                //defineProjectionNames();
41
                //defineProjectionParameterNameList();
42
                //defineProjectionParameterUnitList();
43
                defineUnitNameList();
44
                defineProjectionParameterList();
45
                defineProjections();
46
        }
47
        
48
        private void defineUnitNameList() throws CrsException
49
        {
50
                int count=0;
51
                
52
                {
53
                        String[] unitName={"Angular"};
54
                        unitNameList.add(count,unitName);
55
                }
56
                
57
                count++;
58
                {
59
                        String[] unitName={"Linear"};
60
                        unitNameList.add(count,unitName);
61
                }
62
                
63
                count++;
64
                {
65
                        String[] unitName={"Unitless"};
66
                        unitNameList.add(count,unitName);
67
                        addUnitName(count,"Adimensional");
68
                }
69
                
70
        }
71
        
72
        private void defineProjectionParameterList() throws CrsException
73
        {
74
                int count=0;
75

    
76
                { // azimuth
77
                        String[] parameterName={"azimuth"};
78
                        projectionParameterNameList.add(count,parameterName);
79
                        addProjectionParameterName(count,"Azimuth of initial line");                
80
                        addProjectionParameterName(count,"AzimuthAngle");                
81

    
82
                        String[] parameterUnit={"Angular"};
83
                        projectionParameterUnitList.add(count,parameterUnit);
84
                }
85

    
86
                count++;
87
                { // central_meridian
88
                        String[] parameterName={"central_meridian"};
89
                        projectionParameterNameList.add(count,parameterName);
90
                        addProjectionParameterName(count,"Longitude of natural origin");                
91
                        addProjectionParameterName(count,"NatOriginLong");                
92
                        addProjectionParameterName(count,"Longitude of projection center");
93
                        addProjectionParameterName(count,"ProjCenterLong");
94
                        addProjectionParameterName(count,"Longitude of false origin");                
95
                        addProjectionParameterName(count,"FalseOriginLong");                
96
                        addProjectionParameterName(count,"StraightVertPoleLong");                
97
                        
98
                        String[] parameterUnit={"Angular"};
99
                        projectionParameterUnitList.add(count,parameterUnit);
100
                }
101
                
102
                count++;
103
                { // false_easting
104
                        String[] parameterName={"false_easting"};
105
                        projectionParameterNameList.add(count,parameterName);
106
                        addProjectionParameterName(count,"Easting of false origin");                
107
                        addProjectionParameterName(count,"FalseEasting");                
108
                        addProjectionParameterName(count,"FalseOriginEasting");                
109

    
110
                        String[] parameterUnit={"Linear"};
111
                        projectionParameterUnitList.add(count,parameterUnit);
112
                }
113
                
114
                count++;
115
                { // false_northing
116
                        String[] parameterName={"false_northing"};
117
                        projectionParameterNameList.add(count,parameterName);
118
                        addProjectionParameterName(count,"Northing of false origin");                
119
                        addProjectionParameterName(count,"FalseNorthing");                
120
                        addProjectionParameterName(count,"FalseOriginNorthing");                
121

    
122
                        String[] parameterUnit={"Linear"};
123
                        projectionParameterUnitList.add(count,parameterUnit);
124
                }
125

    
126
                count++;
127
                { // latitude_of_center
128
                        String[] parameterName={"latitude_of_center"};
129
                        projectionParameterNameList.add(count,parameterName);
130
                        addProjectionParameterName(count,"Latitude of false origin");                
131
                        addProjectionParameterName(count,"NatOriginLat");                
132
                        addProjectionParameterName(count,"CenterLat");                
133

    
134
                        String[] parameterUnit={"Angular"};
135
                        projectionParameterUnitList.add(count,parameterUnit);
136
                }
137

    
138
                count++;
139
                { // latitude_of_origin
140
                        String[] parameterName={"latitude_of_origin"};
141
                        projectionParameterNameList.add(count,parameterName);
142
                        addProjectionParameterName(count,"Latitude of natural origin");
143
                        addProjectionParameterName(count,"NatOriginLat");
144
                        addProjectionParameterName(count,"Latitude of projection center");
145
                        addProjectionParameterName(count,"ProjCenterLat");
146
                        addProjectionParameterName(count,"Latitude of false origin");                
147
                        addProjectionParameterName(count,"FalseOriginLat");
148
                        
149
                        String[] parameterUnit={"Angular"};
150
                        projectionParameterUnitList.add(count,parameterUnit);
151
                }
152

    
153
                count++;
154
                { // longitude_of_center
155
                        String[] parameterName={"longitude_of_center"};
156
                        projectionParameterNameList.add(count,parameterName);
157
                        addProjectionParameterName(count,"Longitude of false origin");                
158
                        addProjectionParameterName(count,"NatOriginLong");                
159
                        addProjectionParameterName(count,"CenterLong");                
160

    
161
                        String[] parameterUnit={"Angular"};
162
                        projectionParameterUnitList.add(count,parameterUnit);
163
                }
164

    
165
                count++;
166
                { // pseudo_standard_parallel_1
167
                        String[] parameterName={"pseudo_standard_parallel_1"};
168
                        projectionParameterNameList.add(count,parameterName);
169
                        addProjectionParameterName(count,"Latitude of Pseudo Standard Parallel");                
170

    
171
                        String[] parameterUnit={"Angular"};
172
                        projectionParameterUnitList.add(count,parameterUnit);
173
                }
174
                
175
                count++;
176
                { // satellite_height
177
                        String[] parameterName={"satellite_height"};
178
                        projectionParameterNameList.add(count,parameterName);
179
                        addProjectionParameterName(count,"Satellite Height");                
180

    
181
                        String[] parameterUnit={"Linear"};
182
                        projectionParameterUnitList.add(count,parameterUnit);
183
                }
184
                
185
                count++;
186
                { // scale_factor
187
                        String[] parameterName={"scale_factor"};
188
                        projectionParameterNameList.add(count,parameterName);
189
                        addProjectionParameterName(count,"Scale factor at natural origin");                
190
                        addProjectionParameterName(count,"ScaleAtNatOrigin");                
191
                        addProjectionParameterName(count,"ScaleAtCenter");                
192

    
193
                        String[] parameterUnit={"Unitless"};
194
                        projectionParameterUnitList.add(count,parameterUnit);
195
                }
196

    
197
                count++;
198
                { // standard_parallel_1
199
                        String[] parameterName={"standard_parallel_1"};
200
                        projectionParameterNameList.add(count,parameterName);
201
                        addProjectionParameterName(count,"Latitude of first standard parallel");                
202
                        addProjectionParameterName(count,"StdParallel1");                
203

    
204
                        String[] parameterUnit={"Angular"};
205
                        projectionParameterUnitList.add(count,parameterUnit);
206
                }
207

    
208
                count++;
209
                { // standard_parallel_2
210
                        String[] parameterName={"standard_parallel_2"};
211
                        projectionParameterNameList.add(count,parameterName);
212
                        addProjectionParameterName(count,"Latitude of second standard parallel");                
213
                        addProjectionParameterName(count,"StdParallel2");                
214

    
215
                        String[] parameterUnit={"Angular"};
216
                        projectionParameterUnitList.add(count,parameterUnit);
217
                }
218

    
219
                count++;
220
                { // semi_major
221
                        String[] parameterName={"semi_major"};
222
                        projectionParameterNameList.add(count,parameterName);
223
                        addProjectionParameterName(count,"semi_major_axis");                
224

    
225
                        String[] parameterUnit={"Linear"};
226
                        projectionParameterUnitList.add(count,parameterUnit);
227
                }
228

    
229
                count++;
230
                { // semi_minor
231
                        String[] parameterName={"semi_minor"};
232
                        projectionParameterNameList.add(count,parameterName);
233
                        addProjectionParameterName(count,"semi_minor_axis");                
234

    
235
                        String[] parameterUnit={"Linear"};
236
                        projectionParameterUnitList.add(count,parameterUnit);
237
                }
238

    
239
        }
240
        
241
        private void defineProjections() throws CrsException
242
        {
243
                int count=0;
244
                
245
                {// Albers Equal-Area Conic
246
                        String[] projectionName={"Albers_Conic_Equal_Area"};
247
                        projectionNameList.add(count,projectionName);
248
                        addProjectionName(count,"Albers Equal-Area Conic");
249
                        addProjectionName(count,"9822");
250
                        
251
                        String[] parameterName={"standard_parallel_1"};
252
                        projectionParameterList.add(count,parameterName);
253
                        addProjectionParameter(count,"standard_parallel_2");
254
                        addProjectionParameter(count,"latitude_of_center");
255
                        addProjectionParameter(count,"longitude_of_center");
256
                        addProjectionParameter(count,"false_easting");
257
                        addProjectionParameter(count,"false_northing");
258

    
259
                        String[] parameterAcronym={"lat_1"};
260
                        projectionParameterAcronymList.add(count,parameterAcronym);
261
                        addProjectionParameterAcronymList(count,"lat_2");
262
                        addProjectionParameterAcronymList(count,"lat_0");
263
                        addProjectionParameterAcronymList(count,"lon_0");
264
                        addProjectionParameterAcronymList(count,"x_0");
265
                        addProjectionParameterAcronymList(count,"y_0");
266

    
267
                        String[] parameterDefaultValue={"0.0"};
268
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
269
                        addProjectionParameterDefaultValue(count,"0.0");
270
                        addProjectionParameterDefaultValue(count,"0.0");
271
                        addProjectionParameterDefaultValue(count,"0.0");
272
                        addProjectionParameterDefaultValue(count,"0.0");
273
                        addProjectionParameterDefaultValue(count,"0.0");
274

    
275
                        String[] parameterMaxValue={"90.0"};
276
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
277
                        addProjectionParameterMaxValue(count,"90.0");
278
                        addProjectionParameterMaxValue(count,"90.0");
279
                        addProjectionParameterMaxValue(count,"360.0");
280
                        addProjectionParameterMaxValue(count,"100000000.0");
281
                        addProjectionParameterMaxValue(count,"100000000.0");
282

    
283
                        String[] parameterMinValue={"-90.0"};
284
                        projectionParameterMinValueList.add(count,parameterMinValue);
285
                        addProjectionParameterMinValue(count,"-90.0");
286
                        addProjectionParameterMinValue(count,"-90.0");
287
                        addProjectionParameterMinValue(count,"-360.0");
288
                        addProjectionParameterMinValue(count,"-100000000.0");
289
                        addProjectionParameterMinValue(count,"-100000000.0");
290

    
291
                        String[] projectionAcronym={"aea"};
292
                        projectionAcronymList.add(count,projectionAcronym);
293
                }
294
                
295
                count++;
296
                {// Azimuthal_Equidistantt
297
                        String[] projectionName={"Azimuthal_Equidistant"};
298
                        projectionNameList.add(count,projectionName);
299
                        addProjectionName(count,"Azimuthal Equidistant");
300
                        
301
                        String[] parameterName={"latitude_of_center"};
302
                        projectionParameterList.add(count,parameterName);
303
                        addProjectionParameter(count,"longitude_of_center");
304
                        addProjectionParameter(count,"false_easting");
305
                        addProjectionParameter(count,"false_northing");
306

    
307
                        String[] parameterAcronym={"lat_0"};
308
                        projectionParameterAcronymList.add(count,parameterAcronym);
309
                        addProjectionParameterAcronymList(count,"lon_0");
310
                        addProjectionParameterAcronymList(count,"x_0");
311
                        addProjectionParameterAcronymList(count,"y_0");
312

    
313
                        String[] parameterDefaultValue={"0.0"};
314
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
315
                        addProjectionParameterDefaultValue(count,"0.0");
316
                        addProjectionParameterDefaultValue(count,"0.0");
317
                        addProjectionParameterDefaultValue(count,"0.0");
318

    
319
                        String[] parameterMaxValue={"90.0"};
320
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
321
                        addProjectionParameterMaxValue(count,"360.0");
322
                        addProjectionParameterMaxValue(count,"100000000.0");
323
                        addProjectionParameterMaxValue(count,"100000000.0");
324

    
325
                        String[] parameterMinValue={"-90.0"};
326
                        projectionParameterMinValueList.add(count,parameterMinValue);
327
                        addProjectionParameterMinValue(count,"-360.0");
328
                        addProjectionParameterMinValue(count,"-100000000.0");
329
                        addProjectionParameterMinValue(count,"-100000000.0");
330

    
331
                        String[] projectionAcronym={"aeqd"};
332
                        projectionAcronymList.add(count,projectionAcronym);
333
                }
334

    
335
                count++;
336
                {// Bonne
337
                        String[] projectionName={"Bonne"};
338
                        projectionNameList.add(count,projectionName);
339
                        addProjectionName(count,"Bonne");
340

    
341
                        String[] parameterName={"central_meridian"};
342
                        projectionParameterList.add(count,parameterName);
343
                        addProjectionParameter(count,"standard_parallel_1");
344
                        addProjectionParameter(count,"false_easting");
345
                        addProjectionParameter(count,"false_northing");
346

    
347
                        String[] parameterAcronym={"lon_0"};
348
                        projectionParameterAcronymList.add(count,parameterAcronym);
349
                        addProjectionParameterAcronymList(count,"lat_1");
350
                        addProjectionParameterAcronymList(count,"x_0");
351
                        addProjectionParameterAcronymList(count,"y_0");
352

    
353
                        String[] parameterDefaultValue={"0.0"};
354
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
355
                        addProjectionParameterDefaultValue(count,"0.0");
356
                        addProjectionParameterDefaultValue(count,"0.0");
357
                        addProjectionParameterDefaultValue(count,"0.0");
358

    
359
                        String[] parameterMaxValue={"360.0"};
360
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
361
                        addProjectionParameterMaxValue(count,"90.0");
362
                        addProjectionParameterMaxValue(count,"100000000.0");
363
                        addProjectionParameterMaxValue(count,"100000000.0");
364

    
365
                        String[] parameterMinValue={"-360.0"};
366
                        projectionParameterMinValueList.add(count,parameterMinValue);
367
                        addProjectionParameterMinValue(count,"-90.0");
368
                        addProjectionParameterMinValue(count,"-100000000.0");
369
                        addProjectionParameterMinValue(count,"-100000000.0");
370

    
371
                        String[] projectionAcronym={"bonne"};
372
                        projectionAcronymList.add(count,projectionAcronym);
373
                }
374
                
375
                count++;
376
                {// Cassini_Soldner
377
                        String[] projectionName={"Cassini_Soldner"};
378
                        projectionNameList.add(count,projectionName);
379
                        addProjectionName(count,"Cassini-Soldner");
380
                        addProjectionName(count,"9806");
381

    
382
                        String[] parameterName={"latitude_of_origin"};
383
                        projectionParameterList.add(count,parameterName);
384
                        addProjectionParameter(count,"central_meridian");
385
                        addProjectionParameter(count,"false_easting");
386
                        addProjectionParameter(count,"false_northing");
387

    
388
                        String[] parameterAcronym={"lat_0"};
389
                        projectionParameterAcronymList.add(count,parameterAcronym);
390
                        addProjectionParameterAcronymList(count,"lon_0");
391
                        addProjectionParameterAcronymList(count,"x_0");
392
                        addProjectionParameterAcronymList(count,"y_0");
393

    
394
                        String[] parameterDefaultValue={"0.0"};
395
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
396
                        addProjectionParameterDefaultValue(count,"0.0");
397
                        addProjectionParameterDefaultValue(count,"0.0");
398
                        addProjectionParameterDefaultValue(count,"0.0");
399

    
400
                        String[] parameterMaxValue={"90.0"};
401
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
402
                        addProjectionParameterMaxValue(count,"360.0");
403
                        addProjectionParameterMaxValue(count,"100000000.0");
404
                        addProjectionParameterMaxValue(count,"100000000.0");
405

    
406
                        String[] parameterMinValue={"-90.0"};
407
                        projectionParameterMinValueList.add(count,parameterMinValue);
408
                        addProjectionParameterMinValue(count,"-360.0");
409
                        addProjectionParameterMinValue(count,"-100000000.0");
410
                        addProjectionParameterMinValue(count,"-100000000.0");
411

    
412
                        String[] projectionAcronym={"cass"};
413
                        projectionAcronymList.add(count,projectionAcronym);
414
                }
415

    
416
                count++;
417
                {// Cylindrical_Equal_Area
418
                        String[] projectionName={"Cylindrical_Equal_Area"};
419
                        projectionNameList.add(count,projectionName);
420
                        addProjectionName(count,"Cylindrical Equal Area");
421
                        addProjectionName(count,"Normal Authalic Cylindrical (FME)");
422
                        addProjectionName(count,"Lambert Cylindrical Equal Area");
423
                        addProjectionName(count,"Behrmann (standard parallel = 30)");
424
                        addProjectionName(count,"Gall Orthographic (standard parallel = 45)");
425
                        addProjectionName(count,"Peters (approximated by Gall Orthographic)");
426

    
427
                        String[] parameterName={"central_meridian"};
428
                        projectionParameterList.add(count,parameterName);
429
                        addProjectionParameter(count,"standard_parallel_1");
430
                        addProjectionParameter(count,"false_easting");
431
                        addProjectionParameter(count,"false_northing");
432

    
433
                        String[] parameterAcronym={"lon_0"};
434
                        projectionParameterAcronymList.add(count,parameterAcronym);
435
                        addProjectionParameterAcronymList(count,"lat_ts");
436
                        addProjectionParameterAcronymList(count,"x_0");
437
                        addProjectionParameterAcronymList(count,"y_0");
438

    
439
                        String[] parameterDefaultValue={"0.0"};
440
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
441
                        addProjectionParameterDefaultValue(count,"0.0");
442
                        addProjectionParameterDefaultValue(count,"0.0");
443
                        addProjectionParameterDefaultValue(count,"0.0");
444

    
445
                        String[] parameterMaxValue={"360.0"};
446
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
447
                        addProjectionParameterMaxValue(count,"90.0");
448
                        addProjectionParameterMaxValue(count,"100000000.0");
449
                        addProjectionParameterMaxValue(count,"100000000.0");
450

    
451
                        String[] parameterMinValue={"-360.0"};
452
                        projectionParameterMinValueList.add(count,parameterMinValue);
453
                        addProjectionParameterMinValue(count,"-90.0");
454
                        addProjectionParameterMinValue(count,"-100000000.0");
455
                        addProjectionParameterMinValue(count,"-100000000.0");
456

    
457
                        String[] projectionAcronym={"cea"};
458
                        projectionAcronymList.add(count,projectionAcronym);
459
                }
460

    
461
                count++;
462
                {// Eckert_IV
463
                        String[] projectionName={"Eckert_IV"};
464
                        projectionNameList.add(count,projectionName);
465
                        addProjectionName(count,"Eckert IV");
466

    
467
                        String[] parameterName={"central_meridian"};
468
                        projectionParameterList.add(count,parameterName);
469
                        addProjectionParameter(count,"false_easting");
470
                        addProjectionParameter(count,"false_northing");
471

    
472
                        String[] parameterAcronym={"lon_0"};
473
                        projectionParameterAcronymList.add(count,parameterAcronym);
474
                        addProjectionParameterAcronymList(count,"x_0");
475
                        addProjectionParameterAcronymList(count,"y_0");
476

    
477
                        String[] parameterDefaultValue={"0.0"};
478
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
479
                        addProjectionParameterDefaultValue(count,"0.0");
480
                        addProjectionParameterDefaultValue(count,"0.0");
481

    
482
                        String[] parameterMaxValue={"360.0"};
483
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
484
                        addProjectionParameterMaxValue(count,"100000000.0");
485
                        addProjectionParameterMaxValue(count,"100000000.0");
486

    
487
                        String[] parameterMinValue={"-360.0"};
488
                        projectionParameterMinValueList.add(count,parameterMinValue);
489
                        addProjectionParameterMinValue(count,"-100000000.0");
490
                        addProjectionParameterMinValue(count,"-100000000.0");
491

    
492
                        String[] projectionAcronym={"eck4"};
493
                        projectionAcronymList.add(count,projectionAcronym);
494
                }
495

    
496
                count++;
497
                {// Eckert_VI
498
                        String[] projectionName={"Eckert_VI"};
499
                        projectionNameList.add(count,projectionName);
500
                        addProjectionName(count,"Eckert VI");
501

    
502
                        String[] parameterName={"central_meridian"};
503
                        projectionParameterList.add(count,parameterName);
504
                        addProjectionParameter(count,"false_easting");
505
                        addProjectionParameter(count,"false_northing");
506

    
507
                        String[] parameterAcronym={"lon_0"};
508
                        projectionParameterAcronymList.add(count,parameterAcronym);
509
                        addProjectionParameterAcronymList(count,"x_0");
510
                        addProjectionParameterAcronymList(count,"y_0");
511

    
512
                        String[] parameterDefaultValue={"0.0"};
513
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
514
                        addProjectionParameterDefaultValue(count,"0.0");
515
                        addProjectionParameterDefaultValue(count,"0.0");
516

    
517
                        String[] parameterMaxValue={"360.0"};
518
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
519
                        addProjectionParameterMaxValue(count,"100000000.0");
520
                        addProjectionParameterMaxValue(count,"100000000.0");
521

    
522
                        String[] parameterMinValue={"-360.0"};
523
                        projectionParameterMinValueList.add(count,parameterMinValue);
524
                        addProjectionParameterMinValue(count,"-100000000.0");
525
                        addProjectionParameterMinValue(count,"-100000000.0");
526

    
527
                        String[] projectionAcronym={"eck6"};
528
                        projectionAcronymList.add(count,projectionAcronym);
529
                }
530
                
531
                count++;
532
                {// Equidistant_Conic
533
                        String[] projectionName={"Equidistant_Conic"};
534
                        projectionNameList.add(count,projectionName);
535
                        addProjectionName(count,"Equidistant Conic");
536
                        
537
                        String[] parameterName={"latitude_of_center"};
538
                        projectionParameterList.add(count,parameterName);
539
                        addProjectionParameter(count,"longitude_of_center");
540
                        addProjectionParameter(count,"standard_parallel_1");
541
                        addProjectionParameter(count,"standard_parallel_2");
542
                        addProjectionParameter(count,"false_easting");
543
                        addProjectionParameter(count,"false_northing");
544

    
545
                        String[] parameterAcronym={"lat_0"};
546
                        projectionParameterAcronymList.add(count,parameterAcronym);
547
                        addProjectionParameterAcronymList(count,"lon_0");
548
                        addProjectionParameterAcronymList(count,"lat_1");
549
                        addProjectionParameterAcronymList(count,"lat_2");
550
                        addProjectionParameterAcronymList(count,"x_0");
551
                        addProjectionParameterAcronymList(count,"y_0");
552

    
553
                        String[] parameterDefaultValue={"0.0"};
554
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
555
                        addProjectionParameterDefaultValue(count,"0.0");
556
                        addProjectionParameterDefaultValue(count,"0.0");
557
                        addProjectionParameterDefaultValue(count,"0.0");
558
                        addProjectionParameterDefaultValue(count,"0.0");
559
                        addProjectionParameterDefaultValue(count,"0.0");
560

    
561
                        String[] parameterMaxValue={"90.0"};
562
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
563
                        addProjectionParameterMaxValue(count,"360.0");
564
                        addProjectionParameterMaxValue(count,"90.0");
565
                        addProjectionParameterMaxValue(count,"90.0");
566
                        addProjectionParameterMaxValue(count,"100000000.0");
567
                        addProjectionParameterMaxValue(count,"100000000.0");
568

    
569
                        String[] parameterMinValue={"-90.0"};
570
                        projectionParameterMinValueList.add(count,parameterMinValue);
571
                        addProjectionParameterMinValue(count,"-360.0");
572
                        addProjectionParameterMinValue(count,"-90.0");
573
                        addProjectionParameterMinValue(count,"-90.0");
574
                        addProjectionParameterMinValue(count,"-100000000.0");
575
                        addProjectionParameterMinValue(count,"-100000000.0");
576

    
577
                        String[] projectionAcronym={"eqdc"};
578
                        projectionAcronymList.add(count,projectionAcronym);
579
                }
580

    
581
                count++;
582
                {// Equirectangular
583
                        String[] projectionName={"Equirectangular"};
584
                        projectionNameList.add(count,projectionName);
585
                        addProjectionName(count,"Plate Caree");
586
                        addProjectionName(count,"Equidistant Cylindrical");
587
                        addProjectionName(count,"9823");
588

    
589
                        String[] parameterName={"latitude_of_origin"};
590
                        projectionParameterList.add(count,parameterName);
591
                        addProjectionParameter(count,"central_meridian");
592
                        addProjectionParameter(count,"false_easting");
593
                        addProjectionParameter(count,"false_northing");
594

    
595
                        String[] parameterAcronym={"lat_ts"};
596
                        projectionParameterAcronymList.add(count,parameterAcronym);
597
                        addProjectionParameterAcronymList(count,"lon_0");
598
                        addProjectionParameterAcronymList(count,"x_0");
599
                        addProjectionParameterAcronymList(count,"y_0");
600

    
601
                        String[] parameterDefaultValue={"0.0"};
602
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
603
                        addProjectionParameterDefaultValue(count,"0.0");
604
                        addProjectionParameterDefaultValue(count,"0.0");
605
                        addProjectionParameterDefaultValue(count,"0.0");
606

    
607
                        String[] parameterMaxValue={"90.0"};
608
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
609
                        addProjectionParameterMaxValue(count,"360.0");
610
                        addProjectionParameterMaxValue(count,"100000000.0");
611
                        addProjectionParameterMaxValue(count,"100000000.0");
612

    
613
                        String[] parameterMinValue={"-90.0"};
614
                        projectionParameterMinValueList.add(count,parameterMinValue);
615
                        addProjectionParameterMinValue(count,"-360.0");
616
                        addProjectionParameterMinValue(count,"-100000000.0");
617
                        addProjectionParameterMinValue(count,"-100000000.0");
618

    
619
                        String[] projectionAcronym={"eqc"};
620
                        projectionAcronymList.add(count,projectionAcronym);
621
                }
622

    
623
                count++;
624
                {// Gall_Stereographic
625
                        String[] projectionName={"Gall_Stereographic"};
626
                        projectionNameList.add(count,projectionName);
627
                        addProjectionName(count,"Gall Stereograpic");
628
                        addProjectionName(count,"Gall");
629

    
630
                        String[] parameterName={"central_meridian"};
631
                        projectionParameterList.add(count,parameterName);
632
                        addProjectionParameter(count,"false_easting");
633
                        addProjectionParameter(count,"false_northing");
634

    
635
                        String[] parameterAcronym={"lon_0"};
636
                        projectionParameterAcronymList.add(count,parameterAcronym);
637
                        addProjectionParameterAcronymList(count,"x_0");
638
                        addProjectionParameterAcronymList(count,"y_0");
639

    
640
                        String[] parameterDefaultValue={"0.0"};
641
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
642
                        addProjectionParameterDefaultValue(count,"0.0");
643
                        addProjectionParameterDefaultValue(count,"0.0");
644

    
645
                        String[] parameterMaxValue={"360.0"};
646
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
647
                        addProjectionParameterMaxValue(count,"100000000.0");
648
                        addProjectionParameterMaxValue(count,"100000000.0");
649

    
650
                        String[] parameterMinValue={"-360.0"};
651
                        projectionParameterMinValueList.add(count,parameterMinValue);
652
                        addProjectionParameterMinValue(count,"-100000000.0");
653
                        addProjectionParameterMinValue(count,"-100000000.0");
654

    
655
                        String[] projectionAcronym={"gall"};
656
                        projectionAcronymList.add(count,projectionAcronym);
657
                }
658

    
659
                count++;
660
                {// GEOS
661
                        String[] projectionName={"GEOS"};
662
                        projectionNameList.add(count,projectionName);
663
                        addProjectionName(count,"Geostationary Satellite View");
664
                        addProjectionName(count,"Normalized Geostationary Projection");
665

    
666
                        String[] parameterName={"central_meridian"};
667
                        projectionParameterList.add(count,parameterName);
668
                        addProjectionParameter(count,"satellite_height");
669
                        addProjectionParameter(count,"false_easting");
670
                        addProjectionParameter(count,"false_northing");
671

    
672
                        String[] parameterAcronym={"lon_0"};
673
                        projectionParameterAcronymList.add(count,parameterAcronym);
674
                        addProjectionParameterAcronymList(count,"h");
675
                        addProjectionParameterAcronymList(count,"y_0");
676

    
677
                        String[] parameterDefaultValue={"0.0"};
678
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
679
                        addProjectionParameterDefaultValue(count,"35785831.0");
680
                        addProjectionParameterDefaultValue(count,"0.0");
681
                        addProjectionParameterDefaultValue(count,"0.0");
682

    
683
                        String[] parameterMaxValue={"360.0"};
684
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
685
                        addProjectionParameterMaxValue(count,"100000000.0");
686
                        addProjectionParameterMaxValue(count,"100000000.0");
687
                        addProjectionParameterMaxValue(count,"100000000.0");
688

    
689
                        String[] parameterMinValue={"-360.0"};
690
                        projectionParameterMinValueList.add(count,parameterMinValue);
691
                        addProjectionParameterMinValue(count,"-100000000.0");
692
                        addProjectionParameterMinValue(count,"-100000000.0");
693
                        addProjectionParameterMinValue(count,"-100000000.0");
694

    
695
                        String[] projectionAcronym={"geos"};
696
                        projectionAcronymList.add(count,projectionAcronym);
697
                }
698

    
699
                count++;
700
                {// Gnomonic
701
                        String[] projectionName={"Gnomonic"};
702
                        projectionNameList.add(count,projectionName);
703
                        addProjectionName(count,"Gnomonic");
704

    
705
                        String[] parameterName={"latitude_of_origin"};
706
                        projectionParameterList.add(count,parameterName);
707
                        addProjectionParameter(count,"central_meridian");
708
                        addProjectionParameter(count,"false_easting");
709
                        addProjectionParameter(count,"false_northing");
710

    
711
                        String[] parameterAcronym={"lat_0"};
712
                        projectionParameterAcronymList.add(count,parameterAcronym);
713
                        addProjectionParameterAcronymList(count,"lon_0");
714
                        addProjectionParameterAcronymList(count,"x_0");
715
                        addProjectionParameterAcronymList(count,"y_0");
716

    
717
                        String[] parameterDefaultValue={"0.0"};
718
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
719
                        addProjectionParameterDefaultValue(count,"0.0");
720
                        addProjectionParameterDefaultValue(count,"0.0");
721
                        addProjectionParameterDefaultValue(count,"0.0");
722

    
723
                        String[] parameterMaxValue={"90.0"};
724
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
725
                        addProjectionParameterMaxValue(count,"360.0");
726
                        addProjectionParameterMaxValue(count,"100000000.0");
727
                        addProjectionParameterMaxValue(count,"100000000.0");
728

    
729
                        String[] parameterMinValue={"-90.0"};
730
                        projectionParameterMinValueList.add(count,parameterMinValue);
731
                        addProjectionParameterMinValue(count,"-360.0");
732
                        addProjectionParameterMinValue(count,"-100000000.0");
733
                        addProjectionParameterMinValue(count,"-100000000.0");
734

    
735
                        String[] projectionAcronym={"gnom"};
736
                        projectionAcronymList.add(count,projectionAcronym);
737
                }
738

    
739
                count++;
740
                {// Goode
741
                        String[] projectionName={"Goode"};
742
                        projectionNameList.add(count,projectionName);
743

    
744
                        String[] parameterName={"central_meridian"};
745
                        projectionParameterList.add(count,parameterName);
746
                        addProjectionParameter(count,"false_easting");
747
                        addProjectionParameter(count,"false_northing");
748

    
749
                        String[] parameterAcronym={"lon_0"};
750
                        projectionParameterAcronymList.add(count,parameterAcronym);
751
                        addProjectionParameterAcronymList(count,"x_0");
752
                        addProjectionParameterAcronymList(count,"y_0");
753

    
754
                        String[] parameterDefaultValue={"0.0"};
755
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
756
                        addProjectionParameterDefaultValue(count,"0.0");
757
                        addProjectionParameterDefaultValue(count,"0.0");
758

    
759
                        String[] parameterMaxValue={"360.0"};
760
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
761
                        addProjectionParameterMaxValue(count,"100000000.0");
762
                        addProjectionParameterMaxValue(count,"100000000.0");
763

    
764
                        String[] parameterMinValue={"-360.0"};
765
                        projectionParameterMinValueList.add(count,parameterMinValue);
766
                        addProjectionParameterMinValue(count,"-100000000.0");
767
                        addProjectionParameterMinValue(count,"-100000000.0");
768

    
769
                        String[] projectionAcronym={"goode"};
770
                        projectionAcronymList.add(count,projectionAcronym);
771
                }
772

    
773
                count++;
774
                {// hotine_oblique_mercator
775
                        String[] projectionName={"hotine_oblique_mercator"};
776
                        projectionNameList.add(count,projectionName);
777
                        addProjectionName(count,"Hotine Oblique Mercator");
778
                        addProjectionName(count,"9812");
779

    
780
                        String[] parameterName={"latitude_of_center"};
781
                        projectionParameterList.add(count,parameterName);
782
                        addProjectionParameter(count,"longitude_of_center");
783
                        addProjectionParameter(count,"azimuth");
784
                        //addProjectionParameter(count,"rectified_grid_angle");
785
                        addProjectionParameter(count,"scale_factor");
786
                        addProjectionParameter(count,"false_easting");
787
                        addProjectionParameter(count,"false_northing");
788

    
789
                        String[] parameterAcronym={"lat_0"};
790
                        projectionParameterAcronymList.add(count,parameterAcronym);
791
                        addProjectionParameterAcronymList(count,"lonc");
792
                        addProjectionParameterAcronymList(count,"alpha");
793
                        addProjectionParameterAcronymList(count,"k");
794
                        addProjectionParameterAcronymList(count,"x_0");
795
                        addProjectionParameterAcronymList(count,"y_0");
796

    
797
                        String[] parameterDefaultValue={"0.0"};
798
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
799
                        addProjectionParameterDefaultValue(count,"0.0");
800
                        addProjectionParameterDefaultValue(count,"1.0");
801
                        addProjectionParameterDefaultValue(count,"0.0");
802
                        addProjectionParameterDefaultValue(count,"0.0");
803

    
804
                        String[] parameterMaxValue={"90.0"};
805
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
806
                        addProjectionParameterMaxValue(count,"360.0");
807
                        addProjectionParameterMaxValue(count,"360.0");
808
                        addProjectionParameterMaxValue(count,"10.0");
809
                        addProjectionParameterMaxValue(count,"100000000.0");
810
                        addProjectionParameterMaxValue(count,"100000000.0");
811

    
812
                        String[] parameterMinValue={"-90.0"};
813
                        projectionParameterMinValueList.add(count,parameterMinValue);
814
                        addProjectionParameterMinValue(count,"-360.0");
815
                        addProjectionParameterMinValue(count,"-360.0");
816
                        addProjectionParameterMinValue(count,"0.0");
817
                        addProjectionParameterMinValue(count,"-100000000.0");
818
                        addProjectionParameterMinValue(count,"-100000000.0");
819

    
820
                        String[] projectionAcronym={"omerc"};
821
                        projectionAcronymList.add(count,projectionAcronym);
822
                }
823
                
824
                count++;
825
                {// Krovak
826
                        String[] projectionName={"Krovak"};
827
                        projectionNameList.add(count,projectionName);
828
                        addProjectionName(count,"Krovak Oblique Conic Conformal");
829
                        addProjectionName(count,"9819");
830

    
831
                        String[] parameterName={"latitude_of_center"};
832
                        projectionParameterList.add(count,parameterName);
833
                        addProjectionParameter(count,"longitude_of_center");
834
                        addProjectionParameter(count,"azimuth");
835
                        addProjectionParameter(count,"scale_factor");
836
                        addProjectionParameter(count,"false_easting");
837
                        addProjectionParameter(count,"false_northing");
838

    
839
                        String[] parameterAcronym={"lat_0"};
840
                        projectionParameterAcronymList.add(count,parameterAcronym);
841
                        addProjectionParameterAcronymList(count,"lon_0");
842
                        addProjectionParameterAcronymList(count,"alpha");
843
                        addProjectionParameterAcronymList(count,"k");
844
                        addProjectionParameterAcronymList(count,"x_0");
845
                        addProjectionParameterAcronymList(count,"y_0");
846

    
847
                        String[] parameterDefaultValue={"0.0"};
848
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
849
                        addProjectionParameterDefaultValue(count,"0.0");
850
                        addProjectionParameterDefaultValue(count,"0.0");
851
                        addProjectionParameterDefaultValue(count,"1.0");
852
                        addProjectionParameterDefaultValue(count,"0.0");
853
                        addProjectionParameterDefaultValue(count,"0.0");
854

    
855
                        String[] parameterMaxValue={"90.0"};
856
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
857
                        addProjectionParameterMaxValue(count,"360.0");
858
                        addProjectionParameterMaxValue(count,"360.0");
859
                        addProjectionParameterMaxValue(count,"10.0");
860
                        addProjectionParameterMaxValue(count,"100000000.0");
861
                        addProjectionParameterMaxValue(count,"100000000.0");
862

    
863
                        String[] parameterMinValue={"-90.0"};
864
                        projectionParameterMinValueList.add(count,parameterMinValue);
865
                        addProjectionParameterMinValue(count,"-360.0");
866
                        addProjectionParameterMinValue(count,"-360.0");
867
                        addProjectionParameterMinValue(count,"0.0");
868
                        addProjectionParameterMinValue(count,"-100000000.0");
869
                        addProjectionParameterMinValue(count,"-100000000.0");
870

    
871
                        String[] projectionAcronym={"krovak"};
872
                        projectionAcronymList.add(count,projectionAcronym);
873
                }
874
                
875
                // Laborde_Oblique_Mercator - Similar a hotine_oblique_mercator
876

    
877
                count++;
878
                {// Lambert_Azimuthal_Equal_Area
879
                        String[] projectionName={"Lambert_Azimuthal_Equal_Area"};
880
                        projectionNameList.add(count,projectionName);
881
                        addProjectionName(count,"Lambert Azimuthal Equal Area");
882
                        addProjectionName(count,"9820");
883

    
884
                        String[] parameterName={"latitude_of_center"};
885
                        projectionParameterList.add(count,parameterName);
886
                        addProjectionParameter(count,"longitude_of_center");
887
                        addProjectionParameter(count,"false_easting");
888
                        addProjectionParameter(count,"false_northing");
889

    
890
                        String[] parameterAcronym={"lat_0"};
891
                        projectionParameterAcronymList.add(count,parameterAcronym);
892
                        addProjectionParameterAcronymList(count,"lon_0");
893
                        addProjectionParameterAcronymList(count,"x_0");
894
                        addProjectionParameterAcronymList(count,"y_0");
895

    
896
                        String[] parameterDefaultValue={"0.0"};
897
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
898
                        addProjectionParameterDefaultValue(count,"0.0");
899
                        addProjectionParameterDefaultValue(count,"0.0");
900
                        addProjectionParameterDefaultValue(count,"0.0");
901

    
902
                        String[] parameterMaxValue={"90.0"};
903
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
904
                        addProjectionParameterMaxValue(count,"360.0");
905
                        addProjectionParameterMaxValue(count,"100000000.0");
906
                        addProjectionParameterMaxValue(count,"100000000.0");
907

    
908
                        String[] parameterMinValue={"-90.0"};
909
                        projectionParameterMinValueList.add(count,parameterMinValue);
910
                        addProjectionParameterMinValue(count,"-360.0");
911
                        addProjectionParameterMinValue(count,"-100000000.0");
912
                        addProjectionParameterMinValue(count,"-100000000.0");
913

    
914
                        String[] projectionAcronym={"laea"};
915
                        projectionAcronymList.add(count,projectionAcronym);
916
                }
917
                
918
                count++;
919
                {// Lambert_Conformal_Conic_1SP
920
                        String[] projectionName={"Lambert_Conformal_Conic_1SP"};
921
                        projectionNameList.add(count,projectionName);
922
                        addProjectionName(count,"Lambert Conic Conformal (1SP)");
923
                        addProjectionName(count,"9801");
924

    
925
                        String[] parameterName={"latitude_of_origin"};
926
                        projectionParameterList.add(count,parameterName);
927
                        addProjectionParameter(count,"latitude_of_origin"); // lat_1=lat_0
928
                        addProjectionParameter(count,"central_meridian");
929
                        addProjectionParameter(count,"scale_factor");
930
                        addProjectionParameter(count,"false_easting");
931
                        addProjectionParameter(count,"false_northing");
932

    
933
                        String[] parameterAcronym={"lat_1"};
934
                        projectionParameterAcronymList.add(count,parameterAcronym);
935
                        addProjectionParameterAcronymList(count,"lat_0");
936
                        addProjectionParameterAcronymList(count,"lon_0");
937
                        addProjectionParameterAcronymList(count,"k_0");
938
                        addProjectionParameterAcronymList(count,"x_0");
939
                        addProjectionParameterAcronymList(count,"y_0");
940

    
941
                        String[] parameterDefaultValue={"0.0"};
942
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
943
                        addProjectionParameterDefaultValue(count,"0.0");
944
                        addProjectionParameterDefaultValue(count,"0.0");
945
                        addProjectionParameterDefaultValue(count,"1.0");
946
                        addProjectionParameterDefaultValue(count,"0.0");
947
                        addProjectionParameterDefaultValue(count,"0.0");
948

    
949
                        String[] parameterMaxValue={"90.0"};
950
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
951
                        addProjectionParameterMaxValue(count,"90.0");
952
                        addProjectionParameterMaxValue(count,"360.0");
953
                        addProjectionParameterMaxValue(count,"10.0");
954
                        addProjectionParameterMaxValue(count,"100000000.0");
955
                        addProjectionParameterMaxValue(count,"100000000.0");
956

    
957
                        String[] parameterMinValue={"-90.0"};
958
                        projectionParameterMinValueList.add(count,parameterMinValue);
959
                        addProjectionParameterMinValue(count,"-90.0");
960
                        addProjectionParameterMinValue(count,"-360.0");
961
                        addProjectionParameterMinValue(count,"0.0");
962
                        addProjectionParameterMinValue(count,"-100000000.0");
963
                        addProjectionParameterMinValue(count,"-100000000.0");
964

    
965
                        String[] projectionAcronym={"lcc"};
966
                        projectionAcronymList.add(count,projectionAcronym);
967
                }
968
                
969
                count++;
970
                {// Lambert_Conformal_Conic_2SP
971
                        String[] projectionName={"Lambert_Conformal_Conic_2SP"};
972
                        projectionNameList.add(count,projectionName);
973
                        addProjectionName(count,"Lambert Conic Conformal (2SP)");
974
                        addProjectionName(count,"9802");
975

    
976
                        String[] parameterName={"standard_parallel_1"};
977
                        projectionParameterList.add(count,parameterName);
978
                        addProjectionParameter(count,"standard_parallel_2");
979
                        addProjectionParameter(count,"latitude_of_origin");
980
                        addProjectionParameter(count,"central_meridian");
981
                        addProjectionParameter(count,"false_easting");
982
                        addProjectionParameter(count,"false_northing");
983

    
984
                        String[] parameterAcronym={"lat_1"};
985
                        projectionParameterAcronymList.add(count,parameterAcronym);
986
                        addProjectionParameterAcronymList(count,"lat_2");
987
                        addProjectionParameterAcronymList(count,"lat_0");
988
                        addProjectionParameterAcronymList(count,"lon_0");
989
                        addProjectionParameterAcronymList(count,"x_0");
990
                        addProjectionParameterAcronymList(count,"y_0");
991

    
992
                        String[] parameterDefaultValue={"0.0"};
993
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
994
                        addProjectionParameterDefaultValue(count,"0.0");
995
                        addProjectionParameterDefaultValue(count,"0.0");
996
                        addProjectionParameterDefaultValue(count,"0.0");
997
                        addProjectionParameterDefaultValue(count,"0.0");
998
                        addProjectionParameterDefaultValue(count,"0.0");
999

    
1000
                        String[] parameterMaxValue={"90.0"};
1001
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1002
                        addProjectionParameterMaxValue(count,"90.0");
1003
                        addProjectionParameterMaxValue(count,"90.0");
1004
                        addProjectionParameterMaxValue(count,"360.0");
1005
                        addProjectionParameterMaxValue(count,"100000000.0");
1006
                        addProjectionParameterMaxValue(count,"100000000.0");
1007

    
1008
                        String[] parameterMinValue={"-90.0"};
1009
                        projectionParameterMinValueList.add(count,parameterMinValue);
1010
                        addProjectionParameterMinValue(count,"-90.0");
1011
                        addProjectionParameterMinValue(count,"-90.0");
1012
                        addProjectionParameterMinValue(count,"-360.0");
1013
                        addProjectionParameterMinValue(count,"-100000000.0");
1014
                        addProjectionParameterMinValue(count,"-100000000.0");
1015

    
1016
                        String[] projectionAcronym={"lcc"};
1017
                        projectionAcronymList.add(count,projectionAcronym);
1018
                }
1019
                
1020
                count++;
1021
                {// Lambert_Conformal_Conic_2SP_Belgium
1022
                        String[] projectionName={"Lambert_Conformal_Conic_2SP_Belgium"};
1023
                        projectionNameList.add(count,projectionName);
1024
                        addProjectionName(count,"Lambert Conic Conformal (2SP Belgium)");
1025
                        addProjectionName(count,"9803");
1026

    
1027
                        String[] parameterName={"standard_parallel_1"};
1028
                        projectionParameterList.add(count,parameterName);
1029
                        addProjectionParameter(count,"standard_parallel_2");
1030
                        addProjectionParameter(count,"latitude_of_origin");
1031
                        addProjectionParameter(count,"central_meridian");
1032
                        addProjectionParameter(count,"false_easting");
1033
                        addProjectionParameter(count,"false_northing");
1034

    
1035
                        String[] parameterAcronym={"lat_1"};
1036
                        projectionParameterAcronymList.add(count,parameterAcronym);
1037
                        addProjectionParameterAcronymList(count,"lat_2");
1038
                        addProjectionParameterAcronymList(count,"lat_0");
1039
                        addProjectionParameterAcronymList(count,"lon_0");
1040
                        addProjectionParameterAcronymList(count,"x_0");
1041
                        addProjectionParameterAcronymList(count,"y_0");
1042

    
1043
                        String[] parameterDefaultValue={"0.0"};
1044
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1045
                        addProjectionParameterDefaultValue(count,"0.0");
1046
                        addProjectionParameterDefaultValue(count,"0.0");
1047
                        addProjectionParameterDefaultValue(count,"0.0");
1048
                        addProjectionParameterDefaultValue(count,"0.0");
1049
                        addProjectionParameterDefaultValue(count,"0.0");
1050

    
1051
                        String[] parameterMaxValue={"90.0"};
1052
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1053
                        addProjectionParameterMaxValue(count,"90.0");
1054
                        addProjectionParameterMaxValue(count,"90.0");
1055
                        addProjectionParameterMaxValue(count,"360.0");
1056
                        addProjectionParameterMaxValue(count,"100000000.0");
1057
                        addProjectionParameterMaxValue(count,"100000000.0");
1058

    
1059
                        String[] parameterMinValue={"-90.0"};
1060
                        projectionParameterMinValueList.add(count,parameterMinValue);
1061
                        addProjectionParameterMinValue(count,"-90.0");
1062
                        addProjectionParameterMinValue(count,"-90.0");
1063
                        addProjectionParameterMinValue(count,"-360.0");
1064
                        addProjectionParameterMinValue(count,"-100000000.0");
1065
                        addProjectionParameterMinValue(count,"-100000000.0");
1066

    
1067
                        String[] projectionAcronym={"lcc"};
1068
                        projectionAcronymList.add(count,projectionAcronym);
1069
                }
1070
                
1071
                count++;
1072
                {// Mercator_1SP
1073
                        String[] projectionName={"Mercator_1SP"};
1074
                        projectionNameList.add(count,projectionName);
1075
                        addProjectionName(count,"Mercator");
1076
                        addProjectionName(count,"9804");
1077

    
1078
                        String[] parameterName={"central_meridian"};
1079
                        projectionParameterList.add(count,parameterName);
1080
                        addProjectionParameter(count,"scale_factor");  // o latitude_origin
1081
                        addProjectionParameter(count,"false_easting");
1082
                        addProjectionParameter(count,"false_northing");
1083

    
1084
                        String[] parameterAcronym={"lon_0"};
1085
                        projectionParameterAcronymList.add(count,parameterAcronym);
1086
                        addProjectionParameterAcronymList(count,"k"); // o lat_ts
1087
                        addProjectionParameterAcronymList(count,"x_0");
1088
                        addProjectionParameterAcronymList(count,"y_0");
1089

    
1090
                        String[] parameterDefaultValue={"0.0"};
1091
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1092
                        addProjectionParameterDefaultValue(count,"1.0"); // o 0.0
1093
                        addProjectionParameterDefaultValue(count,"0.0");
1094
                        addProjectionParameterDefaultValue(count,"0.0");
1095

    
1096
                        String[] parameterMaxValue={"360.0"};
1097
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1098
                        addProjectionParameterMaxValue(count,"10.0");
1099
                        addProjectionParameterMaxValue(count,"100000000.0");
1100
                        addProjectionParameterMaxValue(count,"100000000.0");
1101

    
1102
                        String[] parameterMinValue={"-360.0"};
1103
                        projectionParameterMinValueList.add(count,parameterMinValue);
1104
                        addProjectionParameterMinValue(count,"0.0");
1105
                        addProjectionParameterMinValue(count,"-100000000.0");
1106
                        addProjectionParameterMinValue(count,"-100000000.0");
1107

    
1108
                        String[] projectionAcronym={"merc"};
1109
                        projectionAcronymList.add(count,projectionAcronym);
1110
                }
1111
                
1112
                count++;
1113
                {// Mercator_2SP
1114
                        String[] projectionName={"Mercator_2SP"};
1115
                        projectionNameList.add(count,projectionName);
1116
                        addProjectionName(count,"Mercator");
1117
                        addProjectionName(count,"9805");
1118

    
1119
                        String[] parameterName={"central_meridian"};
1120
                        projectionParameterList.add(count,parameterName);
1121
                        addProjectionParameter(count,"standard_parallel_1");
1122
                        addProjectionParameter(count,"false_easting");
1123
                        addProjectionParameter(count,"false_northing");
1124

    
1125
                        String[] parameterAcronym={"lon_0"};
1126
                        projectionParameterAcronymList.add(count,parameterAcronym);
1127
                        addProjectionParameterAcronymList(count,"lat_ts");
1128
                        addProjectionParameterAcronymList(count,"x_0");
1129
                        addProjectionParameterAcronymList(count,"y_0");
1130

    
1131
                        String[] parameterDefaultValue={"0.0"};
1132
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1133
                        addProjectionParameterDefaultValue(count,"0.0"); // o 0.0
1134
                        addProjectionParameterDefaultValue(count,"0.0");
1135
                        addProjectionParameterDefaultValue(count,"0.0");
1136

    
1137
                        String[] parameterMaxValue={"360.0"};
1138
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1139
                        addProjectionParameterMaxValue(count,"90.0");
1140
                        addProjectionParameterMaxValue(count,"100000000.0");
1141
                        addProjectionParameterMaxValue(count,"100000000.0");
1142

    
1143
                        String[] parameterMinValue={"-360.0"};
1144
                        projectionParameterMinValueList.add(count,parameterMinValue);
1145
                        addProjectionParameterMinValue(count,"-90.0");
1146
                        addProjectionParameterMinValue(count,"-100000000.0");
1147
                        addProjectionParameterMinValue(count,"-100000000.0");
1148

    
1149
                        String[] projectionAcronym={"merc"};
1150
                        projectionAcronymList.add(count,projectionAcronym);
1151
                }
1152

    
1153
                count++;
1154
                {// Miller_Cylindrical
1155
                        String[] projectionName={"Miller_Cylindrical"};
1156
                        projectionNameList.add(count,projectionName);
1157
                        addProjectionName(count,"Miller Cylindrical");
1158

    
1159
                        String[] parameterName={"latitude_of_center"};
1160
                        projectionParameterList.add(count,parameterName);
1161
                        addProjectionParameter(count,"longitude_of_center");
1162
                        addProjectionParameter(count,"false_easting");
1163
                        addProjectionParameter(count,"false_northing");
1164

    
1165
                        String[] parameterAcronym={"lat_0"};
1166
                        projectionParameterAcronymList.add(count,parameterAcronym);
1167
                        addProjectionParameterAcronymList(count,"lon_0");
1168
                        addProjectionParameterAcronymList(count,"x_0");
1169
                        addProjectionParameterAcronymList(count,"y_0");
1170

    
1171
                        String[] parameterDefaultValue={"0.0"};
1172
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1173
                        addProjectionParameterDefaultValue(count,"0.0");
1174
                        addProjectionParameterDefaultValue(count,"0.0");
1175
                        addProjectionParameterDefaultValue(count,"0.0");
1176

    
1177
                        String[] parameterMaxValue={"90.0"};
1178
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1179
                        addProjectionParameterMaxValue(count,"360.0");
1180
                        addProjectionParameterMaxValue(count,"100000000.0");
1181
                        addProjectionParameterMaxValue(count,"100000000.0");
1182

    
1183
                        String[] parameterMinValue={"-90.0"};
1184
                        projectionParameterMinValueList.add(count,parameterMinValue);
1185
                        addProjectionParameterMinValue(count,"-360.0");
1186
                        addProjectionParameterMinValue(count,"-100000000.0");
1187
                        addProjectionParameterMinValue(count,"-100000000.0");
1188

    
1189
                        String[] projectionAcronym={"mill"};
1190
                        projectionAcronymList.add(count,projectionAcronym);
1191
                }
1192
                
1193
                count++;
1194
                {// Mollweide
1195
                        String[] projectionName={"Mollweide"};
1196
                        projectionNameList.add(count,projectionName);
1197
                        addProjectionName(count,"Hornolographic");
1198
                        addProjectionName(count,"Babinet");
1199
                        addProjectionName(count,"Elliptical");
1200

    
1201
                        String[] parameterName={"central_meridian"};
1202
                        projectionParameterList.add(count,parameterName);
1203
                        addProjectionParameter(count,"false_easting");
1204
                        addProjectionParameter(count,"false_northing");
1205

    
1206
                        String[] parameterAcronym={"lon_0"};
1207
                        projectionParameterAcronymList.add(count,parameterAcronym);
1208
                        addProjectionParameterAcronymList(count,"x_0");
1209
                        addProjectionParameterAcronymList(count,"y_0");
1210

    
1211
                        String[] parameterDefaultValue={"0.0"};
1212
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1213
                        addProjectionParameterDefaultValue(count,"0.0");
1214
                        addProjectionParameterDefaultValue(count,"0.0");
1215

    
1216
                        String[] parameterMaxValue={"360.0"};
1217
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1218
                        addProjectionParameterMaxValue(count,"100000000.0");
1219
                        addProjectionParameterMaxValue(count,"100000000.0");
1220

    
1221
                        String[] parameterMinValue={"-360.0"};
1222
                        projectionParameterMinValueList.add(count,parameterMinValue);
1223
                        addProjectionParameterMinValue(count,"-100000000.0");
1224
                        addProjectionParameterMinValue(count,"-100000000.0");
1225

    
1226
                        String[] projectionAcronym={"moll"};
1227
                        projectionAcronymList.add(count,projectionAcronym);
1228
                }
1229

    
1230
                count++;
1231
                {// New_Zealand_Map_Grid
1232
                        String[] projectionName={"New_Zealand_Map_Grid"};
1233
                        projectionNameList.add(count,projectionName);
1234
                        addProjectionName(count,"New Zealand Map Grid");
1235
                        addProjectionName(count,"9811");
1236

    
1237
                        String[] parameterName={"latitude_of_origin"};
1238
                        projectionParameterList.add(count,parameterName);
1239
                        addProjectionParameter(count,"central_meridian");
1240
                        addProjectionParameter(count,"false_easting");
1241
                        addProjectionParameter(count,"false_northing");
1242

    
1243
                        String[] parameterAcronym={"lat_0"};
1244
                        projectionParameterAcronymList.add(count,parameterAcronym);
1245
                        addProjectionParameterAcronymList(count,"lon_0");
1246
                        addProjectionParameterAcronymList(count,"x_0");
1247
                        addProjectionParameterAcronymList(count,"y_0");
1248

    
1249
                        String[] parameterDefaultValue={"0.0"};
1250
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1251
                        addProjectionParameterDefaultValue(count,"0.0");
1252
                        addProjectionParameterDefaultValue(count,"0.0");
1253
                        addProjectionParameterDefaultValue(count,"0.0");
1254

    
1255
                        String[] parameterMaxValue={"90.0"};
1256
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1257
                        addProjectionParameterMaxValue(count,"360.0");
1258
                        addProjectionParameterMaxValue(count,"100000000.0");
1259
                        addProjectionParameterMaxValue(count,"100000000.0");
1260

    
1261
                        String[] parameterMinValue={"-90.0"};
1262
                        projectionParameterMinValueList.add(count,parameterMinValue);
1263
                        addProjectionParameterMinValue(count,"-360.0");
1264
                        addProjectionParameterMinValue(count,"-100000000.0");
1265
                        addProjectionParameterMinValue(count,"-100000000.0");
1266

    
1267
                        String[] projectionAcronym={"nzmg"};
1268
                        projectionAcronymList.add(count,projectionAcronym);
1269
                }
1270

    
1271
                count++;
1272
                {// Oblique_Mercator
1273
                        String[] projectionName={"Oblique_Mercator"};
1274
                        projectionNameList.add(count,projectionName);
1275
                        addProjectionName(count,"Oblique Mercator");
1276
                        addProjectionName(count,"9815");
1277

    
1278
                        String[] parameterName={"latitude_of_center"};
1279
                        projectionParameterList.add(count,parameterName);
1280
                        addProjectionParameter(count,"longitude_of_center");
1281
                        addProjectionParameter(count,"azimuth");
1282
                        //addProjectionParameter(count,"rectified_grid_angle");
1283
                        addProjectionParameter(count,"scale_factor");
1284
                        addProjectionParameter(count,"false_easting");
1285
                        addProjectionParameter(count,"false_northing");
1286

    
1287
                        String[] parameterAcronym={"lat_0"};
1288
                        projectionParameterAcronymList.add(count,parameterAcronym);
1289
                        addProjectionParameterAcronymList(count,"lonc");
1290
                        addProjectionParameterAcronymList(count,"alpha");
1291
                        addProjectionParameterAcronymList(count,"k");
1292
                        addProjectionParameterAcronymList(count,"x_0");
1293
                        addProjectionParameterAcronymList(count,"y_0");
1294

    
1295
                        String[] parameterDefaultValue={"0.0"};
1296
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1297
                        addProjectionParameterDefaultValue(count,"0.0");
1298
                        addProjectionParameterDefaultValue(count,"1.0");
1299
                        addProjectionParameterDefaultValue(count,"0.0");
1300
                        addProjectionParameterDefaultValue(count,"0.0");
1301

    
1302
                        String[] parameterMaxValue={"90.0"};
1303
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1304
                        addProjectionParameterMaxValue(count,"360.0");
1305
                        addProjectionParameterMaxValue(count,"360.0");
1306
                        addProjectionParameterMaxValue(count,"10.0");
1307
                        addProjectionParameterMaxValue(count,"100000000.0");
1308
                        addProjectionParameterMaxValue(count,"100000000.0");
1309

    
1310
                        String[] parameterMinValue={"-90.0"};
1311
                        projectionParameterMinValueList.add(count,parameterMinValue);
1312
                        addProjectionParameterMinValue(count,"-360.0");
1313
                        addProjectionParameterMinValue(count,"-360.0");
1314
                        addProjectionParameterMinValue(count,"0.0");
1315
                        addProjectionParameterMinValue(count,"-100000000.0");
1316
                        addProjectionParameterMinValue(count,"-100000000.0");
1317

    
1318
                        String[] projectionAcronym={"omerc"};
1319
                        projectionAcronymList.add(count,projectionAcronym);
1320
                }
1321

    
1322
                count++;
1323
                {// Oblique_Stereographic
1324
                        String[] projectionName={"Oblique_Stereographic"};
1325
                        projectionNameList.add(count,projectionName);
1326
                        addProjectionName(count,"Oblique Stereographic");
1327
                        addProjectionName(count,"9809");
1328

    
1329
                        String[] parameterName={"latitude_of_origin"};
1330
                        projectionParameterList.add(count,parameterName);
1331
                        addProjectionParameter(count,"central_meridian");
1332
                        addProjectionParameter(count,"scale_factor");
1333
                        addProjectionParameter(count,"false_easting");
1334
                        addProjectionParameter(count,"false_northing");
1335

    
1336
                        String[] parameterAcronym={"lat_0"};
1337
                        projectionParameterAcronymList.add(count,parameterAcronym);
1338
                        addProjectionParameterAcronymList(count,"lon_0");
1339
                        addProjectionParameterAcronymList(count,"k");
1340
                        addProjectionParameterAcronymList(count,"x_0");
1341
                        addProjectionParameterAcronymList(count,"y_0");
1342

    
1343
                        String[] parameterDefaultValue={"0.0"};
1344
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1345
                        addProjectionParameterDefaultValue(count,"0.0");
1346
                        addProjectionParameterDefaultValue(count,"1.0");
1347
                        addProjectionParameterDefaultValue(count,"0.0");
1348
                        addProjectionParameterDefaultValue(count,"0.0");
1349

    
1350
                        String[] parameterMaxValue={"90.0"};
1351
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1352
                        addProjectionParameterMaxValue(count,"360.0");
1353
                        addProjectionParameterMaxValue(count,"10.0");
1354
                        addProjectionParameterMaxValue(count,"100000000.0");
1355
                        addProjectionParameterMaxValue(count,"100000000.0");
1356

    
1357
                        String[] parameterMinValue={"-90.0"};
1358
                        projectionParameterMinValueList.add(count,parameterMinValue);
1359
                        addProjectionParameterMinValue(count,"-360.0");
1360
                        addProjectionParameterMinValue(count,"0.0");
1361
                        addProjectionParameterMinValue(count,"-100000000.0");
1362
                        addProjectionParameterMinValue(count,"-100000000.0");
1363

    
1364
                        String[] projectionAcronym={"sterea"};
1365
                        projectionAcronymList.add(count,projectionAcronym);
1366
                }
1367

    
1368
                count++;
1369
                {// Orthographic
1370
                        String[] projectionName={"Orthographic"};
1371
                        projectionNameList.add(count,projectionName);
1372

    
1373
                        String[] parameterName={"latitude_of_origin"};
1374
                        projectionParameterList.add(count,parameterName);
1375
                        addProjectionParameter(count,"central_meridian");
1376
                        addProjectionParameter(count,"false_easting");
1377
                        addProjectionParameter(count,"false_northing");
1378

    
1379
                        String[] parameterAcronym={"lat_0"};
1380
                        projectionParameterAcronymList.add(count,parameterAcronym);
1381
                        addProjectionParameterAcronymList(count,"lon_0");
1382
                        addProjectionParameterAcronymList(count,"x_0");
1383
                        addProjectionParameterAcronymList(count,"y_0");
1384

    
1385
                        String[] parameterDefaultValue={"0.0"};
1386
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1387
                        addProjectionParameterDefaultValue(count,"0.0");
1388
                        addProjectionParameterDefaultValue(count,"0.0");
1389
                        addProjectionParameterDefaultValue(count,"0.0");
1390

    
1391
                        String[] parameterMaxValue={"90.0"};
1392
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1393
                        addProjectionParameterMaxValue(count,"360.0");
1394
                        addProjectionParameterMaxValue(count,"100000000.0");
1395
                        addProjectionParameterMaxValue(count,"100000000.0");
1396

    
1397
                        String[] parameterMinValue={"-90.0"};
1398
                        projectionParameterMinValueList.add(count,parameterMinValue);
1399
                        addProjectionParameterMinValue(count,"-360.0");
1400
                        addProjectionParameterMinValue(count,"-100000000.0");
1401
                        addProjectionParameterMinValue(count,"-100000000.0");
1402

    
1403
                        String[] projectionAcronym={"ortho"};
1404
                        projectionAcronymList.add(count,projectionAcronym);
1405
                }
1406

    
1407
                count++;
1408
                {// Polar_Stereographic
1409
                        String[] projectionName={"Polar_Stereographic"};
1410
                        projectionNameList.add(count,projectionName);
1411
                        addProjectionName(count,"Polar Stereographic");
1412
                        addProjectionName(count,"9810");
1413

    
1414
                        String[] parameterName={"latitude_of_origin"};
1415
                        projectionParameterList.add(count,parameterName);
1416
                        addProjectionParameter(count,"latitude_of_origin");
1417
                        addProjectionParameter(count,"central_meridian");
1418
                        addProjectionParameter(count,"scale_factor");
1419
                        addProjectionParameter(count,"false_easting");
1420
                        addProjectionParameter(count,"false_northing");
1421

    
1422
                        String[] parameterAcronym={"lat_0"};
1423
                        //lat_0=90 o lat_0=-90
1424
                        projectionParameterAcronymList.add(count,parameterAcronym);
1425
                        addProjectionParameterAcronymList(count,"lat_ts");
1426
                        addProjectionParameterAcronymList(count,"lon_0");
1427
                        addProjectionParameterAcronymList(count,"k");
1428
                        addProjectionParameterAcronymList(count,"x_0");
1429
                        addProjectionParameterAcronymList(count,"y_0");
1430

    
1431
                        String[] parameterDefaultValue={"90.0"};
1432
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1433
                        addProjectionParameterDefaultValue(count,"90.0");
1434
                        addProjectionParameterDefaultValue(count,"0.0");
1435
                        addProjectionParameterDefaultValue(count,"1.0");
1436
                        addProjectionParameterDefaultValue(count,"0.0");
1437
                        addProjectionParameterDefaultValue(count,"0.0");
1438

    
1439
                        String[] parameterMaxValue={"90.0"};
1440
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1441
                        addProjectionParameterMaxValue(count,"90.0");
1442
                        addProjectionParameterMaxValue(count,"360.0");
1443
                        addProjectionParameterMaxValue(count,"10.0");
1444
                        addProjectionParameterMaxValue(count,"100000000.0");
1445
                        addProjectionParameterMaxValue(count,"100000000.0");
1446

    
1447
                        String[] parameterMinValue={"-90.0"};
1448
                        projectionParameterMinValueList.add(count,parameterMinValue);
1449
                        addProjectionParameterMinValue(count,"-90.0");
1450
                        addProjectionParameterMinValue(count,"-360.0");
1451
                        addProjectionParameterMinValue(count,"0.0");
1452
                        addProjectionParameterMinValue(count,"-100000000.0");
1453
                        addProjectionParameterMinValue(count,"-100000000.0");
1454

    
1455
                        String[] projectionAcronym={"stere"};
1456
                        projectionAcronymList.add(count,projectionAcronym);
1457
                }
1458

    
1459
                count++;
1460
                {// Polyconic
1461
                        String[] projectionName={"Polyconic"};
1462
                        projectionNameList.add(count,projectionName);
1463

    
1464
                        String[] parameterName={"latitude_of_origin"};
1465
                        projectionParameterList.add(count,parameterName);
1466
                        addProjectionParameter(count,"central_meridian");
1467
                        addProjectionParameter(count,"false_easting");
1468
                        addProjectionParameter(count,"false_northing");
1469

    
1470
                        String[] parameterAcronym={"lat_0"};
1471
                        projectionParameterAcronymList.add(count,parameterAcronym);
1472
                        addProjectionParameterAcronymList(count,"lon_0");
1473
                        addProjectionParameterAcronymList(count,"x_0");
1474
                        addProjectionParameterAcronymList(count,"y_0");
1475

    
1476
                        String[] parameterDefaultValue={"0.0"};
1477
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1478
                        addProjectionParameterDefaultValue(count,"0.0");
1479
                        addProjectionParameterDefaultValue(count,"0.0");
1480
                        addProjectionParameterDefaultValue(count,"0.0");
1481

    
1482
                        String[] parameterMaxValue={"90.0"};
1483
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1484
                        addProjectionParameterMaxValue(count,"360.0");
1485
                        addProjectionParameterMaxValue(count,"100000000.0");
1486
                        addProjectionParameterMaxValue(count,"100000000.0");
1487

    
1488
                        String[] parameterMinValue={"-90.0"};
1489
                        projectionParameterMinValueList.add(count,parameterMinValue);
1490
                        addProjectionParameterMinValue(count,"-360.0");
1491
                        addProjectionParameterMinValue(count,"-100000000.0");
1492
                        addProjectionParameterMinValue(count,"-100000000.0");
1493

    
1494
                        String[] projectionAcronym={"poly"};
1495
                        projectionAcronymList.add(count,projectionAcronym);
1496
                }
1497

    
1498
                count++;
1499
                {// Robinson
1500
                        String[] projectionName={"Robinson"};
1501
                        projectionNameList.add(count,projectionName);
1502

    
1503
                        String[] parameterName={"longitude_of_center"};
1504
                        projectionParameterList.add(count,parameterName);
1505
                        addProjectionParameter(count,"false_easting");
1506
                        addProjectionParameter(count,"false_northing");
1507

    
1508
                        String[] parameterAcronym={"lon_0"};
1509
                        projectionParameterAcronymList.add(count,parameterAcronym);
1510
                        addProjectionParameterAcronymList(count,"x_0");
1511
                        addProjectionParameterAcronymList(count,"y_0");
1512

    
1513
                        String[] parameterDefaultValue={"0.0"};
1514
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1515
                        addProjectionParameterDefaultValue(count,"0.0");
1516
                        addProjectionParameterDefaultValue(count,"0.0");
1517

    
1518
                        String[] parameterMaxValue={"360.0"};
1519
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1520
                        addProjectionParameterMaxValue(count,"100000000.0");
1521
                        addProjectionParameterMaxValue(count,"100000000.0");
1522

    
1523
                        String[] parameterMinValue={"-360.0"};
1524
                        projectionParameterMinValueList.add(count,parameterMinValue);
1525
                        addProjectionParameterMinValue(count,"-100000000.0");
1526
                        addProjectionParameterMinValue(count,"-100000000.0");
1527

    
1528
                        String[] projectionAcronym={"robin"};
1529
                        projectionAcronymList.add(count,projectionAcronym);
1530
                }
1531

    
1532
                //         Rosenmund Oblique Mercator - No en EPSG
1533

    
1534
                count++;
1535
                {// Sinusoidal
1536
                        String[] projectionName={"Sinusoidal"};
1537
                        projectionNameList.add(count,projectionName);
1538

    
1539
                        String[] parameterName={"longitude_of_center"};
1540
                        projectionParameterList.add(count,parameterName);
1541
                        addProjectionParameter(count,"false_easting");
1542
                        addProjectionParameter(count,"false_northing");
1543

    
1544
                        String[] parameterAcronym={"lon_0"};
1545
                        projectionParameterAcronymList.add(count,parameterAcronym);
1546
                        addProjectionParameterAcronymList(count,"x_0");
1547
                        addProjectionParameterAcronymList(count,"y_0");
1548

    
1549
                        String[] parameterDefaultValue={"0.0"};
1550
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1551
                        addProjectionParameterDefaultValue(count,"0.0");
1552
                        addProjectionParameterDefaultValue(count,"0.0");
1553

    
1554
                        String[] parameterMaxValue={"360.0"};
1555
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1556
                        addProjectionParameterMaxValue(count,"100000000.0");
1557
                        addProjectionParameterMaxValue(count,"100000000.0");
1558

    
1559
                        String[] parameterMinValue={"-360.0"};
1560
                        projectionParameterMinValueList.add(count,parameterMinValue);
1561
                        addProjectionParameterMinValue(count,"-100000000.0");
1562
                        addProjectionParameterMinValue(count,"-100000000.0");
1563

    
1564
                        String[] projectionAcronym={"sinu"};
1565
                        projectionAcronymList.add(count,projectionAcronym);
1566
                }
1567

    
1568
                count++;
1569
                {// Swiss_Oblique_Cylindrical
1570
                        String[] projectionName={"Swiss_Oblique_Cylindrical"};
1571
                        projectionNameList.add(count,projectionName);
1572
                        addProjectionName(count,"Swiss Oblique Cylindrical");
1573
                        addProjectionName(count,"Swiss Oblique Mercator");
1574
                        addProjectionName(count,"9814");
1575

    
1576
                        String[] parameterName={"latitude_of_origin"};
1577
                        projectionParameterList.add(count,parameterName);
1578
                        addProjectionParameter(count,"central_meridian");
1579
                        addProjectionParameter(count,"false_easting");
1580
                        addProjectionParameter(count,"false_northing");
1581

    
1582
                        String[] parameterAcronym={"lat_0"};
1583
                        projectionParameterAcronymList.add(count,parameterAcronym);
1584
                        addProjectionParameterAcronymList(count,"lon_0");
1585
                        addProjectionParameterAcronymList(count,"x_0");
1586
                        addProjectionParameterAcronymList(count,"y_0");
1587

    
1588
                        String[] parameterDefaultValue={"0.0"};
1589
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1590
                        addProjectionParameterDefaultValue(count,"0.0");
1591
                        addProjectionParameterDefaultValue(count,"0.0");
1592
                        addProjectionParameterDefaultValue(count,"0.0");
1593

    
1594
                        String[] parameterMaxValue={"90.0"};
1595
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1596
                        addProjectionParameterMaxValue(count,"360.0");
1597
                        addProjectionParameterMaxValue(count,"100000000.0");
1598
                        addProjectionParameterMaxValue(count,"100000000.0");
1599

    
1600
                        String[] parameterMinValue={"-90.0"};
1601
                        projectionParameterMinValueList.add(count,parameterMinValue);
1602
                        addProjectionParameterMinValue(count,"-360.0");
1603
                        addProjectionParameterMinValue(count,"-100000000.0");
1604
                        addProjectionParameterMinValue(count,"-100000000.0");
1605

    
1606
                        String[] projectionAcronym={"somerc"};
1607
                        projectionAcronymList.add(count,projectionAcronym);
1608
                }
1609

    
1610
                count++;
1611
                {// Stereographic
1612
                        String[] projectionName={"Stereographic"};
1613
                        projectionNameList.add(count,projectionName);
1614

    
1615
                        String[] parameterName={"latitude_of_origin"};
1616
                        projectionParameterList.add(count,parameterName);
1617
                        addProjectionParameter(count,"central_meridian");
1618
                        addProjectionParameter(count,"scale_factor");
1619
                        addProjectionParameter(count,"false_easting");
1620
                        addProjectionParameter(count,"false_northing");
1621

    
1622
                        String[] parameterAcronym={"lat_0"};
1623
                        projectionParameterAcronymList.add(count,parameterAcronym);
1624
                        addProjectionParameterAcronymList(count,"lon_0");
1625
                        addProjectionParameterAcronymList(count,"k");
1626
                        addProjectionParameterAcronymList(count,"x_0");
1627
                        addProjectionParameterAcronymList(count,"y_0");
1628

    
1629
                        String[] parameterDefaultValue={"0.0"};
1630
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1631
                        addProjectionParameterDefaultValue(count,"0.0");
1632
                        addProjectionParameterDefaultValue(count,"1.0");
1633
                        addProjectionParameterDefaultValue(count,"0.0");
1634
                        addProjectionParameterDefaultValue(count,"0.0");
1635

    
1636
                        String[] parameterMaxValue={"90.0"};
1637
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1638
                        addProjectionParameterMaxValue(count,"360.0");
1639
                        addProjectionParameterMaxValue(count,"10.0");
1640
                        addProjectionParameterMaxValue(count,"100000000.0");
1641
                        addProjectionParameterMaxValue(count,"100000000.0");
1642

    
1643
                        String[] parameterMinValue={"-90.0"};
1644
                        projectionParameterMinValueList.add(count,parameterMinValue);
1645
                        addProjectionParameterMinValue(count,"-360.0");
1646
                        addProjectionParameterMinValue(count,"0.0");
1647
                        addProjectionParameterMinValue(count,"-100000000.0");
1648
                        addProjectionParameterMinValue(count,"-100000000.0");
1649

    
1650
                        String[] projectionAcronym={"stere"};
1651
                        projectionAcronymList.add(count,projectionAcronym);
1652
                }
1653

    
1654
                count++;
1655
                {// Transverse_Mercator
1656
                        String[] projectionName={"Transverse_Mercator"};
1657
                        projectionNameList.add(count,projectionName);
1658
                        addProjectionName(count,"Transverse Mercator");
1659
                        addProjectionName(count,"Gauss-Kruger");
1660
                        addProjectionName(count,"9807");
1661

    
1662
                        String[] parameterName={"latitude_of_origin"};
1663
                        projectionParameterList.add(count,parameterName);
1664
                        addProjectionParameter(count,"central_meridian");
1665
                        addProjectionParameter(count,"scale_factor");
1666
                        addProjectionParameter(count,"false_easting");
1667
                        addProjectionParameter(count,"false_northing");
1668

    
1669
                        String[] parameterAcronym={"lat_0"};
1670
                        projectionParameterAcronymList.add(count,parameterAcronym);
1671
                        addProjectionParameterAcronymList(count,"lon_0");
1672
                        addProjectionParameterAcronymList(count,"k");
1673
                        addProjectionParameterAcronymList(count,"x_0");
1674
                        addProjectionParameterAcronymList(count,"y_0");
1675

    
1676
                        String[] parameterDefaultValue={"0.0"};
1677
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1678
                        addProjectionParameterDefaultValue(count,"0.0");
1679
                        addProjectionParameterDefaultValue(count,"1.0");
1680
                        addProjectionParameterDefaultValue(count,"0.0");
1681
                        addProjectionParameterDefaultValue(count,"0.0");
1682

    
1683
                        String[] parameterMaxValue={"90.0"};
1684
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1685
                        addProjectionParameterMaxValue(count,"360.0");
1686
                        addProjectionParameterMaxValue(count,"10.0");
1687
                        addProjectionParameterMaxValue(count,"100000000.0");
1688
                        addProjectionParameterMaxValue(count,"100000000.0");
1689

    
1690
                        String[] parameterMinValue={"-90.0"};
1691
                        projectionParameterMinValueList.add(count,parameterMinValue);
1692
                        addProjectionParameterMinValue(count,"-360.0");
1693
                        addProjectionParameterMinValue(count,"0.0");
1694
                        addProjectionParameterMinValue(count,"-100000000.0");
1695
                        addProjectionParameterMinValue(count,"-100000000.0");
1696

    
1697
                        String[] projectionAcronym={"tmerc"};
1698
                        projectionAcronymList.add(count,projectionAcronym);
1699
                }
1700

    
1701
                //         Transverse Mercator (Modified Alaska) - No en EPSG
1702

    
1703
                count++;
1704
                {// Transverse_Mercator_South_Orientated
1705
                        String[] projectionName={"Transverse_Mercator_South_Orientated"};
1706
                        projectionNameList.add(count,projectionName);
1707
                        addProjectionName(count,"Transverse Mercator (South Oriented)");
1708
                        addProjectionName(count,"Transverse Mercator (South Orientated)");                        
1709
                        addProjectionName(count,"9808");
1710

    
1711
                        String[] parameterName={"latitude_of_origin"};
1712
                        projectionParameterList.add(count,parameterName);
1713
                        addProjectionParameter(count,"central_meridian");
1714
                        addProjectionParameter(count,"scale_factor");
1715
                        addProjectionParameter(count,"false_easting");
1716
                        addProjectionParameter(count,"false_northing");
1717

    
1718
                        String[] parameterAcronym={"lat_0"};
1719
                        projectionParameterAcronymList.add(count,parameterAcronym);
1720
                        addProjectionParameterAcronymList(count,"lon_0");
1721
                        addProjectionParameterAcronymList(count,"k");
1722
                        addProjectionParameterAcronymList(count,"x_0");
1723
                        addProjectionParameterAcronymList(count,"y_0");
1724

    
1725
                        String[] parameterDefaultValue={"0.0"};
1726
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1727
                        addProjectionParameterDefaultValue(count,"0.0");
1728
                        addProjectionParameterDefaultValue(count,"1.0");
1729
                        addProjectionParameterDefaultValue(count,"0.0");
1730
                        addProjectionParameterDefaultValue(count,"0.0");
1731

    
1732
                        String[] parameterMaxValue={"90.0"};
1733
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1734
                        addProjectionParameterMaxValue(count,"360.0");
1735
                        addProjectionParameterMaxValue(count,"10.0");
1736
                        addProjectionParameterMaxValue(count,"100000000.0");
1737
                        addProjectionParameterMaxValue(count,"100000000.0");
1738

    
1739
                        String[] parameterMinValue={"-90.0"};
1740
                        projectionParameterMinValueList.add(count,parameterMinValue);
1741
                        addProjectionParameterMinValue(count,"-360.0");
1742
                        addProjectionParameterMinValue(count,"0.0");
1743
                        addProjectionParameterMinValue(count,"-100000000.0");
1744
                        addProjectionParameterMinValue(count,"-100000000.0");
1745

    
1746
                        String[] projectionAcronym={"tmerc"};
1747
                        projectionAcronymList.add(count,projectionAcronym);
1748
                }
1749

    
1750
                /*
1751
                count++;
1752
                {// Tunisia_Mining_Grid
1753
                        String[] projectionName={"Tunisia_Mining_Grid"};
1754
                        projectionNameList.add(count,projectionName);
1755
                        addProjectionName(count,"Tunisia Mining Grid");
1756
                        addProjectionName(count,"9816");
1757

1758
                        String[] parameterName={"latitude_of_origin"};
1759
                        projectionParameterList.add(count,parameterName);
1760
                        addProjectionParameter(count,"central_meridian");
1761
                        addProjectionParameter(count,"false_easting");
1762
                        addProjectionParameter(count,"false_northing");
1763
                }
1764
                */
1765

    
1766
                count++;
1767
                {// VanDerGrinten
1768
                        String[] projectionName={"VanDerGrinten"};
1769
                        projectionNameList.add(count,projectionName);
1770
                        addProjectionName(count,"VanDerGrinten I");
1771

    
1772
                        String[] parameterName={"central_meridian"};
1773
                        projectionParameterList.add(count,parameterName);
1774
                        addProjectionParameter(count,"false_easting");
1775
                        addProjectionParameter(count,"false_northing");
1776

    
1777
                        String[] parameterAcronym={"lon_0"};
1778
                        projectionParameterAcronymList.add(count,parameterAcronym);
1779
                        addProjectionParameterAcronymList(count,"x_0");
1780
                        addProjectionParameterAcronymList(count,"y_0");
1781

    
1782
                        String[] parameterDefaultValue={"0.0"};
1783
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1784
                        addProjectionParameterDefaultValue(count,"0.0");
1785
                        addProjectionParameterDefaultValue(count,"0.0");
1786

    
1787
                        String[] parameterMaxValue={"360.0"};
1788
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1789
                        addProjectionParameterMaxValue(count,"100000000.0");
1790
                        addProjectionParameterMaxValue(count,"100000000.0");
1791

    
1792
                        String[] parameterMinValue={"-360.0"};
1793
                        projectionParameterMinValueList.add(count,parameterMinValue);
1794
                        addProjectionParameterMinValue(count,"-100000000.0");
1795
                        addProjectionParameterMinValue(count,"-100000000.0");
1796

    
1797
                        String[] projectionAcronym={"sinu"};
1798
                        projectionAcronymList.add(count,projectionAcronym);
1799
                }
1800
        }
1801
        
1802
        public void addProjectionName(int pos,String projectionName) throws CrsException
1803
        {
1804
                if(pos<0||pos>(projectionNameList.size()-1))
1805
                        throw new CrsException(new Exception());
1806
                String[] projectionNames=(String[]) projectionNameList.get(pos);
1807
                String[] newProjectionNames=new String[projectionNames.length+1];
1808
                for(int i=0;i<projectionNames.length;i++)
1809
                {
1810
                        newProjectionNames[i]=projectionNames[i];
1811
                }
1812
                newProjectionNames[projectionNames.length]=projectionName;
1813
                projectionNameList.remove(pos);
1814
                projectionNameList.add(pos,newProjectionNames);
1815
        }
1816
        
1817
        public void addUnitName(int pos,String unitName) throws CrsException
1818
        {
1819
                if(pos<0||pos>(unitNameList.size()-1))
1820
                        throw new CrsException(new Exception());
1821
                String[] unitNames=(String[]) unitNameList.get(pos);
1822
                String[] newUnitNames=new String[unitNames.length+1];
1823
                for(int i=0;i<unitNames.length;i++)
1824
                {
1825
                        newUnitNames[i]=unitNames[i];
1826
                }
1827
                newUnitNames[unitNames.length]=unitName;
1828
                unitNameList.remove(pos);
1829
                unitNameList.add(pos,newUnitNames);
1830
        }
1831
        
1832
        public void addProjectionParameterName(int pos,String projectionParameterName) throws CrsException
1833
        {
1834
                if(pos<0||pos>(projectionParameterNameList.size()-1))
1835
                        throw new CrsException(new Exception());
1836
                String[] projectionParameterNames=(String[]) projectionParameterNameList.get(pos);
1837
                String[] newProjectionParameterNames=new String[projectionParameterNames.length+1];
1838
                for(int i=0;i<projectionParameterNames.length;i++)
1839
                {
1840
                        newProjectionParameterNames[i]=projectionParameterNames[i];
1841
                }
1842
                newProjectionParameterNames[projectionParameterNames.length]=projectionParameterName;
1843
                projectionParameterNameList.remove(pos);
1844
                projectionParameterNameList.add(pos,newProjectionParameterNames);
1845
        }
1846
        
1847
        public void addProjectionParameter(int pos,String projectionParameter) throws CrsException
1848
        {
1849
                if(pos<0||pos>(projectionParameterList.size()-1))
1850
                        throw new CrsException(new Exception());
1851
                String[] projectionParameters=(String[]) projectionParameterList.get(pos);
1852
                String[] newProjectionParameters=new String[projectionParameters.length+1];
1853
                for(int i=0;i<projectionParameters.length;i++)
1854
                {
1855
                        newProjectionParameters[i]=projectionParameters[i];
1856
                }
1857
                newProjectionParameters[projectionParameters.length]=projectionParameter;
1858
                projectionParameterList.remove(pos);
1859
                projectionParameterList.add(pos,newProjectionParameters);
1860
        }
1861
        
1862
        public void addProjectionParameterDefaultValue(int pos,String projectionParameterDefaultValue) throws CrsException
1863
        {
1864
                if(pos<0||pos>(projectionParameterDefaultValueList.size()-1))
1865
                        throw new CrsException(new Exception());
1866
                String[] projectionParameterDefaultValues=(String[]) projectionParameterDefaultValueList.get(pos);
1867
                String[] newProjectionParameterDefaultValues=new String[projectionParameterDefaultValues.length+1];
1868
                for(int i=0;i<projectionParameterDefaultValues.length;i++)
1869
                {
1870
                        newProjectionParameterDefaultValues[i]=projectionParameterDefaultValues[i];
1871
                }
1872
                newProjectionParameterDefaultValues[projectionParameterDefaultValues.length]=projectionParameterDefaultValue;
1873
                projectionParameterDefaultValueList.remove(pos);
1874
                projectionParameterDefaultValueList.add(pos,newProjectionParameterDefaultValues);
1875
        }
1876
        
1877
        public void addProjectionParameterMaxValue(int pos,String projectionParameterMaxValue) throws CrsException
1878
        {
1879
                if(pos<0||pos>(projectionParameterMaxValueList.size()-1))
1880
                        throw new CrsException(new Exception());
1881
                String[] projectionParameterMaxValues=(String[]) projectionParameterMaxValueList.get(pos);
1882
                String[] newProjectionParameterMaxValues=new String[projectionParameterMaxValues.length+1];
1883
                for(int i=0;i<projectionParameterMaxValues.length;i++)
1884
                {
1885
                        newProjectionParameterMaxValues[i]=projectionParameterMaxValues[i];
1886
                }
1887
                newProjectionParameterMaxValues[projectionParameterMaxValues.length]=projectionParameterMaxValue;
1888
                projectionParameterMaxValueList.remove(pos);
1889
                projectionParameterMaxValueList.add(pos,newProjectionParameterMaxValues);
1890
        }
1891
        
1892
        public void addProjectionParameterMinValue(int pos,String projectionParameterMinValue) throws CrsException
1893
        {
1894
                if(pos<0||pos>(projectionParameterMinValueList.size()-1))
1895
                        throw new CrsException(new Exception());
1896
                String[] projectionParameterMinValues=(String[]) projectionParameterMinValueList.get(pos);
1897
                String[] newProjectionParameterMinValues=new String[projectionParameterMinValues.length+1];
1898
                for(int i=0;i<projectionParameterMinValues.length;i++)
1899
                {
1900
                        newProjectionParameterMinValues[i]=projectionParameterMinValues[i];
1901
                }
1902
                newProjectionParameterMinValues[projectionParameterMinValues.length]=projectionParameterMinValue;
1903
                projectionParameterMinValueList.remove(pos);
1904
                projectionParameterMinValueList.add(pos,newProjectionParameterMinValues);
1905
        }
1906
        
1907
        public void addProjectionParameterAcronymList(int pos,String projectionParameterAcronym) throws CrsException
1908
        {
1909
                if(pos<0||pos>(projectionParameterAcronymList.size()-1))
1910
                        throw new CrsException(new Exception());
1911
                String[] projectionParameterAcronyms=(String[]) projectionParameterAcronymList.get(pos);
1912
                String[] newProjectionParameterAcronyms=new String[projectionParameterAcronyms.length+1];
1913
                for(int i=0;i<projectionParameterAcronyms.length;i++)
1914
                {
1915
                        newProjectionParameterAcronyms[i]=projectionParameterAcronyms[i];
1916
                }
1917
                newProjectionParameterAcronyms[projectionParameterAcronyms.length]=projectionParameterAcronym;
1918
                projectionParameterAcronymList.remove(pos);
1919
                projectionParameterAcronymList.add(pos,newProjectionParameterAcronyms);
1920
        }
1921
        
1922
        public int findProjection(String projectionName)
1923
        {
1924
                for(int i=0;i<projectionNameList.size();i++)
1925
                {
1926
                        String[] projectionNames=(String[]) projectionNameList.get(i);
1927
                        for(int j=0;j<projectionNames.length;j++)
1928
                        {
1929
                                if(projectionNames[j].toLowerCase().replaceAll(" ","").equals(projectionName.toLowerCase().replaceAll(" ","")))
1930
                                        return i;
1931
                        }
1932
                }
1933
                        
1934
                return -1;
1935
        }
1936
        
1937
        public int findProjectionParameter(String parameterName)
1938
        {
1939
                for(int i=0;i<projectionParameterNameList.size();i++)
1940
                {
1941
                        String[] parameterNames=(String[]) projectionParameterNameList.get(i);
1942
                        for(int j=0;j<parameterNames.length;j++)
1943
                        {
1944
                                if(parameterNames[j].toLowerCase().replaceAll(" ","").equals(parameterName.toLowerCase().replaceAll(" ","")))
1945
                                        return i;
1946
                        }
1947
                }
1948
                        
1949
                return -1;
1950
        }
1951
        
1952
        public int findUnit(String unitName)
1953
        {
1954
                for(int i=0;i<unitNameList.size();i++)
1955
                {
1956
                        String[] unitNames=(String[]) unitNameList.get(i);
1957
                        for(int j=0;j<unitNames.length;j++)
1958
                        {
1959
                                if(unitNames[j].toLowerCase().replaceAll(" ","").equals(unitName.toLowerCase().replaceAll(" ","")))
1960
                                        return i;
1961
                        }
1962
                }
1963
                        
1964
                return -1;
1965
        }
1966
        
1967
        public String getProj4UnitName(int pos) throws CrsException 
1968
        {
1969
                if(pos<0||pos>(unitNameList.size()-1))
1970
                                throw new CrsException(new Exception());
1971
                return ((String[]) unitNameList.get(pos))[0];
1972
        }
1973
        
1974
        public String getProj4ProjectionName(int pos) throws CrsException 
1975
        {
1976
                if(pos<0||pos>(projectionNameList.size()-1))
1977
                                throw new CrsException(new Exception());
1978
                return ((String[]) projectionNameList.get(pos))[0];
1979
        }
1980
        
1981
        public String getProj4ProjectionParameterName(int pos) throws CrsException 
1982
        {
1983
                // Ojo decir a Jose Luis que quite los parametros del elipsoide
1984
                if(pos<0||pos>(projectionParameterNameList.size()-1))
1985
                                throw new CrsException(new Exception());
1986
                return ((String[]) projectionParameterNameList.get(pos))[0];
1987
        }
1988
        
1989
        public ArrayList getProj4ProjectionParameters(int pos) throws CrsException 
1990
        {
1991
                
1992
                if(pos<0||pos>(projectionParameterList.size()-1))
1993
                                throw new CrsException(new Exception());
1994
                String[] parameterList=(String[])projectionParameterList.get(pos);
1995
                ArrayList parameters=new ArrayList();
1996
                for(int i=0;i<parameterList.length;i++)
1997
                {
1998
                        String parameterName=parameterList[i];
1999
                        int posParameter=findProjectionParameter(parameterName);
2000
                        if(posParameter==-1)
2001
                        {
2002
                                System.out.println("El parametro = "+parameterName+" no esta en la lista de parametros");
2003
                                throw new CrsException(new Exception());
2004
                        }
2005
                        //String parameterNameProj4=getProj4ProjectionParameterName(posParameter);
2006
                        String parameterNameProj4=parameterName;
2007
                        parameters.add(i,parameterNameProj4);
2008
                }
2009
                return parameters;
2010
        }
2011
        
2012
        public ArrayList getProj4ProjectionParameterDefaultValues(int pos) throws CrsException 
2013
        {
2014
                
2015
                if(pos<0||pos>(projectionParameterDefaultValueList.size()-1))
2016
                                throw new CrsException(new Exception());
2017
                String[] parameterDefaultValueList=(String[])projectionParameterDefaultValueList.get(pos);
2018
                ArrayList parameterDefaultValues=new ArrayList();
2019
                for(int i=0;i<parameterDefaultValueList.length;i++)
2020
                {
2021
                        String parameterDefaultValue=parameterDefaultValueList[i];
2022
                        parameterDefaultValues.add(i,parameterDefaultValue);
2023
                }
2024
                return parameterDefaultValues;
2025
        }
2026
        
2027
        public ArrayList getProj4ProjectionParameterMaxValues(int pos) throws CrsException 
2028
        {
2029
                
2030
                if(pos<0||pos>(projectionParameterMaxValueList.size()-1))
2031
                                throw new CrsException(new Exception());
2032
                String[] parameterMaxValueList=(String[])projectionParameterMaxValueList.get(pos);
2033
                ArrayList parameterMaxValues=new ArrayList();
2034
                for(int i=0;i<parameterMaxValueList.length;i++)
2035
                {
2036
                        String parameterMaxValue=parameterMaxValueList[i];
2037
                        parameterMaxValues.add(i,parameterMaxValue);
2038
                }
2039
                return parameterMaxValues;
2040
        }
2041
        
2042
        public ArrayList getProj4ProjectionParameterMinValues(int pos) throws CrsException 
2043
        {
2044
                
2045
                if(pos<0||pos>(projectionParameterMinValueList.size()-1))
2046
                                throw new CrsException(new Exception());
2047
                String[] parameterMinValueList=(String[])projectionParameterMinValueList.get(pos);
2048
                ArrayList parameterMinValues=new ArrayList();
2049
                for(int i=0;i<parameterMinValueList.length;i++)
2050
                {
2051
                        String parameterMinValue=parameterMinValueList[i];
2052
                        parameterMinValues.add(i,parameterMinValue);
2053
                }
2054
                return parameterMinValues;
2055
        }
2056
        
2057
        public ArrayList getProj4ProjectionParameterAcronyms(int pos) throws CrsException 
2058
        {
2059
                
2060
                if(pos<0||pos>(projectionParameterAcronymList.size()-1))
2061
                                throw new CrsException(new Exception());
2062
                String[] parameterAcronymList=(String[])projectionParameterAcronymList.get(pos);
2063
                ArrayList parameterAcronyms=new ArrayList();
2064
                for(int i=0;i<parameterAcronymList.length;i++)
2065
                {
2066
                        String parameterAcronym=parameterAcronymList[i];
2067
                        parameterAcronyms.add(i,parameterAcronym);
2068
                }
2069
                return parameterAcronyms;
2070
        }
2071

    
2072
        public String exportToProj4(Crs crs) throws CrsException
2073
        {
2074
                String strProj4="+proj=";
2075
                
2076
                String[] primeMeridian=crs.getCrsWkt().getPrimen();
2077
                String primeMeridianName=primeMeridian[0];
2078
                double primeMeridianValue=Double.parseDouble(primeMeridian[1]); // -> hacer el cambio de unidades
2079
                String[] strPrimeMeridianProj4=primeMeridianToProj4(primeMeridianName,primeMeridianValue);
2080
                primeMeridianValue=Double.parseDouble(strPrimeMeridianProj4[1]);
2081
                primeMeridianName=strPrimeMeridianProj4[0];
2082
                String primeMeridianAcronym=strPrimeMeridianProj4[2]; // Puede ser cadena vacia->Analizar
2083

    
2084
                String strProj=crs.getCrsWkt().getProjcs();
2085
                if(strProj.equals(""))
2086
                {
2087
                        //System.out.println("Projection Name = "+"Geodetic");
2088
                        strProj4+="longlat ";
2089
                }
2090
                else
2091
                {
2092
                        //System.out.println("Projection      = "+strProj);
2093
                        String strProjName=crs.getCrsWkt().getProjection();
2094
                        //System.out.println("Projection Name = "+strProjName);
2095
                        int indexProj=findProjection(strProjName);
2096
                        if(indexProj==-1)
2097
                        {
2098
                                System.out.println("La proyeccion "+strProjName+" no figura en la lista Proj4");
2099
                                throw(new CrsException(new Exception()));
2100
                        }
2101
                        String projectionName=(getProj4ProjectionName(indexProj)).trim();
2102
                        ArrayList parameterNames=getProj4ProjectionParameters(indexProj);
2103
                        ArrayList parameterAcronyms=getProj4ProjectionParameterAcronyms(indexProj);
2104
                        ArrayList parameterValues=getProj4ProjectionParameterDefaultValues(indexProj);
2105
                        ArrayList parameterMaxValues=getProj4ProjectionParameterMaxValues(indexProj);
2106
                        ArrayList parameterMinValues=getProj4ProjectionParameterMinValues(indexProj);
2107
                        //System.out.println("Parametros:"+parameterNames);
2108
                        String[] gtParameterValues=crs.getCrsWkt().getParam_value();
2109
                        String[] gtParameterNames=crs.getCrsWkt().getParam_name();
2110
                        for(int i=0;i<parameterNames.size();i++)
2111
                        {
2112
                                boolean existsParameter=false;
2113
                                String parameterValue="";
2114
                                for(int j=0;j<gtParameterNames.length;j++)
2115
                                {
2116
                                        String gtParameterName=gtParameterNames[j].trim();
2117
                                        int posGtParameter=findProjectionParameter(gtParameterName);
2118
                                        gtParameterName=getProj4ProjectionParameterName(posGtParameter);
2119
                                        gtParameterNames[j]=gtParameterName;
2120
                                        //if(((String)parameterNames.get(i)).trim().equals(gtParameterNames[j].trim()))
2121
                                        if(((String)parameterNames.get(i)).trim().equals(gtParameterNames[j].trim()))
2122
                                        {
2123
                                                existsParameter=true;
2124
                                                double maxValue=Double.parseDouble((String)parameterMaxValues.get(i));
2125
                                                double minValue=Double.parseDouble((String)parameterMinValues.get(i));
2126
                                                //parameterValue=Double.parseDouble(gtParameterValues[j]);
2127
                                                parameterValue=gtParameterValues[j]; // Ojo unidades -> analizar
2128
                                                double auxValue=Double.parseDouble(parameterValue);
2129
                                                if((auxValue<minValue)||(auxValue>maxValue))
2130
                                                {
2131
                                                        String strError="El parametro ";
2132
                                                        strError+=gtParameterName;
2133
                                                        strError+=" esta fuera de dominio";
2134
                                                        System.out.println(strError);
2135
                                                        throw new CrsException(new Exception());
2136
                                                }
2137
                                                else if (((String)parameterNames.get(i)).trim().equals("scale_factor") && (auxValue==minValue)) {
2138
                                                        String strError="El parametro ";
2139
                                                        strError+=gtParameterName;
2140
                                                        strError+=" esta fuera de dominio";
2141
                                                        System.out.println(strError);
2142
                                                        throw new CrsException(new Exception());
2143
                                                }
2144
                                                break;
2145
                                        }
2146
                                }
2147
                                if(existsParameter)
2148
                                {
2149
                                        parameterValues.set(i,parameterValue);
2150
                                        //System.out.println("- Parametro["+parameterNames.get(i)+"]="+parameterValue);
2151
                                }
2152
                                /*
2153
                                else
2154
                                {
2155
                                        value=Double.parseDouble((String)parameterDefaultValues.get(i));
2156
                                        System.out.println("El parametro "+parameterNames.get(i)+" no figura en la lista geotools");
2157
                                        throw(new CrsException(new Exception()));
2158
                                }
2159
                                */
2160
                        }
2161
                        String[] projectionAcronym=(String[])projectionAcronymList.get(indexProj);
2162
                        strProj4=strProj4+projectionAcronym[0]+" ";
2163
                        String strExtraProj4="";
2164
                        // Control de casos especiales
2165
                        if(projectionAcronym.equals("merc")) // 1 - Mercator
2166
                        {
2167
                                if(projectionName.equalsIgnoreCase("Mercator_1SP")) // No deberia tener lat_ts
2168
                                {
2169
                                        for(int j=0;j<gtParameterNames.length;j++)
2170
                                        {
2171
                                                String gtParameterName=gtParameterNames[j].trim();
2172
                                                if(gtParameterName.equalsIgnoreCase("latitude_of_origin"))
2173
                                                {
2174
                                                        double gtParameterValue=Double.parseDouble(gtParameterValues[j]);
2175
                                                        if(gtParameterValue!=0.0)
2176
                                                        {
2177
                                                                String strError="La proyecci?n con latitude_origin deber?a ser MERCATOR_2SP";
2178
                                                                System.out.println(strError);
2179
                                                                throw new CrsException(new Exception());
2180
                                                        }
2181
                                                        break;
2182
                                                }
2183
                                        }
2184
                                }
2185
                                if(projectionName.equalsIgnoreCase("Mercator_2SP")) // No deberia tener lat_ts
2186
                                {
2187
                                        for(int j=0;j<gtParameterNames.length;j++)
2188
                                        {
2189
                                                String gtParameterName=gtParameterNames[j].trim();
2190
                                                if(gtParameterName.equalsIgnoreCase("scale_factor"))
2191
                                                {
2192
                                                        double gtParameterValue=Double.parseDouble(gtParameterValues[j]);
2193
                                                        if(gtParameterValue!=0.0)
2194
                                                        {
2195
                                                                String strError="La proyecci?n con scale_factor deber?a ser MERCATOR_1SP";
2196
                                                                System.out.println(strError);
2197
                                                                throw new CrsException(new Exception());
2198
                                                        }
2199
                                                        break;
2200
                                                }
2201
                                        }
2202
                                }
2203
                        }
2204
                        else if(projectionAcronym.equals("stere"))
2205
                        {
2206
                                if(projectionName.equalsIgnoreCase("Polar_Stereographic")) // lat_ts=lat_0={90 o -90)
2207
                                {
2208
                                        boolean isNorthPole=true;
2209
                                        for(int j=0;j<gtParameterNames.length;j++)
2210
                                        {
2211
                                                String gtParameterName=gtParameterNames[j].trim();
2212
                                                if(gtParameterName.equalsIgnoreCase("latitude_of_origin"))
2213
                                                {
2214
                                                        double gtParameterValue=Double.parseDouble(gtParameterValues[j]);
2215
                                                        if(gtParameterValue==90.0) isNorthPole=true;
2216
                                                        else if(gtParameterValue==-90.0)  isNorthPole=false;
2217
                                                        else
2218
                                                        {
2219
                                                                String strError="La proyecci?n estereogr?fica polar debe tener latitud origen 90 o -90";
2220
                                                                System.out.println(strError);
2221
                                                                throw new CrsException(new Exception());
2222
                                                        }
2223
                                                        break;
2224
                                                }
2225
                                        }
2226
                                        String strLatitudeOrigin="90.0";
2227
                                        if(!isNorthPole) strLatitudeOrigin="-90.0";
2228
                                        for(int k=0;k<parameterNames.size();k++)
2229
                                        {
2230
                                                String parameterName=(String)parameterNames.get(k);
2231
                                                if(parameterName.equalsIgnoreCase("latitude_of_origin"))
2232
                                                {
2233
                                                        parameterValues.set(k,strLatitudeOrigin);
2234
                                                }
2235
                                        }
2236
                                }
2237
                        }
2238
                        else if(projectionAcronym.equals("omerc"))
2239
                        {
2240
                                boolean existsLat1=false;
2241
                                boolean existsLat2=false;
2242
                                boolean existsLon1=false;
2243
                                boolean existsLon2=false;
2244
                                // Necesito buscar un caso de ejemplo
2245
                        }
2246
                        else if(projectionAcronym.equals("mill"))
2247
                        {
2248
                                strExtraProj4="+R_A ";
2249
                        }
2250
                        else if(projectionAcronym.equals("vandg"))
2251
                        {
2252
                                strExtraProj4="+R_A ";
2253
                        }
2254
                        
2255
                        for(int i=0;i<parameterNames.size();i++)
2256
                        {
2257
                                String parameterName=((String)parameterNames.get(i)).trim();
2258
                                String parameterAcronym=((String)parameterAcronyms.get(i)).trim();
2259
                                String strParameterValue=((String)parameterValues.get(i)).trim();
2260
                                if(parameterAcronym.equals("lon_0")
2261
                                                ||parameterAcronym.equals("lonc"))
2262
                                {
2263
                                        double parameterValue=Double.parseDouble(strParameterValue);
2264
                                        parameterValue=parameterValue-primeMeridianValue;
2265
                                        strParameterValue=Double.toString(parameterValue);
2266
                                }
2267
                                strProj4=strProj4+"+"+parameterAcronym+"="+strParameterValue+" ";
2268
                        }
2269
                        strProj4+=strExtraProj4;
2270
                        //getProj4ProjectionName();
2271
                }
2272
                
2273
                // ?Que pasa si no hay elipsoide? -> OGR por defecto pone WGS84
2274
                double a=0;
2275
                double inv_f=0;
2276
                String elipName=crs.getCrsWkt().getSpheroid()[0];
2277
                a=Double.parseDouble(crs.getCrsWkt().getSpheroid()[1]);
2278
                inv_f=Double.parseDouble(crs.getCrsWkt().getSpheroid()[2]);
2279
                String strEllipseAcronym=ellipseToProj4(a,inv_f);
2280
                String strEllipse="";
2281
                if(strEllipseAcronym.equals(""))
2282
                {
2283
                        if (!Double.isInfinite(inv_f))
2284
                                strEllipse="+a="+a+" +rf="+inv_f+" ";
2285
                        else
2286
                                strEllipse="+R="+a+" ";
2287
                }
2288
                else
2289
                {
2290
                        strEllipse="+ellps="+strEllipseAcronym+" ";
2291
                }
2292
                strProj4+=strEllipse;
2293
                //System.out.println("Elipsoide["+elipName+"]=("+a+","+inv_f+")");
2294
                strProj4+=primeMeridianAcronym;
2295
                String strWkt=crs.getWKT();
2296
                
2297
                //System.out.println("- Cadena proj4: "+strProj4);
2298
                return strProj4;                
2299
        }
2300
                
2301
        public String exportToProj4(CoordinateReferenceSystem crs) throws CrsException
2302
        {
2303
                String strProj4="+proj=";
2304
                String[] primeMeridian = new String[2];
2305
                String strProj="";
2306
                String strProjName="";
2307
                String[] gtParameterValues=new String[1];
2308
                String[] gtParameterNames= new String[1];
2309
                String[] spheroid = new String[3];
2310
                double a=0;
2311
                double inv_f=0;
2312
                String elipName="";
2313
                if (crs instanceof DefaultProjectedCRS) {
2314
                        DefaultProjectedCRS crsProjected = new DefaultProjectedCRS((ProjectedCRS) crs);
2315
                        primeMeridian = Primem(((DefaultGeodeticDatum) crsProjected.getDatum()).getPrimeMeridian());
2316
                        strProj = crsProjected.getName().toString().split(":")[1];
2317
                        strProjName = getName(crsProjected.getConversionFromBase().getMethod().getName());
2318
                        gtParameterValues = new String[crsProjected.getConversionFromBase().getParameterValues().values().size()];
2319
                        gtParameterNames = new String[crsProjected.getConversionFromBase().getParameterValues().values().size()];
2320
                        String str;
2321
                        for (int i=0; i< crsProjected.getConversionFromBase().getParameterValues().values().size();i++) {
2322
                                str = crsProjected.getConversionFromBase().getParameterValues().values().get(i).toString();
2323
                                Unit u = crsProjected.getConversionFromBase().getParameterValues().parameter(str.split("=")[0]).getUnit();
2324
                                double value = crsProjected.getConversionFromBase().getParameterValues().parameter(str.split("=")[0]).doubleValue();
2325
                                value = convert(value, u.toString());
2326
                                gtParameterNames[i] = str.split("=")[0];
2327
                                gtParameterValues [i] = String.valueOf(value);
2328
                        }
2329
                        spheroid = Spheroid(((DefaultGeodeticDatum) crsProjected.getDatum()).getEllipsoid());
2330
                        elipName=spheroid[0];
2331
                        a=Double.parseDouble(spheroid[1]);
2332
                        inv_f=Double.parseDouble(spheroid[2]);
2333
                }
2334
                else if (crs instanceof DefaultGeographicCRS) {
2335
                        DefaultGeographicCRS crsGeographic = (DefaultGeographicCRS) crs;
2336
                        primeMeridian = Primem(((DefaultGeodeticDatum) crsGeographic.getDatum()).getPrimeMeridian());
2337
                        spheroid = Spheroid(((DefaultGeodeticDatum) crsGeographic.getDatum()).getEllipsoid());
2338
                        elipName=spheroid[0];
2339
                        a=Double.parseDouble(spheroid[1]);
2340
                        inv_f=Double.parseDouble(spheroid[2]);
2341
                }
2342
                
2343
                String primeMeridianName=primeMeridian[0];
2344
                double primeMeridianValue=Double.parseDouble(primeMeridian[1]); // -> hacer el cambio de unidades
2345
                String[] strPrimeMeridianProj4=primeMeridianToProj4(primeMeridianName,primeMeridianValue);
2346
                primeMeridianValue=Double.parseDouble(strPrimeMeridianProj4[1]);
2347
                primeMeridianName=strPrimeMeridianProj4[0];
2348
                String primeMeridianAcronym=strPrimeMeridianProj4[2]; // Puede ser cadena vacia->Analizar
2349

    
2350
                if(strProj.equals(""))
2351
                {
2352
                        //System.out.println("Projection Name = "+"Geodetic");
2353
                        strProj4+="longlat ";
2354
                }
2355
                else
2356
                {
2357
                        int indexProj=findProjection(strProjName);
2358
                        if(indexProj==-1)
2359
                        {
2360
                                System.out.println("La proyeccion "+strProjName+" no figura en la lista Proj4");
2361
                                throw(new CrsException(new Exception()));
2362
                        }
2363
                        String projectionName=(getProj4ProjectionName(indexProj)).trim();
2364
                        ArrayList parameterNames=getProj4ProjectionParameters(indexProj);
2365
                        ArrayList parameterAcronyms=getProj4ProjectionParameterAcronyms(indexProj);
2366
                        ArrayList parameterValues=getProj4ProjectionParameterDefaultValues(indexProj);
2367
                        ArrayList parameterMaxValues=getProj4ProjectionParameterMaxValues(indexProj);
2368
                        ArrayList parameterMinValues=getProj4ProjectionParameterMinValues(indexProj);
2369
                        for(int i=0;i<parameterNames.size();i++)
2370
                        {
2371
                                boolean existsParameter=false;
2372
                                String parameterValue="";
2373
                                for(int j=0;j<gtParameterNames.length;j++)
2374
                                {
2375
                                        String gtParameterName=gtParameterNames[j].trim();
2376
                                        int posGtParameter=findProjectionParameter(gtParameterName);
2377
                                        gtParameterName=getProj4ProjectionParameterName(posGtParameter);
2378
                                        gtParameterNames[j]=gtParameterName;
2379
                                        //if(((String)parameterNames.get(i)).trim().equals(gtParameterNames[j].trim()))
2380
                                        if(((String)parameterNames.get(i)).trim().equals(gtParameterNames[j].trim()))
2381
                                        {
2382
                                                existsParameter=true;
2383
                                                double maxValue=Double.parseDouble((String)parameterMaxValues.get(i));
2384
                                                double minValue=Double.parseDouble((String)parameterMinValues.get(i));
2385
                                                //parameterValue=Double.parseDouble(gtParameterValues[j]);
2386
                                                parameterValue=gtParameterValues[j]; // Ojo unidades -> analizar
2387
                                                double auxValue=Double.parseDouble(parameterValue);
2388
                                                if((auxValue<minValue)||(auxValue>maxValue))
2389
                                                {
2390
                                                        String strError="El parametro ";
2391
                                                        strError+=gtParameterName;
2392
                                                        strError+=" esta fuera de dominio";
2393
                                                        System.out.println(strError);
2394
                                                        throw new CrsException(new Exception());
2395
                                                }
2396
                                                else if (((String)parameterNames.get(i)).trim().equals("scale_factor") && (auxValue==minValue)) {
2397
                                                        String strError="El parametro ";
2398
                                                        strError+=gtParameterName;
2399
                                                        strError+=" esta fuera de dominio";
2400
                                                        System.out.println(strError);
2401
                                                        throw new CrsException(new Exception());
2402
                                                }
2403
                                                break;
2404
                                        }
2405
                                }
2406
                                if(existsParameter)
2407
                                {
2408
                                        parameterValues.set(i,parameterValue);
2409
                                }                        
2410
                        }
2411
                        String[] projectionAcronym=(String[])projectionAcronymList.get(indexProj);
2412
                        strProj4=strProj4+projectionAcronym[0]+" ";
2413
                        String strExtraProj4="";
2414
                        // Control de casos especiales
2415
                        if(projectionAcronym.equals("merc")) // 1 - Mercator
2416
                        {
2417
                                if(projectionName.equalsIgnoreCase("Mercator_1SP")) // No deberia tener lat_ts
2418
                                {
2419
                                        for(int j=0;j<gtParameterNames.length;j++)
2420
                                        {
2421
                                                String gtParameterName=gtParameterNames[j].trim();
2422
                                                if(gtParameterName.equalsIgnoreCase("latitude_of_origin"))
2423
                                                {
2424
                                                        double gtParameterValue=Double.parseDouble(gtParameterValues[j]);
2425
                                                        if(gtParameterValue!=0.0)
2426
                                                        {
2427
                                                                String strError="La proyecci?n con latitude_origin deber?a ser MERCATOR_2SP";
2428
                                                                System.out.println(strError);
2429
                                                                throw new CrsException(new Exception());
2430
                                                        }
2431
                                                        break;
2432
                                                }
2433
                                        }
2434
                                }
2435
                                if(projectionName.equalsIgnoreCase("Mercator_2SP")) // No deberia tener lat_ts
2436
                                {
2437
                                        for(int j=0;j<gtParameterNames.length;j++)
2438
                                        {
2439
                                                String gtParameterName=gtParameterNames[j].trim();
2440
                                                if(gtParameterName.equalsIgnoreCase("scale_factor"))
2441
                                                {
2442
                                                        double gtParameterValue=Double.parseDouble(gtParameterValues[j]);
2443
                                                        if(gtParameterValue!=0.0)
2444
                                                        {
2445
                                                                String strError="La proyecci?n con scale_factor deber?a ser MERCATOR_1SP";
2446
                                                                System.out.println(strError);
2447
                                                                throw new CrsException(new Exception());
2448
                                                        }
2449
                                                        break;
2450
                                                }
2451
                                        }
2452
                                }
2453
                        }
2454
                        else if(projectionAcronym.equals("stere"))
2455
                        {
2456
                                if(projectionName.equalsIgnoreCase("Polar_Stereographic")) // lat_ts=lat_0={90 o -90)
2457
                                {
2458
                                        boolean isNorthPole=true;
2459
                                        for(int j=0;j<gtParameterNames.length;j++)
2460
                                        {
2461
                                                String gtParameterName=gtParameterNames[j].trim();
2462
                                                if(gtParameterName.equalsIgnoreCase("latitude_of_origin"))
2463
                                                {
2464
                                                        double gtParameterValue=Double.parseDouble(gtParameterValues[j]);
2465
                                                        if(gtParameterValue==90.0) isNorthPole=true;
2466
                                                        else if(gtParameterValue==-90.0)  isNorthPole=false;
2467
                                                        else
2468
                                                        {
2469
                                                                String strError="La proyecci?n estereogr?fica polar debe tener latitud origen 90 o -90";
2470
                                                                System.out.println(strError);
2471
                                                                throw new CrsException(new Exception());
2472
                                                        }
2473
                                                        break;
2474
                                                }
2475
                                        }
2476
                                        String strLatitudeOrigin="90.0";
2477
                                        if(!isNorthPole) strLatitudeOrigin="-90.0";
2478
                                        for(int k=0;k<parameterNames.size();k++)
2479
                                        {
2480
                                                String parameterName=(String)parameterNames.get(k);
2481
                                                if(parameterName.equalsIgnoreCase("latitude_of_origin"))
2482
                                                {
2483
                                                        parameterValues.set(k,strLatitudeOrigin);
2484
                                                }
2485
                                        }
2486
                                }
2487
                        }
2488
                        else if(projectionAcronym.equals("omerc"))
2489
                        {
2490
                                boolean existsLat1=false;
2491
                                boolean existsLat2=false;
2492
                                boolean existsLon1=false;
2493
                                boolean existsLon2=false;
2494
                                // Necesito buscar un caso de ejemplo
2495
                        }
2496
                        else if(projectionAcronym.equals("mill"))
2497
                        {
2498
                                strExtraProj4="+R_A ";
2499
                        }
2500
                        else if(projectionAcronym.equals("vandg"))
2501
                        {
2502
                                strExtraProj4="+R_A ";
2503
                        }
2504
                        
2505
                        for(int i=0;i<parameterNames.size();i++)
2506
                        {
2507
                                String parameterName=((String)parameterNames.get(i)).trim();
2508
                                String parameterAcronym=((String)parameterAcronyms.get(i)).trim();
2509
                                String strParameterValue=((String)parameterValues.get(i)).trim();
2510
                                if(parameterAcronym.equals("lon_0")
2511
                                                ||parameterAcronym.equals("lonc"))
2512
                                {
2513
                                        double parameterValue=Double.parseDouble(strParameterValue);
2514
                                        parameterValue=parameterValue-primeMeridianValue;
2515
                                        strParameterValue=Double.toString(parameterValue);
2516
                                }
2517
                                strProj4=strProj4+"+"+parameterAcronym+"="+strParameterValue+" ";
2518
                        }
2519
                        strProj4+=strExtraProj4;
2520
                        //getProj4ProjectionName();
2521
                }
2522
                
2523
                // ?Que pasa si no hay elipsoide? -> OGR por defecto pone WGS84
2524
                String strEllipseAcronym=ellipseToProj4(a,inv_f);
2525
                String strEllipse="";
2526
                if(strEllipseAcronym.equals(""))
2527
                {
2528
                        if (!Double.isInfinite(inv_f))
2529
                                strEllipse="+a="+a+" +rf="+inv_f+" ";
2530
                        else
2531
                                strEllipse="+R="+a+" ";
2532
                }
2533
                else
2534
                {
2535
                        strEllipse="+ellps="+strEllipseAcronym+" ";
2536
                }
2537
                strProj4+=strEllipse;
2538
                //System.out.println("Elipsoide["+elipName+"]=("+a+","+inv_f+")");
2539
                strProj4+=primeMeridianAcronym;
2540
                String strWkt=crs.toWKT();
2541
                
2542
                //System.out.println("- Cadena proj4: "+strProj4);
2543
                return strProj4;                
2544
        }
2545

    
2546
        private String[] primeMeridianToProj4(String pmName,double pmValue) throws CrsException
2547
        {
2548
            String[] primeMeridian=new String[3];
2549
                String pszPM="";
2550
                String acronym="";
2551
            double dfFromGreenwich = 0.0;
2552
            double tolerance=0.002/3600.0;
2553
            int    nPMCode = -1;
2554

    
2555
            dfFromGreenwich=-(9+7/60.0+54.862/3600.0);
2556
        if(pmName.equalsIgnoreCase("lisbon")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2557
        {
2558
            pszPM="lisbon";
2559
            nPMCode = 8902;
2560
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2561
            {
2562
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2563
                                System.out.println(strError);
2564
                                //throw new CrsException(new Exception());
2565
            }
2566
            pmValue=dfFromGreenwich;
2567
            acronym="+pm="+pszPM+" ";
2568
        }
2569
        
2570
        dfFromGreenwich=(2+20/60.0+14.025/3600.0); 
2571
        if(pmName.equalsIgnoreCase("paris")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2572
        {
2573
            pszPM="paris";
2574
            nPMCode = 8903;
2575
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2576
            {
2577
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2578
                                System.out.println(strError);
2579
                                //throw new CrsException(new Exception());
2580
            }
2581
            pmValue=dfFromGreenwich;
2582
            acronym="+pm="+pszPM+" ";
2583
        }
2584
        
2585
        dfFromGreenwich=-(74+4/60.0+51.3/3600.0);
2586
        if(pmName.equalsIgnoreCase("bogota")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2587
        {
2588
            pszPM="bogota";
2589
            nPMCode = 8904;
2590
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2591
            {
2592
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2593
                                System.out.println(strError);
2594
                                //throw new CrsException(new Exception());
2595
            }
2596
            pmValue=dfFromGreenwich;
2597
            acronym="+pm="+pszPM+" ";
2598
        }
2599
        
2600
        dfFromGreenwich=-(3+41/60.0+16.58/3600.0);  // mal en ogr los segundos pone 16.48
2601
        if(pmName.equalsIgnoreCase("madrid")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2602
        {
2603
            pszPM="madrid";
2604
            nPMCode = 8905;
2605
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2606
            {
2607
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2608
                                System.out.println(strError);
2609
                                //throw new CrsException(new Exception());
2610
            }
2611
            pmValue=dfFromGreenwich;
2612
            acronym="+pm="+pszPM+" ";
2613
        }
2614
        
2615
        dfFromGreenwich=(12+27/60.0+8.4/3600.0);
2616
        if(pmName.equalsIgnoreCase("rome")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2617
        {
2618
            pszPM="rome";
2619
            nPMCode = 8906;
2620
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2621
            {
2622
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2623
                                System.out.println(strError);
2624
                                //throw new CrsException(new Exception());
2625
            }
2626
            pmValue=dfFromGreenwich;
2627
            acronym="+pm="+pszPM+" ";
2628
        }
2629
        
2630
        dfFromGreenwich=(7+26/60.0+22.5/3600.0);
2631
        if(pmName.equalsIgnoreCase("bern")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2632
        {
2633
            pszPM="bern";
2634
            nPMCode = 8907;
2635
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2636
            {
2637
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2638
                                System.out.println(strError);
2639
                                //throw new CrsException(new Exception());
2640
            }
2641
            pmValue=dfFromGreenwich;
2642
            acronym="+pm="+pszPM+" ";
2643
        }
2644
        
2645
        dfFromGreenwich=(106+48/60.0+27.79/3600.0);
2646
        if(pmName.equalsIgnoreCase("jakarta")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2647
        {
2648
            pszPM="jakarta";
2649
            nPMCode = 8908;
2650
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2651
            {
2652
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2653
                                System.out.println(strError);
2654
                                //throw new CrsException(new Exception());
2655
            }
2656
            pmValue=dfFromGreenwich;
2657
            acronym="+pm="+pszPM+" ";
2658
        }
2659
        
2660
        dfFromGreenwich=-(17+40/60.0+0.0/3600.0);
2661
        if(pmName.equalsIgnoreCase("ferro")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2662
        {
2663
            pszPM="ferro";
2664
            nPMCode = 8909;
2665
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2666
            {
2667
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2668
                                System.out.println(strError);
2669
                                //throw new CrsException(new Exception());
2670
            }
2671
            pmValue=dfFromGreenwich;
2672
            acronym="+pm="+pszPM+" ";
2673
        }
2674
        
2675
        dfFromGreenwich=(4+22/60.0+4.71/3600.0);
2676
        if(pmName.equalsIgnoreCase("brussels")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2677
        {
2678
            pszPM="brussels";
2679
            nPMCode = 8910;
2680
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2681
            {
2682
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2683
                                System.out.println(strError);
2684
                                //throw new CrsException(new Exception());
2685
            }
2686
            pmValue=dfFromGreenwich;
2687
            acronym="+pm="+pszPM+" ";
2688
        }
2689
        
2690
        dfFromGreenwich=(18+3/60.0+29.8/3600.0);
2691
        if(pmName.equalsIgnoreCase("stockholm")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2692
        {
2693
            pszPM="stockholm";
2694
            nPMCode = 8911;
2695
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2696
            {
2697
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2698
                                System.out.println(strError);
2699
                                //throw new CrsException(new Exception());
2700
            }
2701
            pmValue=dfFromGreenwich;
2702
            acronym="+pm="+pszPM+" ";
2703
        }
2704
        
2705
        dfFromGreenwich=(23+42/60.0+58.815/3600.0);
2706
        if(pmName.equalsIgnoreCase("athens")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2707
        {
2708
            pszPM="athens";
2709
            nPMCode = 8912;
2710
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2711
            {
2712
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2713
                                System.out.println(strError);
2714
                                //throw new CrsException(new Exception());
2715
            }
2716
            pmValue=dfFromGreenwich;
2717
            acronym="+pm="+pszPM+" ";
2718
        }
2719
        
2720
        dfFromGreenwich=(10+43/60.0+22.5/3600.0);
2721
        if(pmName.equalsIgnoreCase("oslo")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2722
        {
2723
            pszPM="oslo";
2724
            nPMCode = 8913;
2725
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2726
            {
2727
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2728
                                System.out.println(strError);
2729
                                //throw new CrsException(new Exception());
2730
            }
2731
            pmValue=dfFromGreenwich;
2732
            acronym="+pm="+pszPM+" ";
2733
        }
2734
        
2735
        dfFromGreenwich=(0.0);
2736
        if(pmName.equalsIgnoreCase("Greenwich")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
2737
        {
2738
            pszPM="Greenwich";
2739
            nPMCode = 0;
2740
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
2741
            {
2742
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
2743
                                System.out.println(strError);
2744
                                //throw new CrsException(new Exception());
2745
            }
2746
            pmValue=dfFromGreenwich;
2747
        }
2748
        primeMeridian[0]=pszPM;
2749
        primeMeridian[1]=Double.toString(pmValue);
2750
        primeMeridian[2]=acronym;
2751
                return primeMeridian;
2752
        }
2753

    
2754
        private String ellipseToProj4(double dfSemiMajor, double dfInvFlattening)
2755
        {
2756
                double yo=Math.abs(4.5);
2757
                String pszPROJ4Ellipse="";
2758
            if( Math.abs(dfSemiMajor-6378249.145) < 0.01
2759
                && Math.abs(dfInvFlattening-293.465) < 0.0001 )
2760
            {
2761
                pszPROJ4Ellipse = "clrk80";     /* Clark 1880 */
2762
            }
2763
            else if( Math.abs(dfSemiMajor-6378245.0) < 0.01
2764
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
2765
            {
2766
                pszPROJ4Ellipse = "krass";      /* Krassovsky */
2767
            }
2768
            else if( Math.abs(dfSemiMajor-6378388.0) < 0.01
2769
                     && Math.abs(dfInvFlattening-297.0) < 0.0001 )
2770
            {
2771
                pszPROJ4Ellipse = "intl";       /* International 1924 */
2772
            }
2773
            else if( Math.abs(dfSemiMajor-6378160.0) < 0.01
2774
                     && Math.abs(dfInvFlattening-298.25) < 0.0001 )
2775
            {
2776
                pszPROJ4Ellipse = "aust_SA";    /* Australian */
2777
            }
2778
            else if( Math.abs(dfSemiMajor-6377397.155) < 0.01
2779
                     && Math.abs(dfInvFlattening-299.1528128) < 0.0001 )
2780
            {
2781
                pszPROJ4Ellipse = "bessel";     /* Bessel 1841 */
2782
            }
2783
            else if( Math.abs(dfSemiMajor-6377483.865) < 0.01
2784
                     && Math.abs(dfInvFlattening-299.1528128) < 0.0001 )
2785
            {
2786
                pszPROJ4Ellipse = "bess_nam";   /* Bessel 1841 (Namibia / Schwarzeck)*/
2787
            }
2788
            else if( Math.abs(dfSemiMajor-6378160.0) < 0.01
2789
                     && Math.abs(dfInvFlattening-298.247167427) < 0.0001 )
2790
            {
2791
                pszPROJ4Ellipse = "GRS67";      /* GRS 1967 */
2792
            }
2793
            else if( Math.abs(dfSemiMajor-6378137) < 0.01
2794
                     && Math.abs(dfInvFlattening-298.257222101) < 0.000001 )
2795
            {
2796
                pszPROJ4Ellipse = "GRS80";      /* GRS 1980 */
2797
            }
2798
            else if( Math.abs(dfSemiMajor-6378206.4) < 0.01
2799
                     && Math.abs(dfInvFlattening-294.9786982) < 0.0001 )
2800
            {
2801
                pszPROJ4Ellipse = "clrk66";     /* Clarke 1866 */
2802
            }
2803
            else if( Math.abs(dfSemiMajor-6378206.4) < 0.01
2804
                     && Math.abs(dfInvFlattening-294.9786982) < 0.0001 )
2805
            {
2806
                pszPROJ4Ellipse = "mod_airy";   /* Modified Airy */
2807
            }
2808
            else if( Math.abs(dfSemiMajor-6377563.396) < 0.01
2809
                     && Math.abs(dfInvFlattening-299.3249646) < 0.0001 )
2810
            {
2811
                pszPROJ4Ellipse = "airy";       /* Modified Airy */
2812
            }
2813
            else if( Math.abs(dfSemiMajor-6378200) < 0.01
2814
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
2815
            {
2816
                pszPROJ4Ellipse = "helmert";    /* Helmert 1906 */
2817
            }
2818
            else if( Math.abs(dfSemiMajor-6378155) < 0.01
2819
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
2820
            {
2821
                pszPROJ4Ellipse = "fschr60m";   /* Modified Fischer 1960 */
2822
            }
2823
            else if( Math.abs(dfSemiMajor-6377298.556) < 0.01
2824
                     && Math.abs(dfInvFlattening-300.8017) < 0.0001 )
2825
            {
2826
                pszPROJ4Ellipse = "evrstSS";    /* Everest (Sabah & Sarawak) */
2827
            }
2828
            else if( Math.abs(dfSemiMajor-6378165.0) < 0.01
2829
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
2830
            {
2831
                pszPROJ4Ellipse = "WGS60";      
2832
            }
2833
            else if( Math.abs(dfSemiMajor-6378145.0) < 0.01
2834
                     && Math.abs(dfInvFlattening-298.25) < 0.0001 )
2835
            {
2836
                pszPROJ4Ellipse = "WGS66";      
2837
            }
2838
            else if( Math.abs(dfSemiMajor-6378135.0) < 0.01
2839
                     && Math.abs(dfInvFlattening-298.26) < 0.0001 )
2840
            {
2841
                pszPROJ4Ellipse = "WGS72";      
2842
            }
2843
            else if( Math.abs(dfSemiMajor-6378137.0) < 0.01
2844
                     && Math.abs(dfInvFlattening-298.257223563) < 0.000001 )
2845
            {
2846
                pszPROJ4Ellipse = "WGS84";
2847
            }
2848
            /*
2849
            else if( EQUAL(pszDatum,"North_American_Datum_1927") )
2850
            {
2851
//                pszPROJ4Ellipse = "clrk66:+datum=nad27"; // NAD 27 
2852
                pszPROJ4Ellipse = "clrk66";
2853
            }
2854
            else if( EQUAL(pszDatum,"North_American_Datum_1983") )
2855
            {
2856
//                pszPROJ4Ellipse = "GRS80:+datum=nad83";       // NAD 83 
2857
                pszPROJ4Ellipse = "GRS80";
2858
            }
2859
            */
2860
            return pszPROJ4Ellipse;
2861
        }
2862

    
2863
        // Casos especiales
2864
        // - MERCATOR_1SP
2865
        // - HOTINE
2866
        // - MILLER
2867
        // - Polar_Stereographic
2868
        // - Polar_Stereographic
2869
        // - VanDerGrinten
2870
        // - Transverse Mercator
2871
        // - Cuando el meridiano origen no es 0 se pone pm=madrid y lon_0=
2872
        // +datum
2873
        
2874
        // Funciones privadas necesarias para el proceso
2875
        
2876
        private String getName(Identifier name) {
2877
                String[] correctName = name.toString().split(":");
2878
                if (correctName.length<2) 
2879
                        return correctName[0];
2880
                
2881
                else
2882
                        return correctName[1];
2883
        }
2884
        
2885
        private String[] Spheroid (Ellipsoid ellips) {
2886
                String[] spheroid = new String[3];
2887
                Unit u = ellips.getAxisUnit();
2888
                double semi_major = convert( ellips.getSemiMajorAxis(), u.toString());
2889
                double inv_f = convert( ellips.getInverseFlattening(), u.toString());
2890
                String[] val =        ellips.getName().toString().split(":");
2891
                if (val.length<2)
2892
                        spheroid[0] = ellips.getName().toString().split(":")[0];
2893
                else
2894
                        spheroid[0] = ellips.getName().toString().split(":")[1];
2895
                spheroid[1] = String.valueOf(semi_major);
2896
                spheroid[2] = String.valueOf(inv_f);
2897
                return spheroid;
2898
        }
2899
        
2900
        private String[] Primem (PrimeMeridian prim) {
2901
                String[] primem = new String[2];
2902
                DefaultPrimeMeridian pm = new DefaultPrimeMeridian(prim);
2903
                Unit u = pm.getAngularUnit();
2904
                double value = convert( pm.getGreenwichLongitude(), u.toString());
2905
                String[] val = pm.getName().toString().split(":");
2906
                if (val.length<2)
2907
                        primem[0] = pm.getName().toString().split(":")[0];
2908
                else
2909
                        primem[0] = pm.getName().toString().split(":")[1];
2910
                primem[1] = String.valueOf(value);
2911
                return primem;
2912
        }
2913
        
2914
        public double convert(double value, String measure) throws ConversionException {
2915
                if (measure.equals("D.MS")) {                
2916
                        value *= this.divider;
2917
                int deg,min;
2918
                deg = (int) (value/10000); value -= 10000*deg;
2919
                min = (int) (value/  100); value -=   100*min;
2920
                if (min<=-60 || min>=60) {  // Accepts NaN
2921
                    if (Math.abs(Math.abs(min) - 100) <= EPS) {
2922
                        if (min >= 0) deg++; else deg--;
2923
                        min = 0;
2924
                    } else {
2925
                        throw new ConversionException("Invalid minutes: "+min);
2926
                    }
2927
                }
2928
                if (value<=-60 || value>=60) { // Accepts NaN
2929
                    if (Math.abs(Math.abs(value) - 100) <= EPS) {
2930
                        if (value >= 0) min++; else min--;
2931
                        value = 0;
2932
                    } else {
2933
                        throw new ConversionException("Invalid secondes: "+value);
2934
                    }
2935
                }
2936
                value = ((value/60) + min)/60 + deg;
2937
                return value;
2938
                }
2939
                if (measure.equals("grad") || measure.equals("grade")) 
2940
                        return ((value * 180.0) / 200.0);                        
2941
                if (measure.equals(""+(char)176)) 
2942
                        return value;                
2943
                if (measure.equals("DMS") ) 
2944
                        return value;                
2945
                if (measure.equals("m")) 
2946
                        return value;        
2947
                if (measure.equals("")) 
2948
                        return value;
2949
                
2950
                throw new ConversionException("Conversion no contemplada: "+measure);
2951
    }
2952
}