Statistics
| Revision:

root / org.gvsig.projection.jcrs / trunk / org.gvsig.projection.jcrs / org.gvsig.projection.jcrs.lib / src / main / java / org / gvsig / crs / Proj4.java @ 263

History | View | Annotate | Download (180 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
34
 *   Campus Universitario s/n
35
 *   02071 Alabacete
36
 *   Spain
37
 *
38
 *   +34 967 599 200
39
 */
40

    
41
package org.gvsig.crs;
42

    
43
import java.util.ArrayList;
44
import java.util.Iterator;
45

    
46
import javax.units.ConversionException;
47
import javax.units.Unit;
48

    
49
import org.geotools.referencing.crs.DefaultGeographicCRS;
50
import org.geotools.referencing.crs.DefaultProjectedCRS;
51
import org.geotools.referencing.datum.DefaultGeodeticDatum;
52
import org.geotools.referencing.datum.DefaultPrimeMeridian;
53
import org.opengis.metadata.Identifier;
54
import org.opengis.referencing.crs.CoordinateReferenceSystem;
55
import org.opengis.referencing.datum.Ellipsoid;
56
import org.opengis.referencing.datum.PrimeMeridian;
57

    
58

    
59
/**
60
 * Clase para manejar la libreria proj4
61
 * 
62
 * @author        David Hern?ndez L?pez (david.hernandez@uclm.es)
63
 * @author  Jos? Luis G?mez Mart?nez (JoseLuis.Gomez@uclm.es)
64
 *
65
 */
66

    
67
public class Proj4 {        
68

    
69
        private ArrayList projectionNameList= new ArrayList();
70
        private ArrayList unitNameList= new ArrayList();
71
        private ArrayList projectionParameterNameList= new ArrayList();
72
        private ArrayList projectionParameterList= new ArrayList();
73
        private ArrayList projectionParameterDefaultValueList= new ArrayList();
74
        private ArrayList projectionParameterMaxValueList= new ArrayList();
75
        private ArrayList projectionParameterMinValueList= new ArrayList();
76
        private ArrayList projectionParameterUnitList= new ArrayList();
77
        private ArrayList projectionAcronymList= new ArrayList();
78
        private ArrayList projectionParameterAcronymList= new ArrayList();
79
        
80
        int divider=10000;
81
        private static double angularTolerance=1.0/3600.0;
82
        
83
        /**
84
     * Small tolerance factor for rounding errors.
85
     */
86
    private static final double EPS = 1E-8;
87
        
88
        public Proj4() throws CrsException
89
        {
90
                //defineProjectionNames();
91
                //defineProjectionParameterNameList();
92
                //defineProjectionParameterUnitList();
93
                defineUnitNameList();
94
                defineProjectionParameterList();
95
                defineProjections();
96
        }
97
        
98
        private void defineUnitNameList() throws CrsException
99
        {
100
                int count=0;
101
                
102
                {
103
                        String[] unitName={"Angular"};
104
                        unitNameList.add(count,unitName);
105
                }
106
                
107
                count++;
108
                {
109
                        String[] unitName={"Linear"};
110
                        unitNameList.add(count,unitName);
111
                }
112
                
113
                count++;
114
                {
115
                        String[] unitName={"Unitless"};
116
                        unitNameList.add(count,unitName);
117
                        addUnitName(count,"Adimensional");
118
                }
119
                
120
        }
121
        
122
        private void defineProjectionParameterList() throws CrsException
123
        {
124
                int count=0;
125

    
126
                { // azimuth
127
                        String[] parameterName={"azimuth"};
128
                        projectionParameterNameList.add(count,parameterName);
129
                        addProjectionParameterName(count,"Azimuth of initial line");                
130
                        addProjectionParameterName(count,"AzimuthAngle");                
131

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

    
136
                count++;
137
                { // central_meridian
138
                        String[] parameterName={"central_meridian"};
139
                        projectionParameterNameList.add(count,parameterName);
140
                        addProjectionParameterName(count,"Longitude of natural origin");                
141
                        addProjectionParameterName(count,"NatOriginLong");                
142
                        addProjectionParameterName(count,"Longitude of projection center");
143
                        addProjectionParameterName(count,"Longitude_of_center");
144
                        addProjectionParameterName(count,"ProjCenterLong");
145
                        addProjectionParameterName(count,"Longitude of false origin");                
146
                        addProjectionParameterName(count,"FalseOriginLong");                
147
                        addProjectionParameterName(count,"StraightVertPoleLong");                
148
                        
149
                        String[] parameterUnit={"Angular"};
150
                        projectionParameterUnitList.add(count,parameterUnit);
151
                }
152
                
153
                count++;
154
                { // false_easting
155
                        String[] parameterName={"false_easting"};
156
                        projectionParameterNameList.add(count,parameterName);
157
                        addProjectionParameterName(count,"Easting at projection centre");                
158
                        addProjectionParameterName(count,"Easting of false origin");                
159
                        addProjectionParameterName(count,"FalseEasting");                
160
                        addProjectionParameterName(count,"False_Easting");                
161
                        addProjectionParameterName(count,"FalseOriginEasting");                
162

    
163
                        String[] parameterUnit={"Linear"};
164
                        projectionParameterUnitList.add(count,parameterUnit);
165
                }
166
                
167
                count++;
168
                { // false_northing
169
                        String[] parameterName={"false_northing"};
170
                        projectionParameterNameList.add(count,parameterName);
171
                        addProjectionParameterName(count,"Northing at projection centre");                
172
                        addProjectionParameterName(count,"Northing of false origin");                
173
                        addProjectionParameterName(count,"FalseNorthing");                
174
                        addProjectionParameterName(count,"False_Northing");                
175
                        addProjectionParameterName(count,"FalseOriginNorthing");                
176

    
177
                        String[] parameterUnit={"Linear"};
178
                        projectionParameterUnitList.add(count,parameterUnit);
179
                }
180

    
181
                count++;
182
                { // latitude_of_center
183
                        String[] parameterName={"latitude_of_center"};
184
                        projectionParameterNameList.add(count,parameterName);
185
                        addProjectionParameterName(count,"CenterLat");                
186
                        addProjectionParameterName(count,"FalseOriginLat");
187
                        addProjectionParameterName(count,"Latitude of false origin");                
188
                        addProjectionParameterName(count,"Latitude_of_origin");                
189
                        addProjectionParameterName(count,"Latitude of natural origin");
190
                        addProjectionParameterName(count,"Latitude of projection center");
191
                        addProjectionParameterName(count,"Latitude of projection centre");
192
                        addProjectionParameterName(count,"NatOriginLat");                
193
                        addProjectionParameterName(count,"ProjCenterLat");
194
                        addProjectionParameterName(count,"Spherical_latitude_of_origin");
195
                        addProjectionParameterName(count,"Central_Parallel");
196

    
197
                        String[] parameterUnit={"Angular"};
198
                        projectionParameterUnitList.add(count,parameterUnit);
199
                }
200

    
201
                count++;
202
                { // Latitude_Of_1st_Point
203
                        String[] parameterName={"Latitude_Of_1st_Point"};
204
                        projectionParameterNameList.add(count,parameterName);
205
                        //addProjectionParameterName(count,"CenterLat");                
206
                        
207
                        String[] parameterUnit={"Angular"};
208
                        projectionParameterUnitList.add(count,parameterUnit);
209
                }
210

    
211
                count++;
212
                { // Latitude_Of_2nd_Point
213
                        String[] parameterName={"Latitude_Of_2nd_Point"};
214
                        projectionParameterNameList.add(count,parameterName);
215
                        //addProjectionParameterName(count,"CenterLat");                
216
                        
217
                        String[] parameterUnit={"Angular"};
218
                        projectionParameterUnitList.add(count,parameterUnit);
219
                }
220

    
221
                count++;
222
                { // latitude_of_origin
223
                        String[] parameterName={"latitude_of_origin"};
224
                        projectionParameterNameList.add(count,parameterName);
225
                        addProjectionParameterName(count,"CenterLat");                
226
                        addProjectionParameterName(count,"FalseOriginLat");
227
                        addProjectionParameterName(count,"Latitude of center");                
228
                        addProjectionParameterName(count,"Latitude of false origin");                
229
                        addProjectionParameterName(count,"Latitude of natural origin");
230
                        addProjectionParameterName(count,"Latitude of projection center");
231
                        addProjectionParameterName(count,"Latitude of projection centre");
232
                        addProjectionParameterName(count,"NatOriginLat");                
233
                        addProjectionParameterName(count,"ProjCenterLat");
234
                        
235
                        String[] parameterUnit={"Angular"};
236
                        projectionParameterUnitList.add(count,parameterUnit);
237
                }
238

    
239
                count++;
240
                { // latitude_of_origin
241
                        String[] parameterName={"latitude_of_standard_parallel"};
242
                        projectionParameterNameList.add(count,parameterName);
243
                        addProjectionParameterName(count,"CenterLat");                
244
                        addProjectionParameterName(count,"FalseOriginLat");
245
                        addProjectionParameterName(count,"Latitude of center");                
246
                        addProjectionParameterName(count,"Latitude of false origin");                
247
                        addProjectionParameterName(count,"Latitude of natural origin");
248
                        addProjectionParameterName(count,"Latitude of projection center");
249
                        addProjectionParameterName(count,"Latitude of projection centre");
250
                        addProjectionParameterName(count,"Latitude_of_standard_parallel");                
251
                        addProjectionParameterName(count,"NatOriginLat");                
252
                        addProjectionParameterName(count,"ProjCenterLat");
253
                        
254
                        String[] parameterUnit={"Angular"};
255
                        projectionParameterUnitList.add(count,parameterUnit);
256
                }
257

    
258
                count++;
259
                { // longitude_of_center
260
                        String[] parameterName={"longitude_of_center"};
261
                        projectionParameterNameList.add(count,parameterName);
262
                        addProjectionParameterName(count,"Longitude of origin");                
263
                        addProjectionParameterName(count,"Longitude of false origin");                
264
                        addProjectionParameterName(count,"NatOriginLong");                
265
                        addProjectionParameterName(count,"central_meridian");                
266
                        addProjectionParameterName(count,"CenterLong");                
267
                        addProjectionParameterName(count,"Spherical_latitude_of_origin");
268

    
269
                        String[] parameterUnit={"Angular"};
270
                        projectionParameterUnitList.add(count,parameterUnit);
271
                }
272

    
273
                count++;
274
                { // Longitude_Of_1st_Point
275
                        String[] parameterName={"Longitude_Of_1st_Point"};
276
                        projectionParameterNameList.add(count,parameterName);
277
                        //addProjectionParameterName(count,"CenterLat");                
278
                        
279
                        String[] parameterUnit={"Angular"};
280
                        projectionParameterUnitList.add(count,parameterUnit);
281
                }
282

    
283
                count++;
284
                { // Longitude_Of_2nd_Point
285
                        String[] parameterName={"Longitude_Of_2nd_Point"};
286
                        projectionParameterNameList.add(count,parameterName);
287
                        //addProjectionParameterName(count,"CenterLat");                
288
                        
289
                        String[] parameterUnit={"Angular"};
290
                        projectionParameterUnitList.add(count,parameterUnit);
291
                }
292

    
293
                count++;
294
                { // pseudo_standard_parallel_1
295
                        String[] parameterName={"pseudo_standard_parallel_1"};
296
                        projectionParameterNameList.add(count,parameterName);
297
                        addProjectionParameterName(count,"Latitude of Pseudo Standard Parallel");                
298

    
299
                        String[] parameterUnit={"Angular"};
300
                        projectionParameterUnitList.add(count,parameterUnit);
301
                }
302
                
303
                count++;
304
                { // satellite_height
305
                        String[] parameterName={"rectified_grid_angle"};
306
                        projectionParameterNameList.add(count,parameterName);
307
                        addProjectionParameterName(count,"Angle from Rectified to Skew Grid");                
308
                        addProjectionParameterName(count,"XY_Plane_Rotation");                
309
                        addProjectionParameterName(count,"RectifiedGridAngle");                
310

    
311
                        String[] parameterUnit={"Linear"};
312
                        projectionParameterUnitList.add(count,parameterUnit);
313
                }
314
                
315
                count++;
316
                { // satellite_height
317
                        String[] parameterName={"satellite_height"};
318
                        projectionParameterNameList.add(count,parameterName);
319
                        addProjectionParameterName(count,"Satellite Height");                
320

    
321
                        String[] parameterUnit={"Linear"};
322
                        projectionParameterUnitList.add(count,parameterUnit);
323
                }
324
                
325
                count++;
326
                { // scale_factor
327
                        String[] parameterName={"scale_factor"};
328
                        projectionParameterNameList.add(count,parameterName);
329
                        addProjectionParameterName(count,"Scale factor at natural origin");                
330
                        addProjectionParameterName(count,"ScaleAtNatOrigin");                
331
                        addProjectionParameterName(count,"ScaleAtCenter");                
332

    
333
                        String[] parameterUnit={"Unitless"};
334
                        projectionParameterUnitList.add(count,parameterUnit);
335
                }
336

    
337
                count++;
338
                { // standard_parallel_1
339
                        String[] parameterName={"standard_parallel_1"};
340
                        projectionParameterNameList.add(count,parameterName);
341
                        addProjectionParameterName(count,"Latitude of first standard parallel");                
342
                        addProjectionParameterName(count,"Latitude of origin");                
343
                        addProjectionParameterName(count,"StdParallel1");                
344

    
345
                        String[] parameterUnit={"Angular"};
346
                        projectionParameterUnitList.add(count,parameterUnit);
347
                }
348

    
349
                count++;
350
                { // standard_parallel_2
351
                        String[] parameterName={"standard_parallel_2"};
352
                        projectionParameterNameList.add(count,parameterName);
353
                        addProjectionParameterName(count,"Latitude of second standard parallel");                
354
                        addProjectionParameterName(count,"StdParallel2");                
355

    
356
                        String[] parameterUnit={"Angular"};
357
                        projectionParameterUnitList.add(count,parameterUnit);
358
                }
359

    
360
                count++;
361
                { // semi_major
362
                        String[] parameterName={"semi_major"};
363
                        projectionParameterNameList.add(count,parameterName);
364
                        addProjectionParameterName(count,"semi_major_axis");                
365

    
366
                        String[] parameterUnit={"Linear"};
367
                        projectionParameterUnitList.add(count,parameterUnit);
368
                }
369

    
370
                count++;
371
                { // semi_minor
372
                        String[] parameterName={"semi_minor"};
373
                        projectionParameterNameList.add(count,parameterName);
374
                        addProjectionParameterName(count,"semi_minor_axis");                
375

    
376
                        String[] parameterUnit={"Linear"};
377
                        projectionParameterUnitList.add(count,parameterUnit);
378
                }
379

    
380
                count++;
381
                { // height
382
                        String[] parameterName={"Height"};
383
                        projectionParameterNameList.add(count,parameterName);
384
                        addProjectionParameterName(count,"altitude");                
385

    
386
                        String[] parameterUnit={"Linear"};
387
                        projectionParameterUnitList.add(count,parameterUnit);
388
                }
389

    
390
        }
391
        
392
        private void defineProjections() throws CrsException
393
        {
394
                int count=0;
395
                
396
                {// Aitoff
397
                        String[] projectionName={"Aitoff"};
398
                        projectionNameList.add(count,projectionName);
399

    
400
                        String[] parameterName={"central_meridian"};
401
                        projectionParameterList.add(count,parameterName);
402
                        addProjectionParameter(count,"false_easting");
403
                        addProjectionParameter(count,"false_northing");
404

    
405
                        String[] parameterAcronym={"lon_0"};
406
                        projectionParameterAcronymList.add(count,parameterAcronym);
407
                        addProjectionParameterAcronymList(count,"x_0");
408
                        addProjectionParameterAcronymList(count,"y_0");
409

    
410
                        String[] parameterDefaultValue={"0.0"};
411
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
412
                        addProjectionParameterDefaultValue(count,"0.0");
413
                        addProjectionParameterDefaultValue(count,"0.0");
414

    
415
                        String[] parameterMaxValue={"360.0"};
416
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
417
                        addProjectionParameterMaxValue(count,"100000000.0");
418
                        addProjectionParameterMaxValue(count,"100000000.0");
419

    
420
                        String[] parameterMinValue={"-360.0"};
421
                        projectionParameterMinValueList.add(count,parameterMinValue);
422
                        addProjectionParameterMinValue(count,"-100000000.0");
423
                        addProjectionParameterMinValue(count,"-100000000.0");
424

    
425
                        String[] projectionAcronym={"aitoff"};
426
                        projectionAcronymList.add(count,projectionAcronym);
427
                }
428
                
429
                count++;
430
                {// Albers Equal-Area Conic
431
                        String[] projectionName={"Albers_Conic_Equal_Area"};
432
                        projectionNameList.add(count,projectionName);
433
                        addProjectionName(count,"Albers Equal-Area Conic");
434
                        addProjectionName(count,"Albers Equal Area");
435
                        addProjectionName(count,"9822");
436
                        
437
                        String[] parameterName={"standard_parallel_1"};
438
                        projectionParameterList.add(count,parameterName);
439
                        addProjectionParameter(count,"standard_parallel_2");
440
                        addProjectionParameter(count,"latitude_of_center");
441
                        addProjectionParameter(count,"longitude_of_center");
442
                        addProjectionParameter(count,"false_easting");
443
                        addProjectionParameter(count,"false_northing");
444

    
445
                        String[] parameterAcronym={"lat_1"};
446
                        projectionParameterAcronymList.add(count,parameterAcronym);
447
                        addProjectionParameterAcronymList(count,"lat_2");
448
                        addProjectionParameterAcronymList(count,"lat_0");
449
                        addProjectionParameterAcronymList(count,"lon_0");
450
                        addProjectionParameterAcronymList(count,"x_0");
451
                        addProjectionParameterAcronymList(count,"y_0");
452

    
453
                        String[] parameterDefaultValue={"0.0"};
454
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
455
                        addProjectionParameterDefaultValue(count,"0.0");
456
                        addProjectionParameterDefaultValue(count,"0.0");
457
                        addProjectionParameterDefaultValue(count,"0.0");
458
                        addProjectionParameterDefaultValue(count,"0.0");
459
                        addProjectionParameterDefaultValue(count,"0.0");
460

    
461
                        String[] parameterMaxValue={"90.0"};
462
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
463
                        addProjectionParameterMaxValue(count,"90.0");
464
                        addProjectionParameterMaxValue(count,"90.0");
465
                        addProjectionParameterMaxValue(count,"360.0");
466
                        addProjectionParameterMaxValue(count,"100000000.0");
467
                        addProjectionParameterMaxValue(count,"100000000.0");
468

    
469
                        String[] parameterMinValue={"-90.0"};
470
                        projectionParameterMinValueList.add(count,parameterMinValue);
471
                        addProjectionParameterMinValue(count,"-90.0");
472
                        addProjectionParameterMinValue(count,"-90.0");
473
                        addProjectionParameterMinValue(count,"-360.0");
474
                        addProjectionParameterMinValue(count,"-100000000.0");
475
                        addProjectionParameterMinValue(count,"-100000000.0");
476

    
477
                        String[] projectionAcronym={"aea"};
478
                        projectionAcronymList.add(count,projectionAcronym);
479
                }
480
                
481
                count++;
482
                {// Azimuthal_Equidistantt
483
                        String[] projectionName={"Azimuthal_Equidistant"};
484
                        projectionNameList.add(count,projectionName);
485
                        addProjectionName(count,"Azimuthal Equidistant");
486
                        addProjectionName(count,"Azimuthal-Equidistant");
487
                        addProjectionName(count,"Postel");
488
                        addProjectionName(count,"Zenithal Equidistant");
489
                        addProjectionName(count,"Zenithal-Equidistant");
490
                        addProjectionName(count,"Zenithal_Equidistant");
491
                        
492
                        String[] parameterName={"latitude_of_center"};
493
                        projectionParameterList.add(count,parameterName);
494
                        addProjectionParameter(count,"longitude_of_center");
495
                        addProjectionParameter(count,"false_easting");
496
                        addProjectionParameter(count,"false_northing");
497

    
498
                        String[] parameterAcronym={"lat_0"};
499
                        projectionParameterAcronymList.add(count,parameterAcronym);
500
                        addProjectionParameterAcronymList(count,"lon_0");
501
                        addProjectionParameterAcronymList(count,"x_0");
502
                        addProjectionParameterAcronymList(count,"y_0");
503

    
504
                        String[] parameterDefaultValue={"0.0"};
505
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
506
                        addProjectionParameterDefaultValue(count,"0.0");
507
                        addProjectionParameterDefaultValue(count,"0.0");
508
                        addProjectionParameterDefaultValue(count,"0.0");
509

    
510
                        String[] parameterMaxValue={"90.0"};
511
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
512
                        addProjectionParameterMaxValue(count,"360.0");
513
                        addProjectionParameterMaxValue(count,"100000000.0");
514
                        addProjectionParameterMaxValue(count,"100000000.0");
515

    
516
                        String[] parameterMinValue={"-90.0"};
517
                        projectionParameterMinValueList.add(count,parameterMinValue);
518
                        addProjectionParameterMinValue(count,"-360.0");
519
                        addProjectionParameterMinValue(count,"-100000000.0");
520
                        addProjectionParameterMinValue(count,"-100000000.0");
521

    
522
                        String[] projectionAcronym={"aeqd"};
523
                        projectionAcronymList.add(count,projectionAcronym);
524
                }
525

    
526
                count++;
527
                {// Bonne
528
                        String[] projectionName={"Bonne"};
529
                        projectionNameList.add(count,projectionName);
530
                        addProjectionName(count,"Bonne");
531

    
532
                        String[] parameterName={"central_meridian"};
533
                        projectionParameterList.add(count,parameterName);
534
                        addProjectionParameter(count,"standard_parallel_1");
535
                        addProjectionParameter(count,"false_easting");
536
                        addProjectionParameter(count,"false_northing");
537

    
538
                        String[] parameterAcronym={"lon_0"};
539
                        projectionParameterAcronymList.add(count,parameterAcronym);
540
                        addProjectionParameterAcronymList(count,"lat_1");
541
                        addProjectionParameterAcronymList(count,"x_0");
542
                        addProjectionParameterAcronymList(count,"y_0");
543

    
544
                        String[] parameterDefaultValue={"0.0"};
545
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
546
                        addProjectionParameterDefaultValue(count,"0.0");
547
                        addProjectionParameterDefaultValue(count,"0.0");
548
                        addProjectionParameterDefaultValue(count,"0.0");
549

    
550
                        String[] parameterMaxValue={"360.0"};
551
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
552
                        addProjectionParameterMaxValue(count,"90.0");
553
                        addProjectionParameterMaxValue(count,"100000000.0");
554
                        addProjectionParameterMaxValue(count,"100000000.0");
555

    
556
                        String[] parameterMinValue={"-360.0"};
557
                        projectionParameterMinValueList.add(count,parameterMinValue);
558
                        addProjectionParameterMinValue(count,"-90.0");
559
                        addProjectionParameterMinValue(count,"-100000000.0");
560
                        addProjectionParameterMinValue(count,"-100000000.0");
561

    
562
                        String[] projectionAcronym={"bonne"};
563
                        projectionAcronymList.add(count,projectionAcronym);
564
                }
565

    
566
                count++;
567
                {// Cassini_Soldner
568
                        String[] projectionName={"Cassini_Soldner"};
569
                        projectionNameList.add(count,projectionName);
570
                        addProjectionName(count,"Cassini-Soldner");
571
                        addProjectionName(count,"Cassini");
572
                        addProjectionName(count,"9806");
573

    
574
                        String[] parameterName={"latitude_of_origin"};
575
                        projectionParameterList.add(count,parameterName);
576
                        addProjectionParameter(count,"central_meridian");
577
                        addProjectionParameter(count,"false_easting");
578
                        addProjectionParameter(count,"false_northing");
579

    
580
                        String[] parameterAcronym={"lat_0"};
581
                        projectionParameterAcronymList.add(count,parameterAcronym);
582
                        addProjectionParameterAcronymList(count,"lon_0");
583
                        addProjectionParameterAcronymList(count,"x_0");
584
                        addProjectionParameterAcronymList(count,"y_0");
585

    
586
                        String[] parameterDefaultValue={"0.0"};
587
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
588
                        addProjectionParameterDefaultValue(count,"0.0");
589
                        addProjectionParameterDefaultValue(count,"0.0");
590
                        addProjectionParameterDefaultValue(count,"0.0");
591

    
592
                        String[] parameterMaxValue={"90.0"};
593
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
594
                        addProjectionParameterMaxValue(count,"360.0");
595
                        addProjectionParameterMaxValue(count,"100000000.0");
596
                        addProjectionParameterMaxValue(count,"100000000.0");
597

    
598
                        String[] parameterMinValue={"-90.0"};
599
                        projectionParameterMinValueList.add(count,parameterMinValue);
600
                        addProjectionParameterMinValue(count,"-360.0");
601
                        addProjectionParameterMinValue(count,"-100000000.0");
602
                        addProjectionParameterMinValue(count,"-100000000.0");
603

    
604
                        String[] projectionAcronym={"cass"};
605
                        projectionAcronymList.add(count,projectionAcronym);
606
                }
607
                
608
                count++;
609
                {// Craster Parabolic
610
                        String[] projectionName={"Craster_Parabolic"};
611
                        projectionNameList.add(count,projectionName);
612
                        addProjectionName(count,"Craster-Parabolic");
613
                        addProjectionName(count,"Craster Parabolic");
614

    
615
                        String[] parameterName={"central_meridian"};
616
                        projectionParameterList.add(count,parameterName);
617
                        addProjectionParameter(count,"false_easting");
618
                        addProjectionParameter(count,"false_northing");
619

    
620
                        String[] parameterAcronym={"lon_0"};
621
                        projectionParameterAcronymList.add(count,parameterAcronym);
622
                        addProjectionParameterAcronymList(count,"x_0");
623
                        addProjectionParameterAcronymList(count,"y_0");
624

    
625
                        String[] parameterDefaultValue={"0.0"};
626
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
627
                        addProjectionParameterDefaultValue(count,"0.0");
628
                        addProjectionParameterDefaultValue(count,"0.0");
629

    
630
                        String[] parameterMaxValue={"360.0"};
631
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
632
                        addProjectionParameterMaxValue(count,"100000000.0");
633
                        addProjectionParameterMaxValue(count,"100000000.0");
634

    
635
                        String[] parameterMinValue={"-360.0"};
636
                        projectionParameterMinValueList.add(count,parameterMinValue);
637
                        addProjectionParameterMinValue(count,"-100000000.0");
638
                        addProjectionParameterMinValue(count,"-100000000.0");
639

    
640
                        String[] projectionAcronym={"craster"};
641
                        projectionAcronymList.add(count,projectionAcronym);
642
                }
643

    
644
                count++;
645
                {// Cylindrical_Equal_Area
646
                        String[] projectionName={"Cylindrical_Equal_Area"};
647
                        projectionNameList.add(count,projectionName);
648
                        addProjectionName(count,"Cylindrical Equal Area");
649
                        addProjectionName(count,"Normal Authalic Cylindrical (FME)");
650
                        addProjectionName(count,"Lambert Cylindrical Equal Area");
651
                        addProjectionName(count,"Lambert_Cylindrical_Equal_Area");
652
                        addProjectionName(count,"Behrmann (standard parallel = 30)");
653
                        addProjectionName(count,"Behrmann");
654
                        addProjectionName(count,"Gall Orthographic (standard parallel = 45)");
655
                        addProjectionName(count,"Gall Orthographic");
656
                        addProjectionName(count,"Gall_Orthographic");
657
                        addProjectionName(count,"Peters (approximated by Gall Orthographic)");
658
                        addProjectionName(count,"Peters");
659
                        addProjectionName(count,"Lambert Cylindrical Equal Area (Spherical)");
660

    
661
                        String[] parameterName={"central_meridian"};
662
                        projectionParameterList.add(count,parameterName);
663
                        addProjectionParameter(count,"standard_parallel_1");
664
                        addProjectionParameter(count,"false_easting");
665
                        addProjectionParameter(count,"false_northing");
666

    
667
                        String[] parameterAcronym={"lon_0"};
668
                        projectionParameterAcronymList.add(count,parameterAcronym);
669
                        addProjectionParameterAcronymList(count,"lat_ts");
670
                        addProjectionParameterAcronymList(count,"x_0");
671
                        addProjectionParameterAcronymList(count,"y_0");
672

    
673
                        String[] parameterDefaultValue={"0.0"};
674
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
675
                        addProjectionParameterDefaultValue(count,"0.0");
676
                        addProjectionParameterDefaultValue(count,"0.0");
677
                        addProjectionParameterDefaultValue(count,"0.0");
678

    
679
                        String[] parameterMaxValue={"360.0"};
680
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
681
                        addProjectionParameterMaxValue(count,"90.0");
682
                        addProjectionParameterMaxValue(count,"100000000.0");
683
                        addProjectionParameterMaxValue(count,"100000000.0");
684

    
685
                        String[] parameterMinValue={"-360.0"};
686
                        projectionParameterMinValueList.add(count,parameterMinValue);
687
                        addProjectionParameterMinValue(count,"-90.0");
688
                        addProjectionParameterMinValue(count,"-100000000.0");
689
                        addProjectionParameterMinValue(count,"-100000000.0");
690

    
691
                        String[] projectionAcronym={"cea"};
692
                        projectionAcronymList.add(count,projectionAcronym);
693
                }
694

    
695
                count++;
696
                {// Eckert_I
697
                        String[] projectionName={"Eckert_I"};
698
                        projectionNameList.add(count,projectionName);
699
                        addProjectionName(count,"Eckert I");
700

    
701
                        String[] parameterName={"central_meridian"};
702
                        projectionParameterList.add(count,parameterName);
703
                        addProjectionParameter(count,"false_easting");
704
                        addProjectionParameter(count,"false_northing");
705

    
706
                        String[] parameterAcronym={"lon_0"};
707
                        projectionParameterAcronymList.add(count,parameterAcronym);
708
                        addProjectionParameterAcronymList(count,"x_0");
709
                        addProjectionParameterAcronymList(count,"y_0");
710

    
711
                        String[] parameterDefaultValue={"0.0"};
712
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
713
                        addProjectionParameterDefaultValue(count,"0.0");
714
                        addProjectionParameterDefaultValue(count,"0.0");
715

    
716
                        String[] parameterMaxValue={"360.0"};
717
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
718
                        addProjectionParameterMaxValue(count,"100000000.0");
719
                        addProjectionParameterMaxValue(count,"100000000.0");
720

    
721
                        String[] parameterMinValue={"-360.0"};
722
                        projectionParameterMinValueList.add(count,parameterMinValue);
723
                        addProjectionParameterMinValue(count,"-100000000.0");
724
                        addProjectionParameterMinValue(count,"-100000000.0");
725

    
726
                        String[] projectionAcronym={"eck1"};
727
                        projectionAcronymList.add(count,projectionAcronym);
728
                }
729

    
730
                count++;
731
                {// Eckert_II
732
                        String[] projectionName={"Eckert_II"};
733
                        projectionNameList.add(count,projectionName);
734
                        addProjectionName(count,"Eckert II");
735

    
736
                        String[] parameterName={"central_meridian"};
737
                        projectionParameterList.add(count,parameterName);
738
                        addProjectionParameter(count,"false_easting");
739
                        addProjectionParameter(count,"false_northing");
740

    
741
                        String[] parameterAcronym={"lon_0"};
742
                        projectionParameterAcronymList.add(count,parameterAcronym);
743
                        addProjectionParameterAcronymList(count,"x_0");
744
                        addProjectionParameterAcronymList(count,"y_0");
745

    
746
                        String[] parameterDefaultValue={"0.0"};
747
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
748
                        addProjectionParameterDefaultValue(count,"0.0");
749
                        addProjectionParameterDefaultValue(count,"0.0");
750

    
751
                        String[] parameterMaxValue={"360.0"};
752
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
753
                        addProjectionParameterMaxValue(count,"100000000.0");
754
                        addProjectionParameterMaxValue(count,"100000000.0");
755

    
756
                        String[] parameterMinValue={"-360.0"};
757
                        projectionParameterMinValueList.add(count,parameterMinValue);
758
                        addProjectionParameterMinValue(count,"-100000000.0");
759
                        addProjectionParameterMinValue(count,"-100000000.0");
760

    
761
                        String[] projectionAcronym={"eck2"};
762
                        projectionAcronymList.add(count,projectionAcronym);
763
                }
764

    
765
                count++;
766
                {// Eckert_III
767
                        String[] projectionName={"Eckert_III"};
768
                        projectionNameList.add(count,projectionName);
769
                        addProjectionName(count,"Eckert III");
770

    
771
                        String[] parameterName={"central_meridian"};
772
                        projectionParameterList.add(count,parameterName);
773
                        addProjectionParameter(count,"false_easting");
774
                        addProjectionParameter(count,"false_northing");
775

    
776
                        String[] parameterAcronym={"lon_0"};
777
                        projectionParameterAcronymList.add(count,parameterAcronym);
778
                        addProjectionParameterAcronymList(count,"x_0");
779
                        addProjectionParameterAcronymList(count,"y_0");
780

    
781
                        String[] parameterDefaultValue={"0.0"};
782
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
783
                        addProjectionParameterDefaultValue(count,"0.0");
784
                        addProjectionParameterDefaultValue(count,"0.0");
785

    
786
                        String[] parameterMaxValue={"360.0"};
787
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
788
                        addProjectionParameterMaxValue(count,"100000000.0");
789
                        addProjectionParameterMaxValue(count,"100000000.0");
790

    
791
                        String[] parameterMinValue={"-360.0"};
792
                        projectionParameterMinValueList.add(count,parameterMinValue);
793
                        addProjectionParameterMinValue(count,"-100000000.0");
794
                        addProjectionParameterMinValue(count,"-100000000.0");
795

    
796
                        String[] projectionAcronym={"eck3"};
797
                        projectionAcronymList.add(count,projectionAcronym);
798
                }
799

    
800
                count++;
801
                {// Eckert_IV
802
                        String[] projectionName={"Eckert_IV"};
803
                        projectionNameList.add(count,projectionName);
804
                        addProjectionName(count,"Eckert IV");
805

    
806
                        String[] parameterName={"central_meridian"};
807
                        projectionParameterList.add(count,parameterName);
808
                        addProjectionParameter(count,"false_easting");
809
                        addProjectionParameter(count,"false_northing");
810

    
811
                        String[] parameterAcronym={"lon_0"};
812
                        projectionParameterAcronymList.add(count,parameterAcronym);
813
                        addProjectionParameterAcronymList(count,"x_0");
814
                        addProjectionParameterAcronymList(count,"y_0");
815

    
816
                        String[] parameterDefaultValue={"0.0"};
817
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
818
                        addProjectionParameterDefaultValue(count,"0.0");
819
                        addProjectionParameterDefaultValue(count,"0.0");
820

    
821
                        String[] parameterMaxValue={"360.0"};
822
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
823
                        addProjectionParameterMaxValue(count,"100000000.0");
824
                        addProjectionParameterMaxValue(count,"100000000.0");
825

    
826
                        String[] parameterMinValue={"-360.0"};
827
                        projectionParameterMinValueList.add(count,parameterMinValue);
828
                        addProjectionParameterMinValue(count,"-100000000.0");
829
                        addProjectionParameterMinValue(count,"-100000000.0");
830

    
831
                        String[] projectionAcronym={"eck4"};
832
                        projectionAcronymList.add(count,projectionAcronym);
833
                }
834

    
835
                count++;
836
                {// Eckert_V
837
                        String[] projectionName={"Eckert_V"};
838
                        projectionNameList.add(count,projectionName);
839
                        addProjectionName(count,"Eckert V");
840

    
841
                        String[] parameterName={"central_meridian"};
842
                        projectionParameterList.add(count,parameterName);
843
                        addProjectionParameter(count,"false_easting");
844
                        addProjectionParameter(count,"false_northing");
845

    
846
                        String[] parameterAcronym={"lon_0"};
847
                        projectionParameterAcronymList.add(count,parameterAcronym);
848
                        addProjectionParameterAcronymList(count,"x_0");
849
                        addProjectionParameterAcronymList(count,"y_0");
850

    
851
                        String[] parameterDefaultValue={"0.0"};
852
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
853
                        addProjectionParameterDefaultValue(count,"0.0");
854
                        addProjectionParameterDefaultValue(count,"0.0");
855

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

    
861
                        String[] parameterMinValue={"-360.0"};
862
                        projectionParameterMinValueList.add(count,parameterMinValue);
863
                        addProjectionParameterMinValue(count,"-100000000.0");
864
                        addProjectionParameterMinValue(count,"-100000000.0");
865

    
866
                        String[] projectionAcronym={"eck5"};
867
                        projectionAcronymList.add(count,projectionAcronym);
868
                }
869

    
870
                count++;
871
                {// Eckert_VI
872
                        String[] projectionName={"Eckert_VI"};
873
                        projectionNameList.add(count,projectionName);
874
                        addProjectionName(count,"Eckert VI");
875

    
876
                        String[] parameterName={"central_meridian"};
877
                        projectionParameterList.add(count,parameterName);
878
                        addProjectionParameter(count,"false_easting");
879
                        addProjectionParameter(count,"false_northing");
880

    
881
                        String[] parameterAcronym={"lon_0"};
882
                        projectionParameterAcronymList.add(count,parameterAcronym);
883
                        addProjectionParameterAcronymList(count,"x_0");
884
                        addProjectionParameterAcronymList(count,"y_0");
885

    
886
                        String[] parameterDefaultValue={"0.0"};
887
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
888
                        addProjectionParameterDefaultValue(count,"0.0");
889
                        addProjectionParameterDefaultValue(count,"0.0");
890

    
891
                        String[] parameterMaxValue={"360.0"};
892
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
893
                        addProjectionParameterMaxValue(count,"100000000.0");
894
                        addProjectionParameterMaxValue(count,"100000000.0");
895

    
896
                        String[] parameterMinValue={"-360.0"};
897
                        projectionParameterMinValueList.add(count,parameterMinValue);
898
                        addProjectionParameterMinValue(count,"-100000000.0");
899
                        addProjectionParameterMinValue(count,"-100000000.0");
900

    
901
                        String[] projectionAcronym={"eck6"};
902
                        projectionAcronymList.add(count,projectionAcronym);
903
                }
904
                
905
                count++;
906
                {// Equidistant_Conic
907
                        String[] projectionName={"Equidistant_Conic"};
908
                        projectionNameList.add(count,projectionName);
909
                        addProjectionName(count,"Equidistant Conic");
910
                        
911
                        String[] parameterName={"latitude_of_center"};
912
                        projectionParameterList.add(count,parameterName);
913
                        addProjectionParameter(count,"longitude_of_center");
914
                        addProjectionParameter(count,"standard_parallel_1");
915
                        addProjectionParameter(count,"standard_parallel_2");
916
                        addProjectionParameter(count,"false_easting");
917
                        addProjectionParameter(count,"false_northing");
918

    
919
                        String[] parameterAcronym={"lat_0"};
920
                        projectionParameterAcronymList.add(count,parameterAcronym);
921
                        addProjectionParameterAcronymList(count,"lon_0");
922
                        addProjectionParameterAcronymList(count,"lat_1");
923
                        addProjectionParameterAcronymList(count,"lat_2");
924
                        addProjectionParameterAcronymList(count,"x_0");
925
                        addProjectionParameterAcronymList(count,"y_0");
926

    
927
                        String[] parameterDefaultValue={"0.0"};
928
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
929
                        addProjectionParameterDefaultValue(count,"0.0");
930
                        addProjectionParameterDefaultValue(count,"0.0");
931
                        addProjectionParameterDefaultValue(count,"0.0");
932
                        addProjectionParameterDefaultValue(count,"0.0");
933
                        addProjectionParameterDefaultValue(count,"0.0");
934

    
935
                        String[] parameterMaxValue={"90.0"};
936
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
937
                        addProjectionParameterMaxValue(count,"360.0");
938
                        addProjectionParameterMaxValue(count,"90.0");
939
                        addProjectionParameterMaxValue(count,"90.0");
940
                        addProjectionParameterMaxValue(count,"100000000.0");
941
                        addProjectionParameterMaxValue(count,"100000000.0");
942

    
943
                        String[] parameterMinValue={"-90.0"};
944
                        projectionParameterMinValueList.add(count,parameterMinValue);
945
                        addProjectionParameterMinValue(count,"-360.0");
946
                        addProjectionParameterMinValue(count,"-90.0");
947
                        addProjectionParameterMinValue(count,"-90.0");
948
                        addProjectionParameterMinValue(count,"-100000000.0");
949
                        addProjectionParameterMinValue(count,"-100000000.0");
950

    
951
                        String[] projectionAcronym={"eqdc"};
952
                        projectionAcronymList.add(count,projectionAcronym);
953
                }
954

    
955
                count++;
956
                {// Equirectangular
957
                        String[] projectionName={"Equirectangular"};
958
                        projectionNameList.add(count,projectionName);
959
                        addProjectionName(count,"Plate Caree");
960
                        addProjectionName(count,"Plate Carree");
961
                        addProjectionName(count,"Plate_Caree");
962
                        addProjectionName(count,"Plate_Carree");
963
                        addProjectionName(count,"Equidistant Cylindrical");
964
                        addProjectionName(count,"Equidistant_Cylindrical");
965
                        addProjectionName(count,"9823");
966

    
967
                        String[] parameterName={"latitude_of_origin"};
968
                        projectionParameterList.add(count,parameterName);
969
                        addProjectionParameter(count,"central_meridian");
970
                        addProjectionParameter(count,"false_easting");
971
                        addProjectionParameter(count,"false_northing");
972

    
973
                        String[] parameterAcronym={"lat_ts"};
974
                        projectionParameterAcronymList.add(count,parameterAcronym);
975
                        addProjectionParameterAcronymList(count,"lon_0");
976
                        addProjectionParameterAcronymList(count,"x_0");
977
                        addProjectionParameterAcronymList(count,"y_0");
978

    
979
                        String[] parameterDefaultValue={"0.0"};
980
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
981
                        addProjectionParameterDefaultValue(count,"0.0");
982
                        addProjectionParameterDefaultValue(count,"0.0");
983
                        addProjectionParameterDefaultValue(count,"0.0");
984

    
985
                        String[] parameterMaxValue={"90.0"};
986
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
987
                        addProjectionParameterMaxValue(count,"360.0");
988
                        addProjectionParameterMaxValue(count,"100000000.0");
989
                        addProjectionParameterMaxValue(count,"100000000.0");
990

    
991
                        String[] parameterMinValue={"-90.0"};
992
                        projectionParameterMinValueList.add(count,parameterMinValue);
993
                        addProjectionParameterMinValue(count,"-360.0");
994
                        addProjectionParameterMinValue(count,"-100000000.0");
995
                        addProjectionParameterMinValue(count,"-100000000.0");
996

    
997
                        String[] projectionAcronym={"eqc"};
998
                        projectionAcronymList.add(count,projectionAcronym);
999
                }
1000
                
1001
                count++;
1002
                {// McBryde-Thomas Flat-Polar Quartic
1003
                        String[] projectionName={"McBryde_Thomas_Flat_Polar_Quartic"};
1004
                        projectionNameList.add(count,projectionName);
1005
                        addProjectionName(count,"McBryde-Thomas-Flat-Polar-Quartic");
1006
                        addProjectionName(count,"McBryde Thomas Flat Polar Quartic");
1007
                        addProjectionName(count,"Flat Polar Quartic");
1008
                        addProjectionName(count,"Flat-Polar-Quartic");
1009
                        addProjectionName(count,"Flat_Polar_Quartic");
1010

    
1011
                        String[] parameterName={"central_meridian"};
1012
                        projectionParameterList.add(count,parameterName);
1013
                        addProjectionParameter(count,"false_easting");
1014
                        addProjectionParameter(count,"false_northing");
1015

    
1016
                        String[] parameterAcronym={"lon_0"};
1017
                        projectionParameterAcronymList.add(count,parameterAcronym);
1018
                        addProjectionParameterAcronymList(count,"x_0");
1019
                        addProjectionParameterAcronymList(count,"y_0");
1020

    
1021
                        String[] parameterDefaultValue={"0.0"};
1022
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1023
                        addProjectionParameterDefaultValue(count,"0.0");
1024
                        addProjectionParameterDefaultValue(count,"0.0");
1025

    
1026
                        String[] parameterMaxValue={"360.0"};
1027
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1028
                        addProjectionParameterMaxValue(count,"100000000.0");
1029
                        addProjectionParameterMaxValue(count,"100000000.0");
1030

    
1031
                        String[] parameterMinValue={"-360.0"};
1032
                        projectionParameterMinValueList.add(count,parameterMinValue);
1033
                        addProjectionParameterMinValue(count,"-100000000.0");
1034
                        addProjectionParameterMinValue(count,"-100000000.0");
1035

    
1036
                        String[] projectionAcronym={"mbtfpq"};
1037
                        projectionAcronymList.add(count,projectionAcronym);
1038
                }
1039

    
1040
                count++;
1041
                {// Gall_Stereographic
1042
                        String[] projectionName={"Gall_Stereographic"};
1043
                        projectionNameList.add(count,projectionName);
1044
                        addProjectionName(count,"Gall Stereograpic");
1045
                        addProjectionName(count,"Gall");
1046

    
1047
                        String[] parameterName={"central_meridian"};
1048
                        projectionParameterList.add(count,parameterName);
1049
                        addProjectionParameter(count,"false_easting");
1050
                        addProjectionParameter(count,"false_northing");
1051

    
1052
                        String[] parameterAcronym={"lon_0"};
1053
                        projectionParameterAcronymList.add(count,parameterAcronym);
1054
                        addProjectionParameterAcronymList(count,"x_0");
1055
                        addProjectionParameterAcronymList(count,"y_0");
1056

    
1057
                        String[] parameterDefaultValue={"0.0"};
1058
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1059
                        addProjectionParameterDefaultValue(count,"0.0");
1060
                        addProjectionParameterDefaultValue(count,"0.0");
1061

    
1062
                        String[] parameterMaxValue={"360.0"};
1063
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1064
                        addProjectionParameterMaxValue(count,"100000000.0");
1065
                        addProjectionParameterMaxValue(count,"100000000.0");
1066

    
1067
                        String[] parameterMinValue={"-360.0"};
1068
                        projectionParameterMinValueList.add(count,parameterMinValue);
1069
                        addProjectionParameterMinValue(count,"-100000000.0");
1070
                        addProjectionParameterMinValue(count,"-100000000.0");
1071

    
1072
                        String[] projectionAcronym={"gall"};
1073
                        projectionAcronymList.add(count,projectionAcronym);
1074
                }
1075

    
1076
                count++;
1077
                {// GEOS
1078
                        String[] projectionName={"GEOS"};
1079
                        projectionNameList.add(count,projectionName);
1080
                        addProjectionName(count,"Geostationary Satellite View");
1081
                        addProjectionName(count,"Normalized Geostationary Projection");
1082

    
1083
                        String[] parameterName={"central_meridian"};
1084
                        projectionParameterList.add(count,parameterName);
1085
                        addProjectionParameter(count,"satellite_height");
1086
                        addProjectionParameter(count,"false_easting");
1087
                        addProjectionParameter(count,"false_northing");
1088

    
1089
                        String[] parameterAcronym={"lon_0"};
1090
                        projectionParameterAcronymList.add(count,parameterAcronym);
1091
                        addProjectionParameterAcronymList(count,"h");
1092
                        addProjectionParameterAcronymList(count,"y_0");
1093

    
1094
                        String[] parameterDefaultValue={"0.0"};
1095
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1096
                        addProjectionParameterDefaultValue(count,"35785831.0");
1097
                        addProjectionParameterDefaultValue(count,"0.0");
1098
                        addProjectionParameterDefaultValue(count,"0.0");
1099

    
1100
                        String[] parameterMaxValue={"360.0"};
1101
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1102
                        addProjectionParameterMaxValue(count,"100000000.0");
1103
                        addProjectionParameterMaxValue(count,"100000000.0");
1104
                        addProjectionParameterMaxValue(count,"100000000.0");
1105

    
1106
                        String[] parameterMinValue={"-360.0"};
1107
                        projectionParameterMinValueList.add(count,parameterMinValue);
1108
                        addProjectionParameterMinValue(count,"-100000000.0");
1109
                        addProjectionParameterMinValue(count,"-100000000.0");
1110
                        addProjectionParameterMinValue(count,"-100000000.0");
1111

    
1112
                        String[] projectionAcronym={"geos"};
1113
                        projectionAcronymList.add(count,projectionAcronym);
1114
                }
1115

    
1116
                count++;
1117
                {// Gnomonic
1118
                        String[] projectionName={"Gnomonic"};
1119
                        projectionNameList.add(count,projectionName);
1120
                        addProjectionName(count,"Gnomonic");
1121
                        addProjectionName(count,"Central");
1122

    
1123
                        String[] parameterName={"latitude_of_origin"};
1124
                        projectionParameterList.add(count,parameterName);
1125
                        addProjectionParameter(count,"central_meridian");
1126
                        addProjectionParameter(count,"false_easting");
1127
                        addProjectionParameter(count,"false_northing");
1128

    
1129
                        String[] parameterAcronym={"lat_0"};
1130
                        projectionParameterAcronymList.add(count,parameterAcronym);
1131
                        addProjectionParameterAcronymList(count,"lon_0");
1132
                        addProjectionParameterAcronymList(count,"x_0");
1133
                        addProjectionParameterAcronymList(count,"y_0");
1134

    
1135
                        String[] parameterDefaultValue={"0.0"};
1136
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1137
                        addProjectionParameterDefaultValue(count,"0.0");
1138
                        addProjectionParameterDefaultValue(count,"0.0");
1139
                        addProjectionParameterDefaultValue(count,"0.0");
1140

    
1141
                        String[] parameterMaxValue={"90.0"};
1142
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1143
                        addProjectionParameterMaxValue(count,"360.0");
1144
                        addProjectionParameterMaxValue(count,"100000000.0");
1145
                        addProjectionParameterMaxValue(count,"100000000.0");
1146

    
1147
                        String[] parameterMinValue={"-90.0"};
1148
                        projectionParameterMinValueList.add(count,parameterMinValue);
1149
                        addProjectionParameterMinValue(count,"-360.0");
1150
                        addProjectionParameterMinValue(count,"-100000000.0");
1151
                        addProjectionParameterMinValue(count,"-100000000.0");
1152

    
1153
                        String[] projectionAcronym={"gnom"};
1154
                        projectionAcronymList.add(count,projectionAcronym);
1155
                }
1156

    
1157
                count++;
1158
                {// Goode
1159
                        String[] projectionName={"Goode"};
1160
                        projectionNameList.add(count,projectionName);
1161
                        addProjectionName(count,"Homolosine");
1162

    
1163
                        String[] parameterName={"central_meridian"};
1164
                        projectionParameterList.add(count,parameterName);
1165
                        addProjectionParameter(count,"false_easting");
1166
                        addProjectionParameter(count,"false_northing");
1167

    
1168
                        String[] parameterAcronym={"lon_0"};
1169
                        projectionParameterAcronymList.add(count,parameterAcronym);
1170
                        addProjectionParameterAcronymList(count,"x_0");
1171
                        addProjectionParameterAcronymList(count,"y_0");
1172

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

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

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

    
1188
                        String[] projectionAcronym={"goode"};
1189
                        projectionAcronymList.add(count,projectionAcronym);
1190
                }
1191
                
1192
                count++;
1193
                {// Hammer-Aitoff
1194
                        String[] projectionName={"Hammer_Aitoff"};
1195
                        projectionNameList.add(count,projectionName);
1196
                        addProjectionName(count,"Hammer Aitoff");
1197
                        addProjectionName(count,"Hammer-Aitoff");
1198
                        addProjectionName(count,"Hammer");
1199

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

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

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

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

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

    
1225
                        String[] projectionAcronym={"hammer"};
1226
                        projectionAcronymList.add(count,projectionAcronym);
1227
                }
1228
                
1229
                count++;
1230
                {// Krovak
1231
                        String[] projectionName={"Krovak"};
1232
                        projectionNameList.add(count,projectionName);
1233
                        addProjectionName(count,"Krovak Oblique Conic Conformal");
1234
                        addProjectionName(count,"9819");
1235

    
1236
                        String[] parameterName={"latitude_of_center"};
1237
                        projectionParameterList.add(count,parameterName);
1238
                        addProjectionParameter(count,"longitude_of_center");
1239
                        //addProjectionParameter(count,"azimuth");
1240
                        addProjectionParameter(count,"scale_factor");
1241
                        addProjectionParameter(count,"false_easting");
1242
                        addProjectionParameter(count,"false_northing");
1243

    
1244
                        String[] parameterAcronym={"lat_0"};
1245
                        projectionParameterAcronymList.add(count,parameterAcronym);
1246
                        addProjectionParameterAcronymList(count,"lon_0");
1247
                        //addProjectionParameterAcronymList(count,"alpha");
1248
                        addProjectionParameterAcronymList(count,"k");
1249
                        addProjectionParameterAcronymList(count,"x_0");
1250
                        addProjectionParameterAcronymList(count,"y_0");
1251

    
1252
                        String[] parameterDefaultValue={"0.0"};
1253
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1254
                        addProjectionParameterDefaultValue(count,"0.0");
1255
                        //addProjectionParameterDefaultValue(count,"0.0");
1256
                        addProjectionParameterDefaultValue(count,"1.0");
1257
                        addProjectionParameterDefaultValue(count,"0.0");
1258
                        addProjectionParameterDefaultValue(count,"0.0");
1259

    
1260
                        String[] parameterMaxValue={"90.0"};
1261
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1262
                        addProjectionParameterMaxValue(count,"360.0");
1263
                        //addProjectionParameterMaxValue(count,"360.0");
1264
                        addProjectionParameterMaxValue(count,"10.0");
1265
                        addProjectionParameterMaxValue(count,"100000000.0");
1266
                        addProjectionParameterMaxValue(count,"100000000.0");
1267

    
1268
                        String[] parameterMinValue={"-90.0"};
1269
                        projectionParameterMinValueList.add(count,parameterMinValue);
1270
                        addProjectionParameterMinValue(count,"-360.0");
1271
                        //addProjectionParameterMinValue(count,"-360.0");
1272
                        addProjectionParameterMinValue(count,"0.0");
1273
                        addProjectionParameterMinValue(count,"-100000000.0");
1274
                        addProjectionParameterMinValue(count,"-100000000.0");
1275

    
1276
                        String[] projectionAcronym={"krovak"};
1277
                        projectionAcronymList.add(count,projectionAcronym);
1278
                }
1279
                
1280
                
1281
                count++;
1282
                {// Laborde Madagascar
1283
                        String[] projectionName={"Laborde_Madagascar"};
1284
                        projectionNameList.add(count,projectionName);
1285
                        addProjectionName(count,"Laborde Madagascar");
1286
                        addProjectionName(count,"Laborde");
1287
                        addProjectionName(count,"9813");
1288

    
1289
                        String[] parameterName={};
1290
                        projectionParameterList.add(count,parameterName);
1291

    
1292
                        String[] parameterAcronym={};
1293
                        projectionParameterAcronymList.add(count,parameterAcronym);
1294

    
1295
                        String[] parameterDefaultValue={};
1296
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1297

    
1298
                        String[] parameterMaxValue={};
1299
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1300

    
1301
                        String[] parameterMinValue={};
1302
                        projectionParameterMinValueList.add(count,parameterMinValue);
1303

    
1304
                        String[] projectionAcronym={"labrd"};
1305
                        projectionAcronymList.add(count,projectionAcronym);
1306
                        
1307
                        /*String[] parameterName={"azimuth"};
1308
                        projectionParameterList.add(count,parameterName);
1309

1310
                        String[] parameterAcronym={"azi"};
1311
                        projectionParameterAcronymList.add(count,parameterAcronym);
1312

1313
                        String[] parameterDefaultValue={"18.9"};
1314
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1315

1316
                        String[] parameterMaxValue={"19"};
1317
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1318

1319
                        String[] parameterMinValue={"18"};
1320
                        projectionParameterMinValueList.add(count,parameterMinValue);
1321

1322
                        String[] projectionAcronym={"labrd"};
1323
                        projectionAcronymList.add(count,projectionAcronym);*/
1324
                }
1325

    
1326
                count++;
1327
                {// Lambert_Azimuthal_Equal_Area
1328
                        String[] projectionName={"Lambert_Azimuthal_Equal_Area"};
1329
                        projectionNameList.add(count,projectionName);
1330
                        addProjectionName(count,"Lambert Azimuthal Equal Area");
1331
                        addProjectionName(count,"Lambert Azimuthal Equal Area (Spherical)");
1332
                        addProjectionName(count,"Lambert_Azimuthal_Equal_Area_(Spherical)");
1333
                        addProjectionName(count,"Lorgna");
1334
                        addProjectionName(count,"Zenithal Equal Area");
1335
                        addProjectionName(count,"Zenithal Equal-Area");
1336
                        addProjectionName(count,"Zenithal_Equal-Area");
1337
                        addProjectionName(count,"Zenithal-Equal-Area");
1338
                        addProjectionName(count,"Zenithal Eqivalent");
1339
                        addProjectionName(count,"Zenithal-Eqivalent");
1340
                        addProjectionName(count,"Zenithal_Eqivalent");
1341
                        addProjectionName(count,"9820");
1342
                        addProjectionName(count,"9821");
1343

    
1344
                        String[] parameterName={"latitude_of_center"};
1345
                        projectionParameterList.add(count,parameterName);
1346
                        addProjectionParameter(count,"longitude_of_center");
1347
                        addProjectionParameter(count,"false_easting");
1348
                        addProjectionParameter(count,"false_northing");
1349

    
1350
                        String[] parameterAcronym={"lat_0"};
1351
                        projectionParameterAcronymList.add(count,parameterAcronym);
1352
                        addProjectionParameterAcronymList(count,"lon_0");
1353
                        addProjectionParameterAcronymList(count,"x_0");
1354
                        addProjectionParameterAcronymList(count,"y_0");
1355

    
1356
                        String[] parameterDefaultValue={"0.0"};
1357
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1358
                        addProjectionParameterDefaultValue(count,"0.0");
1359
                        addProjectionParameterDefaultValue(count,"0.0");
1360
                        addProjectionParameterDefaultValue(count,"0.0");
1361

    
1362
                        String[] parameterMaxValue={"90.0"};
1363
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1364
                        addProjectionParameterMaxValue(count,"360.0");
1365
                        addProjectionParameterMaxValue(count,"100000000.0");
1366
                        addProjectionParameterMaxValue(count,"100000000.0");
1367

    
1368
                        String[] parameterMinValue={"-90.0"};
1369
                        projectionParameterMinValueList.add(count,parameterMinValue);
1370
                        addProjectionParameterMinValue(count,"-360.0");
1371
                        addProjectionParameterMinValue(count,"-100000000.0");
1372
                        addProjectionParameterMinValue(count,"-100000000.0");
1373

    
1374
                        String[] projectionAcronym={"laea"};
1375
                        projectionAcronymList.add(count,projectionAcronym);
1376
                }
1377
                count++;
1378
                {// Lambert_Conformal_Conic_1SP
1379
                        String[] projectionName={"Lambert_Conic_Near_Conformal"};
1380
                        projectionNameList.add(count,projectionName);
1381
                        addProjectionName(count,"Lambert Conic Near-Conformal");
1382
                        addProjectionName(count,"Lambert Conic Near Conformal");
1383
                        addProjectionName(count,"Lambert_Conic_Near-Conformal");
1384
                        addProjectionName(count,"9817");
1385

    
1386
                        String[] parameterName={"latitude_of_origin"};
1387
                        projectionParameterList.add(count,parameterName);
1388
                        addProjectionParameter(count,"central_meridian");
1389
                        addProjectionParameter(count,"scale_factor");
1390
                        addProjectionParameter(count,"false_easting");
1391
                        addProjectionParameter(count,"false_northing");
1392

    
1393
                        String[] parameterAcronym={"lat_0"};
1394
                        projectionParameterAcronymList.add(count,parameterAcronym);
1395
                        addProjectionParameterAcronymList(count,"lon_0");
1396
                        addProjectionParameterAcronymList(count,"k_0");
1397
                        addProjectionParameterAcronymList(count,"x_0");
1398
                        addProjectionParameterAcronymList(count,"y_0");
1399

    
1400
                        String[] parameterDefaultValue={"0.0"};
1401
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1402
                        addProjectionParameterDefaultValue(count,"0.0");
1403
                        addProjectionParameterDefaultValue(count,"1.0");
1404
                        addProjectionParameterDefaultValue(count,"0.0");
1405
                        addProjectionParameterDefaultValue(count,"0.0");
1406

    
1407
                        String[] parameterMaxValue={"90.0"};
1408
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1409
                        addProjectionParameterMaxValue(count,"360.0");
1410
                        addProjectionParameterMaxValue(count,"10.0");
1411
                        addProjectionParameterMaxValue(count,"100000000.0");
1412
                        addProjectionParameterMaxValue(count,"100000000.0");
1413

    
1414
                        String[] parameterMinValue={"-90.0"};
1415
                        projectionParameterMinValueList.add(count,parameterMinValue);
1416
                        addProjectionParameterMinValue(count,"-360.0");
1417
                        addProjectionParameterMinValue(count,"0.0");
1418
                        addProjectionParameterMinValue(count,"-100000000.0");
1419
                        addProjectionParameterMinValue(count,"-100000000.0");
1420

    
1421
                        String[] projectionAcronym={"lcca"};
1422
                        projectionAcronymList.add(count,projectionAcronym);
1423
                }
1424
                
1425
                count++;
1426
                {// Lambert_Conformal_Conic_1SP
1427
                        String[] projectionName={"Lambert_Conformal_Conic_1SP"};
1428
                        projectionNameList.add(count,projectionName);
1429
                        addProjectionName(count,"Lambert Conic Conformal (1SP)");
1430
                        addProjectionName(count,"9801");
1431

    
1432
                        String[] parameterName={"latitude_of_origin"};
1433
                        projectionParameterList.add(count,parameterName);
1434
                        addProjectionParameter(count,"central_meridian");
1435
                        addProjectionParameter(count,"scale_factor");
1436
                        addProjectionParameter(count,"false_easting");
1437
                        addProjectionParameter(count,"false_northing");
1438

    
1439
                        String[] parameterAcronym={"lat_0"};
1440
                        projectionParameterAcronymList.add(count,parameterAcronym);
1441
                        addProjectionParameterAcronymList(count,"lon_0");
1442
                        addProjectionParameterAcronymList(count,"k_0");
1443
                        addProjectionParameterAcronymList(count,"x_0");
1444
                        addProjectionParameterAcronymList(count,"y_0");
1445

    
1446
                        String[] parameterDefaultValue={"0.0"};
1447
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1448
                        addProjectionParameterDefaultValue(count,"0.0");
1449
                        addProjectionParameterDefaultValue(count,"1.0");
1450
                        addProjectionParameterDefaultValue(count,"0.0");
1451
                        addProjectionParameterDefaultValue(count,"0.0");
1452

    
1453
                        String[] parameterMaxValue={"90.0"};
1454
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1455
                        addProjectionParameterMaxValue(count,"360.0");
1456
                        addProjectionParameterMaxValue(count,"10.0");
1457
                        addProjectionParameterMaxValue(count,"100000000.0");
1458
                        addProjectionParameterMaxValue(count,"100000000.0");
1459

    
1460
                        String[] parameterMinValue={"-90.0"};
1461
                        projectionParameterMinValueList.add(count,parameterMinValue);
1462
                        addProjectionParameterMinValue(count,"-360.0");
1463
                        addProjectionParameterMinValue(count,"0.0");
1464
                        addProjectionParameterMinValue(count,"-100000000.0");
1465
                        addProjectionParameterMinValue(count,"-100000000.0");
1466

    
1467
                        String[] projectionAcronym={"lcc"};
1468
                        projectionAcronymList.add(count,projectionAcronym);
1469
                }
1470
                
1471
                count++;
1472
                {// Lambert_Conformal_Conic_2SP
1473
                        String[] projectionName={"Lambert_Conformal_Conic_2SP"};
1474
                        projectionNameList.add(count,projectionName);
1475
                        addProjectionName(count,"Lambert Conic Conformal (2SP)");
1476
                        addProjectionName(count,"9802");
1477

    
1478
                        String[] parameterName={"standard_parallel_1"};
1479
                        projectionParameterList.add(count,parameterName);
1480
                        addProjectionParameter(count,"standard_parallel_2");
1481
                        addProjectionParameter(count,"latitude_of_origin");
1482
                        addProjectionParameter(count,"central_meridian");
1483
                        addProjectionParameter(count,"false_easting");
1484
                        addProjectionParameter(count,"false_northing");
1485

    
1486
                        String[] parameterAcronym={"lat_1"};
1487
                        projectionParameterAcronymList.add(count,parameterAcronym);
1488
                        addProjectionParameterAcronymList(count,"lat_2");
1489
                        addProjectionParameterAcronymList(count,"lat_0");
1490
                        addProjectionParameterAcronymList(count,"lon_0");
1491
                        addProjectionParameterAcronymList(count,"x_0");
1492
                        addProjectionParameterAcronymList(count,"y_0");
1493

    
1494
                        String[] parameterDefaultValue={"0.0"};
1495
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1496
                        addProjectionParameterDefaultValue(count,"0.0");
1497
                        addProjectionParameterDefaultValue(count,"0.0");
1498
                        addProjectionParameterDefaultValue(count,"0.0");
1499
                        addProjectionParameterDefaultValue(count,"0.0");
1500
                        addProjectionParameterDefaultValue(count,"0.0");
1501

    
1502
                        String[] parameterMaxValue={"90.0"};
1503
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1504
                        addProjectionParameterMaxValue(count,"90.0");
1505
                        addProjectionParameterMaxValue(count,"90.0");
1506
                        addProjectionParameterMaxValue(count,"360.0");
1507
                        addProjectionParameterMaxValue(count,"100000000.0");
1508
                        addProjectionParameterMaxValue(count,"100000000.0");
1509

    
1510
                        String[] parameterMinValue={"-90.0"};
1511
                        projectionParameterMinValueList.add(count,parameterMinValue);
1512
                        addProjectionParameterMinValue(count,"-90.0");
1513
                        addProjectionParameterMinValue(count,"-90.0");
1514
                        addProjectionParameterMinValue(count,"-360.0");
1515
                        addProjectionParameterMinValue(count,"-100000000.0");
1516
                        addProjectionParameterMinValue(count,"-100000000.0");
1517

    
1518
                        String[] projectionAcronym={"lcc"};
1519
                        projectionAcronymList.add(count,projectionAcronym);
1520
                }
1521
                
1522
                count++;
1523
                {// Lambert_Conformal_Conic
1524
                        String[] projectionName={"Lambert_Conformal_Conic"};
1525
                        projectionNameList.add(count,projectionName);
1526
                        addProjectionName(count,"Lambert Conic Conformal");
1527
                        addProjectionName(count,"9801");
1528

    
1529
                        String[] parameterName={"latitude_of_origin"};
1530
                        projectionParameterList.add(count,parameterName);
1531
                        addProjectionParameter(count,"standard_parallel_1");
1532
                        addProjectionParameter(count,"standard_parallel_2");
1533
                        addProjectionParameter(count,"central_meridian");
1534
                        addProjectionParameter(count,"scale_factor");
1535
                        addProjectionParameter(count,"false_easting");
1536
                        addProjectionParameter(count,"false_northing");
1537

    
1538
                        String[] parameterAcronym={"lat_0"};
1539
                        projectionParameterAcronymList.add(count,parameterAcronym);
1540
                        addProjectionParameterAcronymList(count,"lat_1");
1541
                        addProjectionParameterAcronymList(count,"lat_2");
1542
                        addProjectionParameterAcronymList(count,"lon_0");
1543
                        addProjectionParameterAcronymList(count,"k_0");
1544
                        addProjectionParameterAcronymList(count,"x_0");
1545
                        addProjectionParameterAcronymList(count,"y_0");
1546

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

    
1556
                        String[] parameterMaxValue={"90.0"};
1557
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1558
                        addProjectionParameterMaxValue(count,"90.0");
1559
                        addProjectionParameterMaxValue(count,"90.0");
1560
                        addProjectionParameterMaxValue(count,"360.0");
1561
                        addProjectionParameterMaxValue(count,"10.0");
1562
                        addProjectionParameterMaxValue(count,"100000000.0");
1563
                        addProjectionParameterMaxValue(count,"100000000.0");
1564

    
1565
                        String[] parameterMinValue={"-90.0"};
1566
                        projectionParameterMinValueList.add(count,parameterMinValue);
1567
                        addProjectionParameterMinValue(count,"-90.0");
1568
                        addProjectionParameterMinValue(count,"-90.0");
1569
                        addProjectionParameterMinValue(count,"-360.0");
1570
                        addProjectionParameterMinValue(count,"0.0");
1571
                        addProjectionParameterMinValue(count,"-100000000.0");
1572
                        addProjectionParameterMinValue(count,"-100000000.0");
1573

    
1574
                        String[] projectionAcronym={"lcc"};
1575
                        projectionAcronymList.add(count,projectionAcronym);
1576
                }
1577
                
1578
                count++;
1579
                {// Lambert_Conformal_Conic_2SP_Belgium
1580
                        String[] projectionName={"Lambert_Conformal_Conic_2SP_Belgium"};
1581
                        projectionNameList.add(count,projectionName);
1582
                        addProjectionName(count,"Lambert Conic Conformal (2SP Belgium)");
1583
                        addProjectionName(count,"9803");
1584

    
1585
                        String[] parameterName={"standard_parallel_1"};
1586
                        projectionParameterList.add(count,parameterName);
1587
                        addProjectionParameter(count,"standard_parallel_2");
1588
                        addProjectionParameter(count,"latitude_of_origin");
1589
                        addProjectionParameter(count,"central_meridian");
1590
                        addProjectionParameter(count,"false_easting");
1591
                        addProjectionParameter(count,"false_northing");
1592

    
1593
                        String[] parameterAcronym={"lat_1"};
1594
                        projectionParameterAcronymList.add(count,parameterAcronym);
1595
                        addProjectionParameterAcronymList(count,"lat_2");
1596
                        addProjectionParameterAcronymList(count,"lat_0");
1597
                        addProjectionParameterAcronymList(count,"lon_0");
1598
                        addProjectionParameterAcronymList(count,"x_0");
1599
                        addProjectionParameterAcronymList(count,"y_0");
1600

    
1601
                        String[] parameterDefaultValue={"0.0"};
1602
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1603
                        addProjectionParameterDefaultValue(count,"0.0");
1604
                        addProjectionParameterDefaultValue(count,"0.0");
1605
                        addProjectionParameterDefaultValue(count,"0.0");
1606
                        addProjectionParameterDefaultValue(count,"0.0");
1607
                        addProjectionParameterDefaultValue(count,"0.0");
1608

    
1609
                        String[] parameterMaxValue={"90.0"};
1610
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1611
                        addProjectionParameterMaxValue(count,"90.0");
1612
                        addProjectionParameterMaxValue(count,"90.0");
1613
                        addProjectionParameterMaxValue(count,"360.0");
1614
                        addProjectionParameterMaxValue(count,"100000000.0");
1615
                        addProjectionParameterMaxValue(count,"100000000.0");
1616

    
1617
                        String[] parameterMinValue={"-90.0"};
1618
                        projectionParameterMinValueList.add(count,parameterMinValue);
1619
                        addProjectionParameterMinValue(count,"-90.0");
1620
                        addProjectionParameterMinValue(count,"-90.0");
1621
                        addProjectionParameterMinValue(count,"-360.0");
1622
                        addProjectionParameterMinValue(count,"-100000000.0");
1623
                        addProjectionParameterMinValue(count,"-100000000.0");
1624

    
1625
                        String[] projectionAcronym={"lcc"};
1626
                        projectionAcronymList.add(count,projectionAcronym);
1627
                }
1628

    
1629
                count++;
1630
                {// Loximuthal
1631
                        String[] projectionName={"Loximuthal"};
1632
                        projectionNameList.add(count,projectionName);
1633
                        //addProjectionName(count,"Winkel I");
1634

    
1635
                        String[] parameterName={"central_meridian"};
1636
                        projectionParameterList.add(count,parameterName);
1637
                        addProjectionParameter(count,"Central_Parallel");
1638
                        addProjectionParameter(count,"false_easting");
1639
                        addProjectionParameter(count,"false_northing");
1640

    
1641
                        String[] parameterAcronym={"lon_0"};
1642
                        projectionParameterAcronymList.add(count,parameterAcronym);
1643
                        addProjectionParameterAcronymList(count,"lat_1");
1644
                        addProjectionParameterAcronymList(count,"x_0");
1645
                        addProjectionParameterAcronymList(count,"y_0");
1646

    
1647
                        String[] parameterDefaultValue={"0.0"};
1648
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1649
                        addProjectionParameterDefaultValue(count,"0.0");
1650
                        addProjectionParameterDefaultValue(count,"0.0");
1651
                        addProjectionParameterDefaultValue(count,"0.0");
1652

    
1653
                        String[] parameterMaxValue={"360.0"};
1654
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1655
                        addProjectionParameterMaxValue(count,"90.0");
1656
                        addProjectionParameterMaxValue(count,"100000000.0");
1657
                        addProjectionParameterMaxValue(count,"100000000.0");
1658

    
1659
                        String[] parameterMinValue={"-360.0"};
1660
                        projectionParameterMinValueList.add(count,parameterMinValue);
1661
                        addProjectionParameterMinValue(count,"-90.0");
1662
                        addProjectionParameterMinValue(count,"-100000000.0");
1663
                        addProjectionParameterMinValue(count,"-100000000.0");
1664

    
1665
                        String[] projectionAcronym={"loxim"};
1666
                        projectionAcronymList.add(count,projectionAcronym);
1667
                }
1668
                
1669
                count++;
1670
                {// Mercator_1SP
1671
                        String[] projectionName={"Mercator_1SP"};
1672
                        projectionNameList.add(count,projectionName);
1673
                        addProjectionName(count,"Mercator");
1674
                        addProjectionName(count,"Wright");
1675
                        addProjectionName(count,"9804");
1676
                        addProjectionName(count, "Mercator (1SP)");
1677
                        addProjectionName(count, "Mercator_(1SP)");
1678
                        addProjectionName(count,"Mercator_(variant_A)");
1679

    
1680
                        String[] parameterName={"central_meridian"};
1681
                        projectionParameterList.add(count,parameterName);
1682
                        addProjectionParameter(count,"latitude_of_origin");  // o latitude_origin
1683
                        addProjectionParameter(count,"scale_factor");
1684
                        addProjectionParameter(count,"false_easting");
1685
                        addProjectionParameter(count,"false_northing");
1686

    
1687
                        String[] parameterAcronym={"lon_0"};
1688
                        projectionParameterAcronymList.add(count,parameterAcronym);
1689
                        addProjectionParameterAcronymList(count,"lat_ts");
1690
                        addProjectionParameterAcronymList(count,"k");
1691
                        addProjectionParameterAcronymList(count,"x_0");
1692
                        addProjectionParameterAcronymList(count,"y_0");
1693

    
1694
                        String[] parameterDefaultValue={"0.0"};
1695
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1696
                        addProjectionParameterDefaultValue(count,"0.0"); // o 0.0
1697
                        addProjectionParameterDefaultValue(count,"1.0"); // o 0.0
1698
                        addProjectionParameterDefaultValue(count,"0.0");
1699
                        addProjectionParameterDefaultValue(count,"0.0");
1700

    
1701
                        String[] parameterMaxValue={"360.0"};
1702
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1703
                        addProjectionParameterMaxValue(count,"90.0");
1704
                        addProjectionParameterMaxValue(count,"10.0");
1705
                        addProjectionParameterMaxValue(count,"100000000.0");
1706
                        addProjectionParameterMaxValue(count,"100000000.0");
1707

    
1708
                        String[] parameterMinValue={"-360.0"};
1709
                        projectionParameterMinValueList.add(count,parameterMinValue);
1710
                        addProjectionParameterMinValue(count,"-90.0");
1711
                        addProjectionParameterMinValue(count,"0.0");
1712
                        addProjectionParameterMinValue(count,"-100000000.0");
1713
                        addProjectionParameterMinValue(count,"-100000000.0");
1714

    
1715
                        String[] projectionAcronym={"merc"};
1716
                        projectionAcronymList.add(count,projectionAcronym);
1717
                }
1718
                
1719
                count++;
1720
                {// Mercator_2SP
1721
                        String[] projectionName={"Mercator_2SP"};
1722
                        projectionNameList.add(count,projectionName);
1723
                        addProjectionName(count,"Mercator");
1724
                        addProjectionName(count,"9805");
1725
                        addProjectionName(count, "Mercator (2SP)");
1726
                        addProjectionName(count, "Mercator_(variant_B)");
1727

    
1728
                        String[] parameterName={"central_meridian"};
1729
                        projectionParameterList.add(count,parameterName);
1730
                        addProjectionParameter(count,"standard_parallel_1");
1731
                        addProjectionParameter(count,"false_easting");
1732
                        addProjectionParameter(count,"false_northing");
1733

    
1734
                        String[] parameterAcronym={"lon_0"};
1735
                        projectionParameterAcronymList.add(count,parameterAcronym);
1736
                        addProjectionParameterAcronymList(count,"lat_ts");
1737
                        addProjectionParameterAcronymList(count,"x_0");
1738
                        addProjectionParameterAcronymList(count,"y_0");
1739

    
1740
                        String[] parameterDefaultValue={"0.0"};
1741
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1742
                        addProjectionParameterDefaultValue(count,"0.0"); // o 0.0
1743
                        addProjectionParameterDefaultValue(count,"0.0");
1744
                        addProjectionParameterDefaultValue(count,"0.0");
1745

    
1746
                        String[] parameterMaxValue={"360.0"};
1747
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1748
                        addProjectionParameterMaxValue(count,"90.0");
1749
                        addProjectionParameterMaxValue(count,"100000000.0");
1750
                        addProjectionParameterMaxValue(count,"100000000.0");
1751

    
1752
                        String[] parameterMinValue={"-360.0"};
1753
                        projectionParameterMinValueList.add(count,parameterMinValue);
1754
                        addProjectionParameterMinValue(count,"-90.0");
1755
                        addProjectionParameterMinValue(count,"-100000000.0");
1756
                        addProjectionParameterMinValue(count,"-100000000.0");
1757

    
1758
                        String[] projectionAcronym={"merc"};
1759
                        projectionAcronymList.add(count,projectionAcronym);
1760
                }
1761

    
1762
                count++;
1763
                {// Miller_Cylindrical
1764
                        String[] projectionName={"Miller_Cylindrical"};
1765
                        projectionNameList.add(count,projectionName);
1766
                        addProjectionName(count,"Miller Cylindrical");
1767

    
1768
                        String[] parameterName={"latitude_of_center"};
1769
                        projectionParameterList.add(count,parameterName);
1770
                        addProjectionParameter(count,"longitude_of_center");
1771
                        addProjectionParameter(count,"false_easting");
1772
                        addProjectionParameter(count,"false_northing");
1773

    
1774
                        String[] parameterAcronym={"lat_0"};
1775
                        projectionParameterAcronymList.add(count,parameterAcronym);
1776
                        addProjectionParameterAcronymList(count,"lon_0");
1777
                        addProjectionParameterAcronymList(count,"x_0");
1778
                        addProjectionParameterAcronymList(count,"y_0");
1779

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

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

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

    
1798
                        String[] projectionAcronym={"mill"};
1799
                        projectionAcronymList.add(count,projectionAcronym);
1800
                }
1801
                
1802
                count++;
1803
                {// Mollweide
1804
                        String[] projectionName={"Mollweide"};
1805
                        projectionNameList.add(count,projectionName);
1806
                        addProjectionName(count,"Homolographic");
1807
                        addProjectionName(count,"Homalographic");
1808
                        addProjectionName(count,"Babinet");
1809
                        addProjectionName(count,"Elliptical");
1810

    
1811
                        String[] parameterName={"central_meridian"};
1812
                        projectionParameterList.add(count,parameterName);
1813
                        addProjectionParameter(count,"false_easting");
1814
                        addProjectionParameter(count,"false_northing");
1815

    
1816
                        String[] parameterAcronym={"lon_0"};
1817
                        projectionParameterAcronymList.add(count,parameterAcronym);
1818
                        addProjectionParameterAcronymList(count,"x_0");
1819
                        addProjectionParameterAcronymList(count,"y_0");
1820

    
1821
                        String[] parameterDefaultValue={"0.0"};
1822
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1823
                        addProjectionParameterDefaultValue(count,"0.0");
1824
                        addProjectionParameterDefaultValue(count,"0.0");
1825

    
1826
                        String[] parameterMaxValue={"360.0"};
1827
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1828
                        addProjectionParameterMaxValue(count,"100000000.0");
1829
                        addProjectionParameterMaxValue(count,"100000000.0");
1830

    
1831
                        String[] parameterMinValue={"-360.0"};
1832
                        projectionParameterMinValueList.add(count,parameterMinValue);
1833
                        addProjectionParameterMinValue(count,"-100000000.0");
1834
                        addProjectionParameterMinValue(count,"-100000000.0");
1835

    
1836
                        String[] projectionAcronym={"moll"};
1837
                        projectionAcronymList.add(count,projectionAcronym);
1838
                }
1839
                
1840
                count++;
1841
                {// Near-Sided Perspective
1842
                        String[] projectionName={"Near_Sided_Perspective"};
1843
                        projectionNameList.add(count,projectionName);
1844
                        addProjectionName(count,"Near Sided Perspective");
1845
                        addProjectionName(count,"Near-Sided Perspective");
1846
                        addProjectionName(count,"Near-Sided-Perspective");
1847
                        addProjectionName(count,"Near-Sided_Perspective");
1848
                        addProjectionName(count,"Vertical Near Side Perspective");
1849
                        addProjectionName(count,"Vertical-Near-Side-Perspective");
1850
                        addProjectionName(count,"Vertical_Near_Side_Perspective");
1851
                        
1852
                        String[] parameterName={"latitude_of_center"};
1853
                        projectionParameterList.add(count,parameterName);
1854
                        addProjectionParameter(count,"longitude_of_center");
1855
                        addProjectionParameter(count,"Height");
1856
                        addProjectionParameter(count,"false_easting");
1857
                        addProjectionParameter(count,"false_northing");
1858

    
1859
                        String[] parameterAcronym={"lat_0"};
1860
                        projectionParameterAcronymList.add(count,parameterAcronym);
1861
                        addProjectionParameterAcronymList(count,"lon_0");
1862
                        addProjectionParameterAcronymList(count,"h");
1863
                        addProjectionParameterAcronymList(count,"x_0");
1864
                        addProjectionParameterAcronymList(count,"y_0");
1865

    
1866
                        String[] parameterDefaultValue={"0.0"};
1867
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1868
                        addProjectionParameterDefaultValue(count,"0.0");
1869
                        addProjectionParameterDefaultValue(count,"0.001");
1870
                        addProjectionParameterDefaultValue(count,"0.0");
1871
                        addProjectionParameterDefaultValue(count,"0.0");
1872

    
1873
                        String[] parameterMaxValue={"90.0"};
1874
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1875
                        addProjectionParameterMaxValue(count,"360.0");
1876
                        addProjectionParameterMaxValue(count,"100000000.0");
1877
                        addProjectionParameterMaxValue(count,"100000000.0");
1878
                        addProjectionParameterMaxValue(count,"100000000.0");
1879

    
1880
                        String[] parameterMinValue={"-90.0"};
1881
                        projectionParameterMinValueList.add(count,parameterMinValue);
1882
                        addProjectionParameterMinValue(count,"-360.0");
1883
                        addProjectionParameterMinValue(count,"0.001");
1884
                        addProjectionParameterMinValue(count,"-100000000.0");
1885
                        addProjectionParameterMinValue(count,"-100000000.0");
1886

    
1887
                        String[] projectionAcronym={"nsper"};
1888
                        projectionAcronymList.add(count,projectionAcronym);
1889
                }
1890

    
1891
                count++;
1892
                {// New_Zealand_Map_Grid
1893
                        String[] projectionName={"New_Zealand_Map_Grid"};
1894
                        projectionNameList.add(count,projectionName);
1895
                        addProjectionName(count,"New Zealand Map Grid");
1896
                        addProjectionName(count,"9811");
1897

    
1898
                        String[] parameterName={"latitude_of_origin"};
1899
                        projectionParameterList.add(count,parameterName);
1900
                        addProjectionParameter(count,"central_meridian");
1901
                        addProjectionParameter(count,"false_easting");
1902
                        addProjectionParameter(count,"false_northing");
1903

    
1904
                        String[] parameterAcronym={"lat_0"};
1905
                        projectionParameterAcronymList.add(count,parameterAcronym);
1906
                        addProjectionParameterAcronymList(count,"lon_0");
1907
                        addProjectionParameterAcronymList(count,"x_0");
1908
                        addProjectionParameterAcronymList(count,"y_0");
1909

    
1910
                        String[] parameterDefaultValue={"0.0"};
1911
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1912
                        addProjectionParameterDefaultValue(count,"0.0");
1913
                        addProjectionParameterDefaultValue(count,"0.0");
1914
                        addProjectionParameterDefaultValue(count,"0.0");
1915

    
1916
                        String[] parameterMaxValue={"90.0"};
1917
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1918
                        addProjectionParameterMaxValue(count,"360.0");
1919
                        addProjectionParameterMaxValue(count,"100000000.0");
1920
                        addProjectionParameterMaxValue(count,"100000000.0");
1921

    
1922
                        String[] parameterMinValue={"-90.0"};
1923
                        projectionParameterMinValueList.add(count,parameterMinValue);
1924
                        addProjectionParameterMinValue(count,"-360.0");
1925
                        addProjectionParameterMinValue(count,"-100000000.0");
1926
                        addProjectionParameterMinValue(count,"-100000000.0");
1927

    
1928
                        String[] projectionAcronym={"nzmg"};
1929
                        projectionAcronymList.add(count,projectionAcronym);
1930
                }
1931

    
1932
                count++;
1933
                {// Oblique_Mercator
1934
                        String[] projectionName={"Oblique_Mercator"};
1935
                        projectionNameList.add(count,projectionName);
1936
                        addProjectionName(count,"Oblique Mercator");
1937
                        addProjectionName(count,"9815");
1938
                        addProjectionName(count,"CT_ObliqueMercator");
1939
                        addProjectionName(count,"Hotine_Oblique_Mercator_Azimuth_Center");
1940
                        addProjectionName(count,"Rectified_Skew_Orthomorphic_Center");
1941
                        addProjectionName(count,"Hotine Oblique Mercator");
1942
                        addProjectionName(count,"Hotine_Oblique_Mercator");
1943
                        addProjectionName(count,"Hotine_Oblique_Mercator_(variant_B)");
1944

    
1945
                        String[] parameterName={"latitude_of_center"};
1946
                        projectionParameterList.add(count,parameterName);
1947
                        addProjectionParameter(count,"longitude_of_center");
1948
                        addProjectionParameter(count,"azimuth");
1949
                        addProjectionParameter(count,"rectified_grid_angle");
1950
                        addProjectionParameter(count,"scale_factor");
1951
                        addProjectionParameter(count,"false_easting");
1952
                        addProjectionParameter(count,"false_northing");
1953

    
1954
                        String[] parameterAcronym={"lat_0"};
1955
                        projectionParameterAcronymList.add(count,parameterAcronym);
1956
                        addProjectionParameterAcronymList(count,"lonc");
1957
                        addProjectionParameterAcronymList(count,"alpha");
1958
                        addProjectionParameterAcronymList(count,"gamma");
1959
                        addProjectionParameterAcronymList(count,"k");
1960
                        addProjectionParameterAcronymList(count,"x_0");
1961
                        addProjectionParameterAcronymList(count,"y_0");
1962

    
1963
                        String[] parameterDefaultValue={"0.0"};
1964
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1965
                        addProjectionParameterDefaultValue(count,"0.0");
1966
                        addProjectionParameterDefaultValue(count,"0.0");
1967
                        addProjectionParameterDefaultValue(count,"0.0");
1968
                        addProjectionParameterDefaultValue(count,"1.0");
1969
                        addProjectionParameterDefaultValue(count,"0.0");
1970
                        addProjectionParameterDefaultValue(count,"0.0");
1971

    
1972
                        String[] parameterMaxValue={"90.0"};
1973
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1974
                        addProjectionParameterMaxValue(count,"360.0");
1975
                        addProjectionParameterMaxValue(count,"360.0");
1976
                        addProjectionParameterMaxValue(count,"360.0");
1977
                        addProjectionParameterMaxValue(count,"10.0");
1978
                        addProjectionParameterMaxValue(count,"100000000.0");
1979
                        addProjectionParameterMaxValue(count,"100000000.0");
1980

    
1981
                        String[] parameterMinValue={"-90.0"};
1982
                        projectionParameterMinValueList.add(count,parameterMinValue);
1983
                        addProjectionParameterMinValue(count,"-360.0");
1984
                        addProjectionParameterMinValue(count,"-360.0");
1985
                        addProjectionParameterMinValue(count,"-360.0");
1986
                        addProjectionParameterMinValue(count,"0.0");
1987
                        addProjectionParameterMinValue(count,"-100000000.0");
1988
                        addProjectionParameterMinValue(count,"-100000000.0");
1989

    
1990
                        String[] projectionAcronym={"omerc"};
1991
                        projectionAcronymList.add(count,projectionAcronym);
1992
                }
1993

    
1994
                count++;
1995
                {// Oblique_Mercator
1996
                        String[] projectionName={"Hotine_Oblique_Mercator_Two_Point_Center"};
1997
                        projectionNameList.add(count,projectionName);
1998
                        addProjectionName(count,"Hotine_Oblique_Mercator_Two_Point_Natural_Origin");
1999

    
2000
            /*SEMI_MAJOR,          SEMI_MINOR,
2001
            LAT_OF_1ST_POINT,    LONG_OF_1ST_POINT,
2002
            LAT_OF_2ND_POINT,    LONG_OF_2ND_POINT,
2003
                    LAT_OF_CENTRE,       SCALE_FACTOR_LOCAL,
2004
            FALSE_EASTING_LOCAL,       FALSE_NORTHING_LOCAL*/
2005

    
2006
            String[] parameterName={"Latitude_Of_1st_Point"};
2007
                        projectionParameterList.add(count,parameterName);
2008
                        addProjectionParameter(count,"Longitude_Of_1st_Point");
2009
                        addProjectionParameter(count,"Latitude_Of_2nd_Point");
2010
                        addProjectionParameter(count,"Longitude_Of_2nd_Point");
2011
                        addProjectionParameter(count,"scale_factor");
2012
                        addProjectionParameter(count,"false_easting");
2013
                        addProjectionParameter(count,"false_northing");
2014

    
2015
                        String[] parameterAcronym={"lat_1"};
2016
                        projectionParameterAcronymList.add(count,parameterAcronym);
2017
                        addProjectionParameterAcronymList(count,"lon_1");
2018
                        addProjectionParameterAcronymList(count,"lat_2");
2019
                        addProjectionParameterAcronymList(count,"lon_2");
2020
                        addProjectionParameterAcronymList(count,"k");
2021
                        addProjectionParameterAcronymList(count,"x_0");
2022
                        addProjectionParameterAcronymList(count,"y_0");
2023

    
2024
                        String[] parameterDefaultValue={"0.0"};
2025
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2026
                        addProjectionParameterDefaultValue(count,"0.0");
2027
                        addProjectionParameterDefaultValue(count,"0.0");
2028
                        addProjectionParameterDefaultValue(count,"0.0");
2029
                        addProjectionParameterDefaultValue(count,"1.0");
2030
                        addProjectionParameterDefaultValue(count,"0.0");
2031
                        addProjectionParameterDefaultValue(count,"0.0");
2032

    
2033
                        String[] parameterMaxValue={"90.0"};
2034
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2035
                        addProjectionParameterMaxValue(count,"360.0");
2036
                        addProjectionParameterMaxValue(count,"90.0");
2037
                        addProjectionParameterMaxValue(count,"360.0");
2038
                        addProjectionParameterMaxValue(count,"10.0");
2039
                        addProjectionParameterMaxValue(count,"100000000.0");
2040
                        addProjectionParameterMaxValue(count,"100000000.0");
2041

    
2042
                        String[] parameterMinValue={"-90.0"};
2043
                        projectionParameterMinValueList.add(count,parameterMinValue);
2044
                        addProjectionParameterMinValue(count,"-360.0");
2045
                        addProjectionParameterMinValue(count,"-90.0");
2046
                        addProjectionParameterMinValue(count,"-360.0");
2047
                        addProjectionParameterMinValue(count,"0.0");
2048
                        addProjectionParameterMinValue(count,"-100000000.0");
2049
                        addProjectionParameterMinValue(count,"-100000000.0");
2050

    
2051
                        String[] projectionAcronym={"omerc"};
2052
                        projectionAcronymList.add(count,projectionAcronym);
2053
                }
2054

    
2055
                count++;
2056
                {// Oblique_Stereographic
2057
                        String[] projectionName={"Oblique_Stereographic"};
2058
                        projectionNameList.add(count,projectionName);
2059
                        addProjectionName(count,"Oblique Stereographic");
2060
                        addProjectionName(count,"9809");
2061

    
2062
                        String[] parameterName={"latitude_of_origin"};
2063
                        projectionParameterList.add(count,parameterName);
2064
                        addProjectionParameter(count,"central_meridian");
2065
                        addProjectionParameter(count,"scale_factor");
2066
                        addProjectionParameter(count,"false_easting");
2067
                        addProjectionParameter(count,"false_northing");
2068

    
2069
                        String[] parameterAcronym={"lat_0"};
2070
                        projectionParameterAcronymList.add(count,parameterAcronym);
2071
                        addProjectionParameterAcronymList(count,"lon_0");
2072
                        addProjectionParameterAcronymList(count,"k");
2073
                        addProjectionParameterAcronymList(count,"x_0");
2074
                        addProjectionParameterAcronymList(count,"y_0");
2075

    
2076
                        String[] parameterDefaultValue={"0.0"};
2077
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2078
                        addProjectionParameterDefaultValue(count,"0.0");
2079
                        addProjectionParameterDefaultValue(count,"1.0");
2080
                        addProjectionParameterDefaultValue(count,"0.0");
2081
                        addProjectionParameterDefaultValue(count,"0.0");
2082

    
2083
                        String[] parameterMaxValue={"90.0"};
2084
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2085
                        addProjectionParameterMaxValue(count,"360.0");
2086
                        addProjectionParameterMaxValue(count,"10.0");
2087
                        addProjectionParameterMaxValue(count,"100000000.0");
2088
                        addProjectionParameterMaxValue(count,"100000000.0");
2089

    
2090
                        String[] parameterMinValue={"-90.0"};
2091
                        projectionParameterMinValueList.add(count,parameterMinValue);
2092
                        addProjectionParameterMinValue(count,"-360.0");
2093
                        addProjectionParameterMinValue(count,"0.0");
2094
                        addProjectionParameterMinValue(count,"-100000000.0");
2095
                        addProjectionParameterMinValue(count,"-100000000.0");
2096

    
2097
                        String[] projectionAcronym={"sterea"};
2098
                        projectionAcronymList.add(count,projectionAcronym);
2099
                }
2100

    
2101
                count++;
2102
                {// Orthographic
2103
                        String[] projectionName={"Orthographic"};
2104
                        projectionNameList.add(count,projectionName);
2105

    
2106
                        String[] parameterName={"latitude_of_origin"};
2107
                        projectionParameterList.add(count,parameterName);
2108
                        addProjectionParameter(count,"central_meridian");
2109
                        addProjectionParameter(count,"false_easting");
2110
                        addProjectionParameter(count,"false_northing");
2111

    
2112
                        String[] parameterAcronym={"lat_0"};
2113
                        projectionParameterAcronymList.add(count,parameterAcronym);
2114
                        addProjectionParameterAcronymList(count,"lon_0");
2115
                        addProjectionParameterAcronymList(count,"x_0");
2116
                        addProjectionParameterAcronymList(count,"y_0");
2117

    
2118
                        String[] parameterDefaultValue={"0.0"};
2119
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2120
                        addProjectionParameterDefaultValue(count,"0.0");
2121
                        addProjectionParameterDefaultValue(count,"0.0");
2122
                        addProjectionParameterDefaultValue(count,"0.0");
2123

    
2124
                        String[] parameterMaxValue={"90.0"};
2125
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2126
                        addProjectionParameterMaxValue(count,"360.0");
2127
                        addProjectionParameterMaxValue(count,"100000000.0");
2128
                        addProjectionParameterMaxValue(count,"100000000.0");
2129

    
2130
                        String[] parameterMinValue={"-90.0"};
2131
                        projectionParameterMinValueList.add(count,parameterMinValue);
2132
                        addProjectionParameterMinValue(count,"-360.0");
2133
                        addProjectionParameterMinValue(count,"-100000000.0");
2134
                        addProjectionParameterMinValue(count,"-100000000.0");
2135

    
2136
                        String[] projectionAcronym={"ortho"};
2137
                        projectionAcronymList.add(count,projectionAcronym);
2138
                }
2139

    
2140
                count++;
2141
                {// Polar_Stereographic
2142
                        String[] projectionName={"Polar_Stereographic"};
2143
                        projectionNameList.add(count,projectionName);
2144
                        addProjectionName(count,"Polar Stereographic");
2145
                        addProjectionName(count,"Polar_Stereographic_(variant_A)");
2146
                        addProjectionName(count,"Polar_Stereographic_(variant_B)");
2147
                        addProjectionName(count,"9810");
2148
                        addProjectionName(count,"9829");
2149

    
2150
                        String[] parameterName={"latitude_of_origin"};
2151
                        projectionParameterList.add(count,parameterName);
2152
                        addProjectionParameter(count,"latitude_of_standard_parallel");
2153
                        addProjectionParameter(count,"central_meridian");
2154
                        addProjectionParameter(count,"scale_factor");
2155
                        addProjectionParameter(count,"false_easting");
2156
                        addProjectionParameter(count,"false_northing");
2157

    
2158
                        String[] parameterAcronym={"lat_0"};
2159
                        //lat_0=90 o lat_0=-90
2160
                        projectionParameterAcronymList.add(count,parameterAcronym);
2161
                        addProjectionParameterAcronymList(count,"lat_ts");
2162
                        addProjectionParameterAcronymList(count,"lon_0");
2163
                        addProjectionParameterAcronymList(count,"k_0");
2164
                        addProjectionParameterAcronymList(count,"x_0");
2165
                        addProjectionParameterAcronymList(count,"y_0");
2166

    
2167
                        String[] parameterDefaultValue={"90.0"};
2168
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2169
                        addProjectionParameterDefaultValue(count,"90.0");
2170
                        addProjectionParameterDefaultValue(count,"0.0");
2171
                        addProjectionParameterDefaultValue(count,"1.0");
2172
                        addProjectionParameterDefaultValue(count,"0.0");
2173
                        addProjectionParameterDefaultValue(count,"0.0");
2174

    
2175
                        String[] parameterMaxValue={"90.0"};
2176
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2177
                        addProjectionParameterMaxValue(count,"90.0");
2178
                        addProjectionParameterMaxValue(count,"360.0");
2179
                        addProjectionParameterMaxValue(count,"10.0");
2180
                        addProjectionParameterMaxValue(count,"100000000.0");
2181
                        addProjectionParameterMaxValue(count,"100000000.0");
2182

    
2183
                        String[] parameterMinValue={"-90.0"};
2184
                        projectionParameterMinValueList.add(count,parameterMinValue);
2185
                        addProjectionParameterMinValue(count,"-90.0");
2186
                        addProjectionParameterMinValue(count,"-360.0");
2187
                        addProjectionParameterMinValue(count,"0.0");
2188
                        addProjectionParameterMinValue(count,"-100000000.0");
2189
                        addProjectionParameterMinValue(count,"-100000000.0");
2190

    
2191
                        String[] projectionAcronym={"stere"};
2192
                        projectionAcronymList.add(count,projectionAcronym);
2193
                }
2194

    
2195
                count++;
2196
                {// Polyconic
2197
                        String[] projectionName={"Polyconic"};
2198
                        projectionNameList.add(count,projectionName);
2199
                        addProjectionName(count,"American_Polyconic");
2200
                        addProjectionName(count,"American Polyconic");
2201
                        addProjectionName(count,"9818");
2202

    
2203
                        String[] parameterName={"latitude_of_origin"};
2204
                        projectionParameterList.add(count,parameterName);
2205
                        addProjectionParameter(count,"central_meridian");
2206
                        addProjectionParameter(count,"false_easting");
2207
                        addProjectionParameter(count,"false_northing");
2208

    
2209
                        String[] parameterAcronym={"lat_0"};
2210
                        projectionParameterAcronymList.add(count,parameterAcronym);
2211
                        addProjectionParameterAcronymList(count,"lon_0");
2212
                        addProjectionParameterAcronymList(count,"x_0");
2213
                        addProjectionParameterAcronymList(count,"y_0");
2214

    
2215
                        String[] parameterDefaultValue={"0.0"};
2216
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2217
                        addProjectionParameterDefaultValue(count,"0.0");
2218
                        addProjectionParameterDefaultValue(count,"0.0");
2219
                        addProjectionParameterDefaultValue(count,"0.0");
2220

    
2221
                        String[] parameterMaxValue={"90.0"};
2222
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2223
                        addProjectionParameterMaxValue(count,"360.0");
2224
                        addProjectionParameterMaxValue(count,"100000000.0");
2225
                        addProjectionParameterMaxValue(count,"100000000.0");
2226

    
2227
                        String[] parameterMinValue={"-90.0"};
2228
                        projectionParameterMinValueList.add(count,parameterMinValue);
2229
                        addProjectionParameterMinValue(count,"-360.0");
2230
                        addProjectionParameterMinValue(count,"-100000000.0");
2231
                        addProjectionParameterMinValue(count,"-100000000.0");
2232

    
2233
                        String[] projectionAcronym={"poly"};
2234
                        projectionAcronymList.add(count,projectionAcronym);
2235
                }
2236

    
2237
                count++;
2238
                {// Quartic Authalic
2239
                        String[] projectionName={"Quartic_Authalic"};
2240
                        projectionNameList.add(count,projectionName);
2241
                        addProjectionName(count,"Quartic Authalic");
2242
                        addProjectionName(count,"Quartic-Authalic");
2243

    
2244
                        String[] parameterName={"central_meridian"};
2245
                        projectionParameterList.add(count,parameterName);
2246
                        addProjectionParameter(count,"false_easting");
2247
                        addProjectionParameter(count,"false_northing");
2248

    
2249
                        String[] parameterAcronym={"lon_0"};
2250
                        projectionParameterAcronymList.add(count,parameterAcronym);
2251
                        addProjectionParameterAcronymList(count,"x_0");
2252
                        addProjectionParameterAcronymList(count,"y_0");
2253

    
2254
                        String[] parameterDefaultValue={"0.0"};
2255
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2256
                        addProjectionParameterDefaultValue(count,"0.0");
2257
                        addProjectionParameterDefaultValue(count,"0.0");
2258

    
2259
                        String[] parameterMaxValue={"360.0"};
2260
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2261
                        addProjectionParameterMaxValue(count,"100000000.0");
2262
                        addProjectionParameterMaxValue(count,"100000000.0");
2263

    
2264
                        String[] parameterMinValue={"-360.0"};
2265
                        projectionParameterMinValueList.add(count,parameterMinValue);
2266
                        addProjectionParameterMinValue(count,"-100000000.0");
2267
                        addProjectionParameterMinValue(count,"-100000000.0");
2268

    
2269
                        String[] projectionAcronym={"qua_aut"};
2270
                        projectionAcronymList.add(count,projectionAcronym);
2271
                }
2272

    
2273
                count++;
2274
                {// Robinson
2275
                        String[] projectionName={"Robinson"};
2276
                        projectionNameList.add(count,projectionName);
2277
                        addProjectionName(count,"Orthophanic");
2278

    
2279
                        String[] parameterName={"longitude_of_center"};
2280
                        projectionParameterList.add(count,parameterName);
2281
                        addProjectionParameter(count,"false_easting");
2282
                        addProjectionParameter(count,"false_northing");
2283

    
2284
                        String[] parameterAcronym={"lon_0"};
2285
                        projectionParameterAcronymList.add(count,parameterAcronym);
2286
                        addProjectionParameterAcronymList(count,"x_0");
2287
                        addProjectionParameterAcronymList(count,"y_0");
2288

    
2289
                        String[] parameterDefaultValue={"0.0"};
2290
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2291
                        addProjectionParameterDefaultValue(count,"0.0");
2292
                        addProjectionParameterDefaultValue(count,"0.0");
2293

    
2294
                        String[] parameterMaxValue={"360.0"};
2295
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2296
                        addProjectionParameterMaxValue(count,"100000000.0");
2297
                        addProjectionParameterMaxValue(count,"100000000.0");
2298

    
2299
                        String[] parameterMinValue={"-360.0"};
2300
                        projectionParameterMinValueList.add(count,parameterMinValue);
2301
                        addProjectionParameterMinValue(count,"-100000000.0");
2302
                        addProjectionParameterMinValue(count,"-100000000.0");
2303

    
2304
                        String[] projectionAcronym={"robin"};
2305
                        projectionAcronymList.add(count,projectionAcronym);
2306
                }
2307

    
2308
                //         Rosenmund Oblique Mercator - No en EPSG
2309

    
2310
                count++;
2311
                {// Sinusoidal
2312
                        String[] projectionName={"Sinusoidal"};
2313
                        projectionNameList.add(count,projectionName);
2314
                        addProjectionName(count,"Sanson-Flamsteed");
2315
                        addProjectionName(count,"Sanson Flamsteed");
2316
                        addProjectionName(count,"Sanson_Flamsteed");
2317
                        addProjectionName(count,"Mercator equal area");
2318
                        addProjectionName(count,"Mercator_equal_area");
2319

    
2320
                        String[] parameterName={"longitude_of_center"};
2321
                        projectionParameterList.add(count,parameterName);
2322
                        addProjectionParameter(count,"false_easting");
2323
                        addProjectionParameter(count,"false_northing");
2324

    
2325
                        String[] parameterAcronym={"lon_0"};
2326
                        projectionParameterAcronymList.add(count,parameterAcronym);
2327
                        addProjectionParameterAcronymList(count,"x_0");
2328
                        addProjectionParameterAcronymList(count,"y_0");
2329

    
2330
                        String[] parameterDefaultValue={"0.0"};
2331
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2332
                        addProjectionParameterDefaultValue(count,"0.0");
2333
                        addProjectionParameterDefaultValue(count,"0.0");
2334

    
2335
                        String[] parameterMaxValue={"360.0"};
2336
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2337
                        addProjectionParameterMaxValue(count,"100000000.0");
2338
                        addProjectionParameterMaxValue(count,"100000000.0");
2339

    
2340
                        String[] parameterMinValue={"-360.0"};
2341
                        projectionParameterMinValueList.add(count,parameterMinValue);
2342
                        addProjectionParameterMinValue(count,"-100000000.0");
2343
                        addProjectionParameterMinValue(count,"-100000000.0");
2344

    
2345
                        String[] projectionAcronym={"sinu"};
2346
                        projectionAcronymList.add(count,projectionAcronym);
2347
                }
2348

    
2349
                count++;
2350
                {// Swiss_Oblique_Cylindrical
2351
                        String[] projectionName={"Swiss_Oblique_Cylindrical"};
2352
                        projectionNameList.add(count,projectionName);
2353
                        addProjectionName(count,"Swiss Oblique Cylindrical");
2354
                        addProjectionName(count,"Swiss Oblique Mercator");
2355
                        addProjectionName(count,"9814");
2356

    
2357
                        String[] parameterName={"latitude_of_origin"};
2358
                        projectionParameterList.add(count,parameterName);
2359
                        addProjectionParameter(count,"central_meridian");
2360
                        addProjectionParameter(count,"false_easting");
2361
                        addProjectionParameter(count,"false_northing");
2362

    
2363
                        String[] parameterAcronym={"lat_0"};
2364
                        projectionParameterAcronymList.add(count,parameterAcronym);
2365
                        addProjectionParameterAcronymList(count,"lon_0");
2366
                        addProjectionParameterAcronymList(count,"x_0");
2367
                        addProjectionParameterAcronymList(count,"y_0");
2368

    
2369
                        String[] parameterDefaultValue={"0.0"};
2370
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2371
                        addProjectionParameterDefaultValue(count,"0.0");
2372
                        addProjectionParameterDefaultValue(count,"0.0");
2373
                        addProjectionParameterDefaultValue(count,"0.0");
2374

    
2375
                        String[] parameterMaxValue={"90.0"};
2376
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2377
                        addProjectionParameterMaxValue(count,"360.0");
2378
                        addProjectionParameterMaxValue(count,"100000000.0");
2379
                        addProjectionParameterMaxValue(count,"100000000.0");
2380

    
2381
                        String[] parameterMinValue={"-90.0"};
2382
                        projectionParameterMinValueList.add(count,parameterMinValue);
2383
                        addProjectionParameterMinValue(count,"-360.0");
2384
                        addProjectionParameterMinValue(count,"-100000000.0");
2385
                        addProjectionParameterMinValue(count,"-100000000.0");
2386

    
2387
                        String[] projectionAcronym={"somerc"};
2388
                        projectionAcronymList.add(count,projectionAcronym);
2389
                }
2390

    
2391
                count++;
2392
                {// Stereographic
2393
                        String[] projectionName={"Stereographic"};
2394
                        projectionNameList.add(count,projectionName);
2395

    
2396
                        String[] parameterName={"latitude_of_origin"};
2397
                        projectionParameterList.add(count,parameterName);
2398
                        addProjectionParameter(count,"latitude_of_standard_parallel");
2399
                        addProjectionParameter(count,"central_meridian");
2400
                        addProjectionParameter(count,"scale_factor");
2401
                        addProjectionParameter(count,"false_easting");
2402
                        addProjectionParameter(count,"false_northing");
2403

    
2404
                        String[] parameterAcronym={"lat_0"};
2405
                        projectionParameterAcronymList.add(count,parameterAcronym);
2406
                        addProjectionParameterAcronymList(count,"lat_ts");
2407
                        addProjectionParameterAcronymList(count,"lon_0");
2408
                        addProjectionParameterAcronymList(count,"k");
2409
                        addProjectionParameterAcronymList(count,"x_0");
2410
                        addProjectionParameterAcronymList(count,"y_0");
2411

    
2412
                        String[] parameterDefaultValue={"0.0"};
2413
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2414
                        addProjectionParameterDefaultValue(count,"0.0");
2415
                        addProjectionParameterDefaultValue(count,"0.0");
2416
                        addProjectionParameterDefaultValue(count,"1.0");
2417
                        addProjectionParameterDefaultValue(count,"0.0");
2418
                        addProjectionParameterDefaultValue(count,"0.0");
2419

    
2420
                        String[] parameterMaxValue={"90.0"};
2421
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2422
                        addProjectionParameterMaxValue(count,"90.0");
2423
                        addProjectionParameterMaxValue(count,"360.0");
2424
                        addProjectionParameterMaxValue(count,"10.0");
2425
                        addProjectionParameterMaxValue(count,"100000000.0");
2426
                        addProjectionParameterMaxValue(count,"100000000.0");
2427

    
2428
                        String[] parameterMinValue={"-90.0"};
2429
                        projectionParameterMinValueList.add(count,parameterMinValue);
2430
                        addProjectionParameterMinValue(count,"-90.0");
2431
                        addProjectionParameterMinValue(count,"-360.0");
2432
                        addProjectionParameterMinValue(count,"0.0");
2433
                        addProjectionParameterMinValue(count,"-100000000.0");
2434
                        addProjectionParameterMinValue(count,"-100000000.0");
2435

    
2436
                        String[] projectionAcronym={"stere"};
2437
                        projectionAcronymList.add(count,projectionAcronym);
2438
                }
2439

    
2440
                count++;
2441
                {// Stereographic North Pole
2442
                        String[] projectionName={"Stereographic_North_Pole"};
2443
                        projectionNameList.add(count,projectionName);
2444

    
2445
                        String[] parameterName={"latitude_of_origin"};
2446
                        projectionParameterList.add(count,parameterName);
2447
                        addProjectionParameter(count,"standard_parallel_1");
2448
                        addProjectionParameter(count,"central_meridian");
2449
                        addProjectionParameter(count,"scale_factor");
2450
                        addProjectionParameter(count,"false_easting");
2451
                        addProjectionParameter(count,"false_northing");
2452

    
2453
                        String[] parameterAcronym={"lat_0"};
2454
                        projectionParameterAcronymList.add(count,parameterAcronym);
2455
                        addProjectionParameterAcronymList(count,"lat_ts");
2456
                        addProjectionParameterAcronymList(count,"lon_0");
2457
                        addProjectionParameterAcronymList(count,"k");
2458
                        addProjectionParameterAcronymList(count,"x_0");
2459
                        addProjectionParameterAcronymList(count,"y_0");
2460

    
2461
                        String[] parameterDefaultValue={"90.0"};
2462
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2463
                        addProjectionParameterDefaultValue(count,"0.0");
2464
                        addProjectionParameterDefaultValue(count,"0.0");
2465
                        addProjectionParameterDefaultValue(count,"1.0");
2466
                        addProjectionParameterDefaultValue(count,"0.0");
2467
                        addProjectionParameterDefaultValue(count,"0.0");
2468

    
2469
                        String[] parameterMaxValue={"90.0"};
2470
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2471
                        addProjectionParameterMaxValue(count,"90.0");
2472
                        addProjectionParameterMaxValue(count,"360.0");
2473
                        addProjectionParameterMaxValue(count,"10.0");
2474
                        addProjectionParameterMaxValue(count,"100000000.0");
2475
                        addProjectionParameterMaxValue(count,"100000000.0");
2476

    
2477
                        String[] parameterMinValue={"-90.0"};
2478
                        projectionParameterMinValueList.add(count,parameterMinValue);
2479
                        addProjectionParameterMinValue(count,"-90.0");
2480
                        addProjectionParameterMinValue(count,"-360.0");
2481
                        addProjectionParameterMinValue(count,"0.0");
2482
                        addProjectionParameterMinValue(count,"-100000000.0");
2483
                        addProjectionParameterMinValue(count,"-100000000.0");
2484

    
2485
                        String[] projectionAcronym={"stere"};
2486
                        projectionAcronymList.add(count,projectionAcronym);
2487
                }
2488

    
2489
                count++;
2490
                {// Stereographic South Pole
2491
                        String[] projectionName={"Stereographic_South_Pole"};
2492
                        projectionNameList.add(count,projectionName);
2493

    
2494
                        String[] parameterName={"latitude_of_origin"};
2495
                        projectionParameterList.add(count,parameterName);
2496
                        addProjectionParameter(count,"standard_parallel_1");
2497
                        addProjectionParameter(count,"central_meridian");
2498
                        addProjectionParameter(count,"scale_factor");
2499
                        addProjectionParameter(count,"false_easting");
2500
                        addProjectionParameter(count,"false_northing");
2501

    
2502
                        String[] parameterAcronym={"lat_0"};
2503
                        projectionParameterAcronymList.add(count,parameterAcronym);
2504
                        addProjectionParameterAcronymList(count,"lat_ts");
2505
                        addProjectionParameterAcronymList(count,"lon_0");
2506
                        addProjectionParameterAcronymList(count,"k");
2507
                        addProjectionParameterAcronymList(count,"x_0");
2508
                        addProjectionParameterAcronymList(count,"y_0");
2509

    
2510
                        String[] parameterDefaultValue={"-90.0"};
2511
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2512
                        addProjectionParameterDefaultValue(count,"0.0");
2513
                        addProjectionParameterDefaultValue(count,"0.0");
2514
                        addProjectionParameterDefaultValue(count,"1.0");
2515
                        addProjectionParameterDefaultValue(count,"0.0");
2516
                        addProjectionParameterDefaultValue(count,"0.0");
2517

    
2518
                        String[] parameterMaxValue={"90.0"};
2519
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2520
                        addProjectionParameterMaxValue(count,"90.0");
2521
                        addProjectionParameterMaxValue(count,"360.0");
2522
                        addProjectionParameterMaxValue(count,"10.0");
2523
                        addProjectionParameterMaxValue(count,"100000000.0");
2524
                        addProjectionParameterMaxValue(count,"100000000.0");
2525

    
2526
                        String[] parameterMinValue={"-90.0"};
2527
                        projectionParameterMinValueList.add(count,parameterMinValue);
2528
                        addProjectionParameterMinValue(count,"-90.0");
2529
                        addProjectionParameterMinValue(count,"-360.0");
2530
                        addProjectionParameterMinValue(count,"0.0");
2531
                        addProjectionParameterMinValue(count,"-100000000.0");
2532
                        addProjectionParameterMinValue(count,"-100000000.0");
2533

    
2534
                        String[] projectionAcronym={"stere"};
2535
                        projectionAcronymList.add(count,projectionAcronym);
2536
                }
2537

    
2538
                count++;
2539
                {// Transverse_Mercator
2540
                        String[] projectionName={"Transverse_Mercator"};
2541
                        projectionNameList.add(count,projectionName);
2542
                        addProjectionName(count,"Transverse Mercator");
2543
                        addProjectionName(count,"Gauss-Kruger");
2544
                        addProjectionName(count,"Gauss_Kruger");
2545
                        addProjectionName(count,"Gauss Conformal");
2546
                        addProjectionName(count,"Transverse Cylindrical Orthomorphic");
2547
                        addProjectionName(count,"9807");
2548

    
2549
                        String[] parameterName={"latitude_of_origin"};
2550
                        projectionParameterList.add(count,parameterName);
2551
                        addProjectionParameter(count,"central_meridian");
2552
                        addProjectionParameter(count,"scale_factor");
2553
                        addProjectionParameter(count,"false_easting");
2554
                        addProjectionParameter(count,"false_northing");
2555

    
2556
                        String[] parameterAcronym={"lat_0"};
2557
                        projectionParameterAcronymList.add(count,parameterAcronym);
2558
                        addProjectionParameterAcronymList(count,"lon_0");
2559
                        addProjectionParameterAcronymList(count,"k");
2560
                        addProjectionParameterAcronymList(count,"x_0");
2561
                        addProjectionParameterAcronymList(count,"y_0");
2562

    
2563
                        String[] parameterDefaultValue={"0.0"};
2564
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2565
                        addProjectionParameterDefaultValue(count,"0.0");
2566
                        addProjectionParameterDefaultValue(count,"1.0");
2567
                        addProjectionParameterDefaultValue(count,"0.0");
2568
                        addProjectionParameterDefaultValue(count,"0.0");
2569

    
2570
                        String[] parameterMaxValue={"90.0"};
2571
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2572
                        addProjectionParameterMaxValue(count,"360.0");
2573
                        addProjectionParameterMaxValue(count,"10.0");
2574
                        addProjectionParameterMaxValue(count,"100000000.0");
2575
                        addProjectionParameterMaxValue(count,"100000000.0");
2576

    
2577
                        String[] parameterMinValue={"-90.0"};
2578
                        projectionParameterMinValueList.add(count,parameterMinValue);
2579
                        addProjectionParameterMinValue(count,"-360.0");
2580
                        addProjectionParameterMinValue(count,"0.0");
2581
                        addProjectionParameterMinValue(count,"-100000000.0");
2582
                        addProjectionParameterMinValue(count,"-100000000.0");
2583

    
2584
                        String[] projectionAcronym={"tmerc"};
2585
                        projectionAcronymList.add(count,projectionAcronym);
2586
                }
2587

    
2588
                /*
2589
                count++;
2590
                {// Tunisia_Mining_Grid
2591
                        String[] projectionName={"Tunisia_Mining_Gridr"};
2592
                        projectionNameList.add(count,projectionName);
2593
                        addProjectionName(count,"Tunisia Mining Grid");
2594
                        addProjectionName(count,"9816");
2595

2596
                        String[] parameterName={"latitude_of_origin"};
2597
                        projectionParameterList.add(count,parameterName);
2598
                        addProjectionParameter(count,"central_meridian");
2599
                        addProjectionParameter(count,"false_easting");
2600
                        addProjectionParameter(count,"false_northing");
2601

2602
                        String[] parameterAcronym={"lat_0"};
2603
                        projectionParameterAcronymList.add(count,parameterAcronym);
2604
                        addProjectionParameterAcronymList(count,"lon_0");
2605
                        addProjectionParameterAcronymList(count,"x_0");
2606
                        addProjectionParameterAcronymList(count,"y_0");
2607

2608
                        String[] parameterDefaultValue={"0.0"};
2609
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2610
                        addProjectionParameterDefaultValue(count,"0.0");
2611
                        addProjectionParameterDefaultValue(count,"0.0");
2612
                        addProjectionParameterDefaultValue(count,"0.0");
2613

2614
                        String[] parameterMaxValue={"90.0"};
2615
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2616
                        addProjectionParameterMaxValue(count,"360.0");
2617
                        addProjectionParameterMaxValue(count,"100000000.0");
2618
                        addProjectionParameterMaxValue(count,"100000000.0");
2619

2620
                        String[] parameterMinValue={"-90.0"};
2621
                        projectionParameterMinValueList.add(count,parameterMinValue);
2622
                        addProjectionParameterMinValue(count,"-360.0");
2623
                        addProjectionParameterMinValue(count,"-100000000.0");
2624
                        addProjectionParameterMinValue(count,"-100000000.0");
2625

2626
                        String[] projectionAcronym={"cass"};
2627
                        projectionAcronymList.add(count,projectionAcronym);
2628
                }
2629
                */
2630

    
2631
                count++;
2632
                {// VanDerGrinten
2633
                        String[] projectionName={"VanDerGrinten"};
2634
                        projectionNameList.add(count,projectionName);
2635
                        addProjectionName(count,"VanDerGrinten I");
2636
                        addProjectionName(count,"VanderGrinten");
2637
                        addProjectionName(count,"Van_der_Grinten_I");
2638

    
2639
                        String[] parameterName={"central_meridian"};
2640
                        projectionParameterList.add(count,parameterName);
2641
                        addProjectionParameter(count,"false_easting");
2642
                        addProjectionParameter(count,"false_northing");
2643

    
2644
                        String[] parameterAcronym={"lon_0"};
2645
                        projectionParameterAcronymList.add(count,parameterAcronym);
2646
                        addProjectionParameterAcronymList(count,"x_0");
2647
                        addProjectionParameterAcronymList(count,"y_0");
2648

    
2649
                        String[] parameterDefaultValue={"0.0"};
2650
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2651
                        addProjectionParameterDefaultValue(count,"0.0");
2652
                        addProjectionParameterDefaultValue(count,"0.0");
2653

    
2654
                        String[] parameterMaxValue={"360.0"};
2655
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2656
                        addProjectionParameterMaxValue(count,"100000000.0");
2657
                        addProjectionParameterMaxValue(count,"100000000.0");
2658

    
2659
                        String[] parameterMinValue={"-360.0"};
2660
                        projectionParameterMinValueList.add(count,parameterMinValue);
2661
                        addProjectionParameterMinValue(count,"-100000000.0");
2662
                        addProjectionParameterMinValue(count,"-100000000.0");
2663

    
2664
                        String[] projectionAcronym={"vandg"};
2665
                        projectionAcronymList.add(count,projectionAcronym);
2666
                }
2667

    
2668
                count++;
2669
                {// Winkel_I
2670
                        String[] projectionName={"Winkel_I"};
2671
                        projectionNameList.add(count,projectionName);
2672
                        addProjectionName(count,"Winkel I");
2673
                        addProjectionName(count,"Winkel-I");
2674

    
2675
                        String[] parameterName={"central_meridian"};
2676
                        projectionParameterList.add(count,parameterName);
2677
                        addProjectionParameter(count,"standard_parallel_1");
2678
                        addProjectionParameter(count,"false_easting");
2679
                        addProjectionParameter(count,"false_northing");
2680

    
2681
                        String[] parameterAcronym={"lon_0"};
2682
                        projectionParameterAcronymList.add(count,parameterAcronym);
2683
                        addProjectionParameterAcronymList(count,"lat_ts");
2684
                        addProjectionParameterAcronymList(count,"x_0");
2685
                        addProjectionParameterAcronymList(count,"y_0");
2686

    
2687
                        String[] parameterDefaultValue={"0.0"};
2688
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2689
                        addProjectionParameterDefaultValue(count,"0.0");
2690
                        addProjectionParameterDefaultValue(count,"0.0");
2691
                        addProjectionParameterDefaultValue(count,"0.0");
2692

    
2693
                        String[] parameterMaxValue={"360.0"};
2694
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2695
                        addProjectionParameterMaxValue(count,"90.0");
2696
                        addProjectionParameterMaxValue(count,"100000000.0");
2697
                        addProjectionParameterMaxValue(count,"100000000.0");
2698

    
2699
                        String[] parameterMinValue={"-360.0"};
2700
                        projectionParameterMinValueList.add(count,parameterMinValue);
2701
                        addProjectionParameterMinValue(count,"-90.0");
2702
                        addProjectionParameterMinValue(count,"-100000000.0");
2703
                        addProjectionParameterMinValue(count,"-100000000.0");
2704

    
2705
                        String[] projectionAcronym={"wink1"};
2706
                        projectionAcronymList.add(count,projectionAcronym);
2707
                }
2708

    
2709
                count++;
2710
                {// Winkel_II
2711
                        String[] projectionName={"Winkel_II"};
2712
                        projectionNameList.add(count,projectionName);
2713
                        addProjectionName(count,"Winkel II");
2714

    
2715
                        String[] parameterName={"central_meridian"};
2716
                        projectionParameterList.add(count,parameterName);
2717
                        addProjectionParameter(count,"standard_parallel_1");
2718
                        addProjectionParameter(count,"false_easting");
2719
                        addProjectionParameter(count,"false_northing");
2720

    
2721
                        String[] parameterAcronym={"lon_0"};
2722
                        projectionParameterAcronymList.add(count,parameterAcronym);
2723
                        addProjectionParameterAcronymList(count,"lat_ts");
2724
                        addProjectionParameterAcronymList(count,"x_0");
2725
                        addProjectionParameterAcronymList(count,"y_0");
2726

    
2727
                        String[] parameterDefaultValue={"0.0"};
2728
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2729
                        addProjectionParameterDefaultValue(count,"0.0");
2730
                        addProjectionParameterDefaultValue(count,"0.0");
2731
                        addProjectionParameterDefaultValue(count,"0.0");
2732

    
2733
                        String[] parameterMaxValue={"360.0"};
2734
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2735
                        addProjectionParameterMaxValue(count,"90.0");
2736
                        addProjectionParameterMaxValue(count,"100000000.0");
2737
                        addProjectionParameterMaxValue(count,"100000000.0");
2738

    
2739
                        String[] parameterMinValue={"-360.0"};
2740
                        projectionParameterMinValueList.add(count,parameterMinValue);
2741
                        addProjectionParameterMinValue(count,"-90.0");
2742
                        addProjectionParameterMinValue(count,"-100000000.0");
2743
                        addProjectionParameterMinValue(count,"-100000000.0");
2744

    
2745
                        String[] projectionAcronym={"wink2"};
2746
                        projectionAcronymList.add(count,projectionAcronym);
2747
                }
2748

    
2749
                count++;
2750
                {// Winkel Tripel
2751
                        String[] projectionName={"Winkel_Tripel"};
2752
                        projectionNameList.add(count,projectionName);
2753
                        addProjectionName(count,"Winkel-Tripel");
2754
                        addProjectionName(count,"Winkel Tripel");
2755

    
2756
                        String[] parameterName={"central_meridian"};
2757
                        projectionParameterList.add(count,parameterName);
2758
                        addProjectionParameter(count,"standard_parallel_1");
2759
                        addProjectionParameter(count,"false_easting");
2760
                        addProjectionParameter(count,"false_northing");
2761

    
2762
                        String[] parameterAcronym={"lon_0"};
2763
                        projectionParameterAcronymList.add(count,parameterAcronym);
2764
                        addProjectionParameterAcronymList(count,"lat_ts");
2765
                        addProjectionParameterAcronymList(count,"x_0");
2766
                        addProjectionParameterAcronymList(count,"y_0");
2767

    
2768
                        String[] parameterDefaultValue={"0.0"};
2769
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2770
                        addProjectionParameterDefaultValue(count,"0.0");
2771
                        addProjectionParameterDefaultValue(count,"0.0");
2772
                        addProjectionParameterDefaultValue(count,"0.0");
2773

    
2774
                        String[] parameterMaxValue={"360.0"};
2775
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2776
                        addProjectionParameterMaxValue(count,"90.0");
2777
                        addProjectionParameterMaxValue(count,"100000000.0");
2778
                        addProjectionParameterMaxValue(count,"100000000.0");
2779

    
2780
                        String[] parameterMinValue={"-360.0"};
2781
                        projectionParameterMinValueList.add(count,parameterMinValue);
2782
                        addProjectionParameterMinValue(count,"-90.0");
2783
                        addProjectionParameterMinValue(count,"-100000000.0");
2784
                        addProjectionParameterMinValue(count,"-100000000.0");
2785

    
2786
                        String[] projectionAcronym={"wintri"};
2787
                        projectionAcronymList.add(count,projectionAcronym);
2788
                }
2789
        
2790
                count++;
2791
                {// Popular_Visualisation_Pseudo_Mercator (based on Mercator_1SP)
2792
                        String[] projectionName={"Popular_Visualisation_Pseudo_Mercator"};
2793
                        projectionNameList.add(count,projectionName);
2794

    
2795
                        String[] parameterName={"central_meridian"};
2796
                        projectionParameterList.add(count,parameterName);
2797
                        addProjectionParameter(count,"latitude_of_origin");  // o latitude_origin
2798
                        addProjectionParameter(count,"scale_factor");
2799
                        addProjectionParameter(count,"false_easting");
2800
                        addProjectionParameter(count,"false_northing");
2801
                        addProjectionParameter(count,"semi_major");
2802
                        addProjectionParameter(count,"semi_minor");
2803

    
2804
                        String[] parameterAcronym={"lon_0"};
2805
                        projectionParameterAcronymList.add(count,parameterAcronym);
2806
                        addProjectionParameterAcronymList(count,"lat_ts");
2807
                        addProjectionParameterAcronymList(count,"k");
2808
                        addProjectionParameterAcronymList(count,"x_0");
2809
                        addProjectionParameterAcronymList(count,"y_0");
2810
                        addProjectionParameterAcronymList(count,"a");
2811
                        addProjectionParameterAcronymList(count,"b");
2812

    
2813
                        String[] parameterDefaultValue={"0.0"};
2814
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2815
                        addProjectionParameterDefaultValue(count,"0.0");
2816
                        addProjectionParameterDefaultValue(count,"1.0");
2817
                        addProjectionParameterDefaultValue(count,"0.0");
2818
                        addProjectionParameterDefaultValue(count,"0.0");
2819
                        addProjectionParameterDefaultValue(count,"6378137.0");
2820
                        addProjectionParameterDefaultValue(count,"6378137.0");
2821

    
2822
                        String[] parameterMaxValue={"360.0"};
2823
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2824
                        addProjectionParameterMaxValue(count,"90.0");
2825
                        addProjectionParameterMaxValue(count,"10.0");
2826
                        addProjectionParameterMaxValue(count,"100000000.0");
2827
                        addProjectionParameterMaxValue(count,"100000000.0");
2828
                        addProjectionParameterMaxValue(count,"6378137.0");
2829
                        addProjectionParameterMaxValue(count,"6378137.0");
2830

    
2831
                        String[] parameterMinValue={"-360.0"};
2832
                        projectionParameterMinValueList.add(count,parameterMinValue);
2833
                        addProjectionParameterMinValue(count,"-90.0");
2834
                        addProjectionParameterMinValue(count,"0.0");
2835
                        addProjectionParameterMinValue(count,"-100000000.0");
2836
                        addProjectionParameterMinValue(count,"-100000000.0");
2837
                        addProjectionParameterMinValue(count,"6378137.0");
2838
                        addProjectionParameterMinValue(count,"6378137.0");
2839

    
2840
                        String[] projectionAcronym={"merc"};
2841
                        projectionAcronymList.add(count,projectionAcronym);
2842
                }
2843

    
2844
        
2845
        }
2846
        
2847
        public void addProjectionName(int pos,String projectionName) throws CrsException
2848
        {
2849
                if(pos<0||pos>(projectionNameList.size()-1))
2850
                {
2851
                        throw new CrsException(new Exception("Error adding projection name '"+projectionName+"' position out of valid limits."));
2852
                }
2853
                String[] projectionNames=(String[]) projectionNameList.get(pos);
2854
                String[] newProjectionNames=new String[projectionNames.length+1];
2855
                for(int i=0;i<projectionNames.length;i++)
2856
                {
2857
                        newProjectionNames[i]=projectionNames[i];
2858
                }
2859
                newProjectionNames[projectionNames.length]=projectionName;
2860
                projectionNameList.remove(pos);
2861
                projectionNameList.add(pos,newProjectionNames);
2862
        }
2863
        
2864
        public void addUnitName(int pos,String unitName) throws CrsException
2865
        {
2866
                if(pos<0||pos>(unitNameList.size()-1))
2867
                {
2868
                        throw new CrsException(new Exception("Error adding unit name '"+unitName+"' position out of valid limits."));
2869
                }
2870
                String[] unitNames=(String[]) unitNameList.get(pos);
2871
                String[] newUnitNames=new String[unitNames.length+1];
2872
                for(int i=0;i<unitNames.length;i++)
2873
                {
2874
                        newUnitNames[i]=unitNames[i];
2875
                }
2876
                newUnitNames[unitNames.length]=unitName;
2877
                unitNameList.remove(pos);
2878
                unitNameList.add(pos,newUnitNames);
2879
        }
2880
        
2881
        public void addProjectionParameterName(int pos,String projectionParameterName) throws CrsException
2882
        {
2883
                if(pos<0||pos>(projectionParameterNameList.size()-1))
2884
                {
2885
                        throw new CrsException(new Exception("Error adding projection parameter name '"+projectionParameterName+"' position out of valid limits."));
2886
                }
2887
                String[] projectionParameterNames=(String[]) projectionParameterNameList.get(pos);
2888
                String[] newProjectionParameterNames=new String[projectionParameterNames.length+1];
2889
                for(int i=0;i<projectionParameterNames.length;i++)
2890
                {
2891
                        newProjectionParameterNames[i]=projectionParameterNames[i];
2892
                }
2893
                newProjectionParameterNames[projectionParameterNames.length]=projectionParameterName;
2894
                projectionParameterNameList.remove(pos);
2895
                projectionParameterNameList.add(pos,newProjectionParameterNames);
2896
        }
2897
        
2898
        public void addProjectionParameter(int pos,String projectionParameter) throws CrsException
2899
        {
2900
                if(pos<0||pos>(projectionParameterList.size()-1))
2901
                {
2902
                        throw new CrsException(new Exception("Error adding projection parameter '"+projectionParameter+"' position out of valid limits."));
2903
                }
2904
                String[] projectionParameters=(String[]) projectionParameterList.get(pos);
2905
                String[] newProjectionParameters=new String[projectionParameters.length+1];
2906
                for(int i=0;i<projectionParameters.length;i++)
2907
                {
2908
                        newProjectionParameters[i]=projectionParameters[i];
2909
                }
2910
                newProjectionParameters[projectionParameters.length]=projectionParameter;
2911
                projectionParameterList.remove(pos);
2912
                projectionParameterList.add(pos,newProjectionParameters);
2913
        }
2914
        
2915
        public void addProjectionParameterDefaultValue(int pos,String projectionParameterDefaultValue) throws CrsException
2916
        {
2917
                if(pos<0||pos>(projectionParameterDefaultValueList.size()-1))
2918
                {
2919
                        throw new CrsException(new Exception("Error adding default value to projection parameter '"+projectionParameterDefaultValue+"' position out of valid limits."));
2920
                }
2921
                String[] projectionParameterDefaultValues=(String[]) projectionParameterDefaultValueList.get(pos);
2922
                String[] newProjectionParameterDefaultValues=new String[projectionParameterDefaultValues.length+1];
2923
                for(int i=0;i<projectionParameterDefaultValues.length;i++)
2924
                {
2925
                        newProjectionParameterDefaultValues[i]=projectionParameterDefaultValues[i];
2926
                }
2927
                newProjectionParameterDefaultValues[projectionParameterDefaultValues.length]=projectionParameterDefaultValue;
2928
                projectionParameterDefaultValueList.remove(pos);
2929
                projectionParameterDefaultValueList.add(pos,newProjectionParameterDefaultValues);
2930
        }
2931
        
2932
        public void addProjectionParameterMaxValue(int pos,String projectionParameterMaxValue) throws CrsException
2933
        {
2934
                if(pos<0||pos>(projectionParameterMaxValueList.size()-1))
2935
                {
2936
                        throw new CrsException(new Exception("Error adding max value to projection parameter '"+projectionParameterMaxValue+"' position out of valid limits."));
2937
                }
2938
                String[] projectionParameterMaxValues=(String[]) projectionParameterMaxValueList.get(pos);
2939
                String[] newProjectionParameterMaxValues=new String[projectionParameterMaxValues.length+1];
2940
                for(int i=0;i<projectionParameterMaxValues.length;i++)
2941
                {
2942
                        newProjectionParameterMaxValues[i]=projectionParameterMaxValues[i];
2943
                }
2944
                newProjectionParameterMaxValues[projectionParameterMaxValues.length]=projectionParameterMaxValue;
2945
                projectionParameterMaxValueList.remove(pos);
2946
                projectionParameterMaxValueList.add(pos,newProjectionParameterMaxValues);
2947
        }
2948
        
2949
        public void addProjectionParameterMinValue(int pos,String projectionParameterMinValue) throws CrsException
2950
        {
2951
                if(pos<0||pos>(projectionParameterMinValueList.size()-1))
2952
                {
2953
                        throw new CrsException(new Exception("Error adding min value to projection parameter '"+projectionParameterMinValue+"' position out of valid limits."));
2954
                }
2955
                String[] projectionParameterMinValues=(String[]) projectionParameterMinValueList.get(pos);
2956
                String[] newProjectionParameterMinValues=new String[projectionParameterMinValues.length+1];
2957
                for(int i=0;i<projectionParameterMinValues.length;i++)
2958
                {
2959
                        newProjectionParameterMinValues[i]=projectionParameterMinValues[i];
2960
                }
2961
                newProjectionParameterMinValues[projectionParameterMinValues.length]=projectionParameterMinValue;
2962
                projectionParameterMinValueList.remove(pos);
2963
                projectionParameterMinValueList.add(pos,newProjectionParameterMinValues);
2964
        }
2965
        
2966
        public void addProjectionParameterAcronymList(int pos,String projectionParameterAcronym) throws CrsException
2967
        {
2968
                if(pos<0||pos>(projectionParameterAcronymList.size()-1))
2969
                {
2970
                        throw new CrsException(new Exception("Error adding projection acronym '"+projectionParameterAcronym+"' position out of valid limits."));
2971
                }
2972
                String[] projectionParameterAcronyms=(String[]) projectionParameterAcronymList.get(pos);
2973
                String[] newProjectionParameterAcronyms=new String[projectionParameterAcronyms.length+1];
2974
                for(int i=0;i<projectionParameterAcronyms.length;i++)
2975
                {
2976
                        newProjectionParameterAcronyms[i]=projectionParameterAcronyms[i];
2977
                }
2978
                newProjectionParameterAcronyms[projectionParameterAcronyms.length]=projectionParameterAcronym;
2979
                projectionParameterAcronymList.remove(pos);
2980
                projectionParameterAcronymList.add(pos,newProjectionParameterAcronyms);
2981
        }
2982
        
2983
        public int findProjection(String projectionName)
2984
        {
2985
                for(int i=0;i<projectionNameList.size();i++)
2986
                {
2987
                        String[] projectionNames=(String[]) projectionNameList.get(i);
2988
                        for(int j=0;j<projectionNames.length;j++)
2989
                        {
2990
                                if(projectionNames[j].toLowerCase().replaceAll(" ","").equals(projectionName.toLowerCase().replaceAll(" ","")))
2991
                                        return i;
2992
                        }
2993
                }
2994
                        
2995
                return -1;
2996
        }
2997
        
2998
        public int findProjectionParameter(String parameterName)
2999
        {
3000
                for(int i=0;i<projectionParameterNameList.size();i++)
3001
                {
3002
                        String[] parameterNames=(String[]) projectionParameterNameList.get(i);
3003
                        for(int j=0;j<parameterNames.length;j++)
3004
                        {
3005
                                if(parameterNames[j].toLowerCase().replaceAll(" ","").equals(parameterName.toLowerCase().replaceAll(" ","")))
3006
                                        return i;
3007
                        }
3008
                }
3009
                        
3010
                return -1;
3011
        }
3012
        
3013
        public int findProjectionParameters(String parameterName1, String parameterName2)
3014
        {
3015
                for(int i=0;i<projectionParameterNameList.size();i++)
3016
                {
3017
                        boolean existsParameter1=false;
3018
                        boolean existsParameter2=false;
3019
                        
3020
                        
3021
                        String[] parameterNames=(String[]) projectionParameterNameList.get(i);
3022
                        if(parameterNames[0].toLowerCase().replaceAll(" ","").equals(parameterName2.toLowerCase().replaceAll(" ","")))
3023
                        {
3024
                                existsParameter2=true;
3025
                                for(int j=0;j<parameterNames.length;j++)
3026
                                {
3027
                                        if(parameterNames[j].toLowerCase().replaceAll(" ","").equals(parameterName1.toLowerCase().replaceAll(" ","")))
3028
                                        {
3029
                                                existsParameter1=true;
3030
                                                break;
3031
                                        }
3032
                                }
3033
                        }
3034
                        if(existsParameter1&&existsParameter2)
3035
                                return i;
3036
                }
3037
                        
3038
                return -1;
3039
        }
3040
        
3041
        public int findUnit(String unitName)
3042
        {
3043
                for(int i=0;i<unitNameList.size();i++)
3044
                {
3045
                        String[] unitNames=(String[]) unitNameList.get(i);
3046
                        for(int j=0;j<unitNames.length;j++)
3047
                        {
3048
                                if(unitNames[j].toLowerCase().replaceAll(" ","").equals(unitName.toLowerCase().replaceAll(" ","")))
3049
                                        return i;
3050
                        }
3051
                }
3052
                        
3053
                return -1;
3054
        }
3055
        
3056
        public String getProj4UnitName(int pos) throws CrsException 
3057
        {
3058
                if(pos<0||pos>(unitNameList.size()-1))
3059
                {
3060
                        throw new CrsException(new Exception("Error retrieving unit name. Position out of valid limits."));
3061
                }
3062
                return ((String[]) unitNameList.get(pos))[0];
3063
        }
3064
        
3065
        public String getProj4ProjectionName(int pos) throws CrsException 
3066
        {
3067
                if(pos<0||pos>(projectionNameList.size()-1))
3068
                {
3069
                        throw new CrsException(new Exception("Error retrieving projection name. Position out of valid limits."));
3070
                }
3071
                return ((String[]) projectionNameList.get(pos))[0];
3072
        }
3073
        
3074
        public String getProj4ProjectionParameterName(int pos) throws CrsException 
3075
        {
3076
                // Ojo decir a Jose Luis que quite los parametros del elipsoide
3077
                if(pos<0||pos>(projectionParameterNameList.size()-1))
3078
                {
3079
                        throw new CrsException(new Exception("Error retrieving projection parameter name. Position out of valid limits."));
3080
                }
3081
                return ((String[]) projectionParameterNameList.get(pos))[0];
3082
        }
3083
        
3084
        public ArrayList getProj4ProjectionParameters(int pos) throws CrsException 
3085
        {
3086
                
3087
                if(pos<0||pos>(projectionParameterList.size()-1))
3088
                                throw new CrsException(new Exception());
3089
                String[] parameterList=(String[])projectionParameterList.get(pos);
3090
                ArrayList parameters=new ArrayList();
3091
                for(int i=0;i<parameterList.length;i++)
3092
                {
3093
                        String parameterName=parameterList[i];
3094
                        int posParameter=findProjectionParameter(parameterName);
3095
                        if(posParameter==-1)
3096
                        {
3097
                                throw new CrsException(new Exception("The parameter '"+parameterName+"' is not in parameter list."));
3098
                        }
3099
                        //String parameterNameProj4=getProj4ProjectionParameterName(posParameter);
3100
                        String parameterNameProj4=parameterName;
3101
                        parameters.add(i,parameterNameProj4);
3102
                }
3103
                return parameters;
3104
        }
3105
        
3106
        public ArrayList getProj4ProjectionParameterDefaultValues(int pos) throws CrsException 
3107
        {
3108
                
3109
                if(pos<0||pos>(projectionParameterDefaultValueList.size()-1))
3110
                {
3111
                        throw new CrsException(new Exception("Error retrieving default value to projection parameter. Position out of valid limits."));
3112
                }
3113
                String[] parameterDefaultValueList=(String[])projectionParameterDefaultValueList.get(pos);
3114
                ArrayList parameterDefaultValues=new ArrayList();
3115
                for(int i=0;i<parameterDefaultValueList.length;i++)
3116
                {
3117
                        String parameterDefaultValue=parameterDefaultValueList[i];
3118
                        parameterDefaultValues.add(i,parameterDefaultValue);
3119
                }
3120
                return parameterDefaultValues;
3121
        }
3122
        
3123
        public ArrayList getProj4ProjectionParameterMaxValues(int pos) throws CrsException 
3124
        {
3125
                
3126
                if(pos<0||pos>(projectionParameterMaxValueList.size()-1))
3127
                {
3128
                        throw new CrsException(new Exception("Error retrieving max value value to projection parameter. Position out of valid limits."));
3129
                }
3130
                String[] parameterMaxValueList=(String[])projectionParameterMaxValueList.get(pos);
3131
                ArrayList parameterMaxValues=new ArrayList();
3132
                for(int i=0;i<parameterMaxValueList.length;i++)
3133
                {
3134
                        String parameterMaxValue=parameterMaxValueList[i];
3135
                        parameterMaxValues.add(i,parameterMaxValue);
3136
                }
3137
                return parameterMaxValues;
3138
        }
3139
        
3140
        public ArrayList getProj4ProjectionParameterMinValues(int pos) throws CrsException 
3141
        {
3142
                
3143
                if(pos<0||pos>(projectionParameterMinValueList.size()-1))
3144
                {
3145
                        throw new CrsException(new Exception("Error retrieving min value value to projection parameter. Position out of valid limits."));
3146
                }
3147
                String[] parameterMinValueList=(String[])projectionParameterMinValueList.get(pos);
3148
                ArrayList parameterMinValues=new ArrayList();
3149
                for(int i=0;i<parameterMinValueList.length;i++)
3150
                {
3151
                        String parameterMinValue=parameterMinValueList[i];
3152
                        parameterMinValues.add(i,parameterMinValue);
3153
                }
3154
                return parameterMinValues;
3155
        }
3156
        
3157
        public ArrayList getProj4ProjectionParameterAcronyms(int pos) throws CrsException 
3158
        {
3159
                
3160
                if(pos<0||pos>(projectionParameterAcronymList.size()-1))
3161
                {
3162
                        throw new CrsException(new Exception("Error retrieving projection acronym. Position out of valid limits."));
3163
                }
3164
                String[] parameterAcronymList=(String[])projectionParameterAcronymList.get(pos);
3165
                ArrayList parameterAcronyms=new ArrayList();
3166
                for(int i=0;i<parameterAcronymList.length;i++)
3167
                {
3168
                        String parameterAcronym=parameterAcronymList[i];
3169
                        parameterAcronyms.add(i,parameterAcronym);
3170
                }
3171
                return parameterAcronyms;
3172
        }
3173
        
3174
        public String getProjectionParameterUnitList(int pos) throws CrsException {
3175
                if(pos<0||pos>(projectionParameterUnitList.size()-1))
3176
                {
3177
                        throw new CrsException(new Exception("Error obtaining the unit list of projection parameter. Position out of valid limits."));
3178
                }
3179
                String [] projParamUnit = (String[]) projectionParameterUnitList.get(pos);
3180
                return projParamUnit[0];
3181
        }
3182

    
3183
        public String exportToProj4(Crs crs) throws CrsException
3184
        {
3185
                String strProj4="+proj=";
3186
                String strDatumName="";
3187
                String strDatumCode="";
3188
                String strProj4ToMeter="";
3189
                String strProj4Datum="";
3190
                String[] primeMeridian=crs.getCrsWkt().getPrimen();
3191
                String primeMeridianName=primeMeridian[0];
3192
                double primeMeridianValue=Double.parseDouble(primeMeridian[1]); // -> hacer el cambio de unidades
3193
                String[] strPrimeMeridianProj4=primeMeridianToProj4(primeMeridianName,primeMeridianValue);
3194
                primeMeridianValue=Double.parseDouble(strPrimeMeridianProj4[1]);
3195
                primeMeridianName=strPrimeMeridianProj4[0];
3196
                String primeMeridianAcronym=strPrimeMeridianProj4[2]; // Puede ser cadena vacia->Analizar
3197

    
3198
                // Extracci?n del c?digo de Datum
3199
                String codDatum="0";
3200
                strDatumName=crs.getCrsWkt().getDatumName();
3201
        int intCodDatum=0;//Integer.parseInt(codDatum);
3202
        strProj4Datum=datumToProj4(strDatumName,intCodDatum);
3203
        
3204

    
3205

    
3206
                String strProj=crs.getCrsWkt().getProjcs();
3207
                if(strProj.equals(""))
3208
                {
3209
                        //System.out.println("Projection Name = "+"Geodetic");
3210
                        strProj4+="longlat ";
3211
                }
3212
                else
3213
                {
3214
                // OJO ******************************************
3215
                        /*
3216
                        if(factor_to_meter!=1.0)
3217
                        strProj4ToMeter="+to_meter="+factor_to_meter+" ";
3218
                else
3219
                        strProj4ToMeter="+units=m ";
3220
                */
3221
                        
3222
                        
3223
                        //System.out.println("Projection      = "+strProj);
3224
                        String strProjName=crs.getCrsWkt().getProjection();
3225
                        //System.out.println("Projection Name = "+strProjName);
3226
                        int indexProj=findProjection(strProjName);
3227
                        if(indexProj==-1)
3228
                        {
3229
                                throw new CrsException(new Exception("The projection'"+strProjName+"' is not a proj4 projection."));
3230
                        }
3231
                        String projectionName=(getProj4ProjectionName(indexProj)).trim();
3232
                        ArrayList parameterNames=getProj4ProjectionParameters(indexProj);
3233
                        ArrayList parameterAcronyms=getProj4ProjectionParameterAcronyms(indexProj);
3234
                        ArrayList parameterValues=getProj4ProjectionParameterDefaultValues(indexProj);
3235
                        ArrayList parameterMaxValues=getProj4ProjectionParameterMaxValues(indexProj);
3236
                        ArrayList parameterMinValues=getProj4ProjectionParameterMinValues(indexProj);
3237
                        //System.out.println("Parametros:"+parameterNames);
3238
                        String[] gtParameterValues=crs.getCrsWkt().getParam_value();
3239
                        String[] gtParameterNames=crs.getCrsWkt().getParam_name();
3240
                        for(int i=0;i<parameterNames.size();i++)
3241
                        {
3242
                                boolean existsParameter=false;
3243
                                String parameterValue="";
3244
                                for(int j=0;j<gtParameterNames.length;j++)
3245
                                {
3246
                                        String gtParameterName=gtParameterNames[j].trim();
3247
                                        //int posGtParameter=findProjectionParameter(gtParameterName);
3248
                                        int posGtParameter=findProjectionParameters(gtParameterName,(String)parameterNames.get(i));
3249
                                        //int posParameter=findProjectionParameter((String)parameterNames.get(i));
3250
                                        //if(((String)parameterNames.get(i)).trim().equals(gtParameterNames[j].trim()))
3251
                                        if(posGtParameter!=-1)
3252
                                        {
3253
                                                gtParameterName=getProj4ProjectionParameterName(posGtParameter);
3254
                                                gtParameterNames[j]=gtParameterName;
3255
                                                existsParameter=true;
3256
                                                double maxValue=Double.parseDouble((String)parameterMaxValues.get(i));
3257
                                                double minValue=Double.parseDouble((String)parameterMinValues.get(i));
3258
                                                //parameterValue=Double.parseDouble(gtParameterValues[j]);
3259
                                                parameterValue=gtParameterValues[j]; // Ojo unidades -> analizar
3260
                                                double auxValue=Double.parseDouble(parameterValue);
3261
                                                if((auxValue<minValue)||(auxValue>maxValue))
3262
                                                {
3263
                                                        throw new CrsException(new Exception("The parameter '"+gtParameterName+"' is out of domain."));
3264
                                                }
3265
                                                else if (((String)parameterNames.get(i)).trim().equals("scale_factor") && (auxValue==minValue)) {
3266
                                                        throw new CrsException(new Exception("The parameter '"+gtParameterName+"' is out of domain."));
3267
                                                }
3268
                                                break;
3269
                                        }
3270
                                        /*else
3271
                                        {
3272
                                                String strError="El parametro recibido de GeoTools";
3273
                                                strError+=gtParameterName;
3274
                                                strError+=" no esta contemplado en la proyeccion";
3275
                                                System.out.println(strError);
3276
                                                throw new CrsException(new Exception());
3277
                                        }*/
3278
                                }
3279
                                if(existsParameter)
3280
                                {
3281
                                        parameterValues.set(i,parameterValue);
3282
                                        //System.out.println("- Parametro["+parameterNames.get(i)+"]="+parameterValue);
3283
                                }
3284
                                /*
3285
                                else
3286
                                {
3287
                                        value=Double.parseDouble((String)parameterDefaultValues.get(i));
3288
                                        System.out.println("El parametro "+parameterNames.get(i)+" no figura en la lista geotools");
3289
                                        throw(new CrsException(new Exception()));
3290
                                }
3291
                                */
3292
                        }
3293
                        boolean isSomerc=false;
3294
                        boolean isOmerc=false;
3295
                        double valueAlpha=0;
3296
                        double valueGamma=0;
3297
                        boolean existsAlpha=false;
3298
                        boolean existsGamma=false;
3299
                        String[] projectionAcronym=(String[])projectionAcronymList.get(indexProj);
3300
                        if(projectionName.equals("Oblique_Mercator"))
3301
                        {
3302
                                isOmerc=true;
3303
                                if (crs.getCode()==21781)
3304
                                        isSomerc=true;
3305
                                for(int j=0;j<gtParameterNames.length;j++)
3306
                                {
3307
                                        String gtParameterName=gtParameterNames[j].trim();
3308
                                        if(gtParameterName.equalsIgnoreCase("latitude_of_origin")
3309
                                                        ||gtParameterName.equalsIgnoreCase("standard_parallel_1")
3310
                                                        ||gtParameterName.equalsIgnoreCase("latitude_of_center"))
3311
                                        {
3312
                                                double value=Double.parseDouble(gtParameterValues[j]);
3313
                                                if(Math.abs(Math.abs(value)-90.0)<0.0001)
3314
                                                {
3315
                                                        throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow latitude origen close to the poles"));
3316
                                                }
3317
                                        }
3318
                                        if(gtParameterName.equalsIgnoreCase("azimuth"))
3319
                                        {
3320
                                                valueAlpha=Double.parseDouble(gtParameterValues[j]);
3321
                                                //if(Math.abs(valueAlpha-90.0)<0.0001)
3322
                                                if (valueAlpha > 90.0)
3323
                                                {
3324
                                                        //throw new CrsException(new Exception("In proj4 projection 'Oblique_Mercator' not allow azimut close to 90"));
3325
                                                        throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow azimut values > 90"));
3326
                                                }
3327
                                                if(Math.abs(valueAlpha-270.0)<0.0001)
3328
                                                {
3329
                                                        throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow azimut close to 270"));
3330
                                                }
3331
                                                existsAlpha=true;
3332
                                        }
3333
                                        if(gtParameterName.equalsIgnoreCase("rectified_grid_angle"))
3334
                                        {
3335
                                                valueGamma=Double.parseDouble(gtParameterValues[j]);
3336
                                                existsGamma=true;
3337
                                        }
3338
                                }
3339
                                if(existsAlpha&&existsGamma)
3340
                                {
3341
                                        if(Math.abs(valueAlpha-valueGamma)>0.00000001)
3342
                                        {
3343
                                                throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow different azimut and spin axis"));
3344
                                        }
3345
                                }
3346
                                
3347
                                // Necesito buscar un caso de ejemplo
3348
                        }
3349
                        if(projectionName.equals("Hotine_Oblique_Mercator_Two_Point_Center"))
3350
                        {
3351
                                double lat_1=0.0;
3352
                                double lat_2=0.0;
3353
                                boolean exists_Lat_1=false;
3354
                                boolean exists_Lat_2=false;
3355
                                for(int j=0;j<gtParameterNames.length;j++)
3356
                                {
3357
                                        String gtParameterName=gtParameterNames[j].trim();
3358
                                        if(gtParameterName.equalsIgnoreCase("Latitude_Of_1st_Point"))
3359
                                        {
3360
                                                lat_1=Double.parseDouble(gtParameterValues[j]);
3361
                                                exists_Lat_1=true;
3362
                                        }
3363
                                        if(gtParameterName.equalsIgnoreCase("Latitude_Of_2nd_Point"))
3364
                                        {
3365
                                                lat_2=Double.parseDouble(gtParameterValues[j]);
3366
                                                exists_Lat_2= true;
3367
                                        }
3368
                                }
3369
                                if(exists_Lat_1&&exists_Lat_2)
3370
                                {
3371
                                        if(Math.abs(lat_1-lat_2)<0.0001)
3372
                                        {
3373
                                                throw new CrsException(new Exception("In proj4 projection 'Hotine-Oblique Mercator Two Points' not allow lat_1 equals lat_2"));
3374
                                        }
3375
                                        if(Math.abs(lat_1)<0.0001)
3376
                                        {
3377
                                                throw new CrsException(new Exception("In proj4 projection 'Hotine-Oblique Mercator Two Points' not allow zero in lat_2"));
3378
                                        }
3379
                                        if(Math.abs(Math.abs(lat_2)-90)<0.0001)
3380
                                        {
3381
                                                throw new CrsException(new Exception("In proj4 projection 'Hotine-Oblique Mercator Two Points' not allow values 90 or minus 90 in lat_2"));
3382
                                        }
3383
                                }
3384
                        }
3385
                        String strProjectionAcronym=projectionAcronym[0];
3386
                        String strExtraProj4="";
3387
                        // Control de casos especiales
3388
                        boolean isLaborde=false;
3389
                        boolean isLcc1sp=false;
3390
                        boolean isMerc=false;
3391
                        boolean exists_sf=false;
3392
                        boolean exists_lo=false;
3393
                        boolean isSterePolar=false;
3394
                        boolean isStereOblique=false;  // pondremos +proj=sterea
3395
                        boolean exists_stdPar=false;
3396
                        double value_stdPar=0.0;
3397
                        if(projectionAcronym[0].equals("merc")) // 1 - Mercator
3398
                        {
3399
                                isMerc=true;
3400
                                double value_sf=0.0;
3401
                                double value_lo=0.0;
3402
                                for(int j=0;j<gtParameterNames.length;j++)
3403
                                {
3404
                                        String gtParameterName=gtParameterNames[j].trim();
3405
                                        if(gtParameterName.equalsIgnoreCase("latitude_of_origin")
3406
                                                        ||gtParameterName.equalsIgnoreCase("standard_parallel_1")
3407
                                                        ||gtParameterName.equalsIgnoreCase("latitude_of_center"))
3408
                                        {
3409
                                                exists_lo=true;
3410
                                                value_lo=Double.parseDouble(gtParameterValues[j]);
3411
                                        }
3412
                                        if(gtParameterName.equalsIgnoreCase("scale_factor"))
3413
                                        {
3414
                                                exists_sf=true;
3415
                                                value_sf=Double.parseDouble(gtParameterValues[j]);
3416
                                        }
3417
                                }
3418
                                if(exists_sf&&exists_lo)
3419
                                {
3420
                                        if(value_sf!=1.0&&value_lo!=0.0)
3421
                                        {
3422
                                                throw new CrsException(new Exception("The 'Mercator' proj4 projection doesn't allow scale factor and latitude of origin."));
3423
                                        }
3424
                                        else if(projectionName.equals("Mercator_1SP"))
3425
                                                exists_lo=false;
3426
                                        else if(projectionName.equals("Mercator_2SP"))
3427
                                                exists_sf=false;
3428
                                        /*
3429
                                        else if(value_sf!=1.0)
3430
                                                exists_lo=false;
3431
                                        else if(value_sf==1.0)
3432
                                                exists_sf=false;
3433
                                        */
3434
                                }
3435
                                if(projectionName.equalsIgnoreCase("Popular_Visualisation_Pseudo_Mercator"))
3436
                                        value_sf=1.0;
3437
                                        exists_sf=true;
3438
                        }
3439
                        else if(projectionAcronym[0].equals("lcc"))
3440
                        {
3441
                                if(projectionName.equalsIgnoreCase("Lambert_Conformal_Conic_1SP"))
3442
                                {
3443
                                        isLcc1sp=true;
3444
                                }
3445
                        }
3446
                        else if(projectionAcronym[0].equals("stere"))
3447
                        {
3448
                                if(projectionName.equalsIgnoreCase("Polar_Stereographic")) // lat_ts=lat_0={90 o -90)
3449
                                {
3450
                                        isSterePolar=true;
3451
                                        for(int j=0;j<gtParameterNames.length;j++)
3452
                                        {
3453
                                                String gtParameterName=gtParameterNames[j].trim();
3454
                                                if(gtParameterName.equalsIgnoreCase("scale_factor"))
3455
                                                {
3456
                                                        double value_sf=Double.parseDouble(gtParameterValues[j]);
3457
                                                        exists_sf=true;
3458
                                                        //if(Math.abs(value_sf-1.0)>0.000001)
3459
                                                        //        exists_sf=true;
3460
                                                }
3461
                                                if(gtParameterName.equalsIgnoreCase("latitude_of_standard_parallel"))
3462
                                                {
3463
                                                        value_stdPar=Double.parseDouble(gtParameterValues[j]);
3464
                                                        exists_stdPar=true;
3465
                                                }
3466
                                        }
3467
                                }
3468
                                if(projectionName.equalsIgnoreCase("Stereographic")) // No admite lat_ts
3469
                                {
3470
                                        // Comprobamos si es polar
3471
                                        boolean isPolar=false;
3472
                                        for(int j=0;j<gtParameterNames.length;j++)
3473
                                        {
3474
                                                String gtParameterAcronymn=((String)parameterAcronyms.get(j)).trim();
3475
                                                if(gtParameterNames[j].equalsIgnoreCase("latitude_of_origin"))
3476
                                                //if(gtParameterAcronymn.equalsIgnoreCase("lat_0"))
3477
                                                {
3478
                                                        double gtParameterValue=Double.parseDouble(gtParameterValues[j]);
3479
                                                        if(Math.abs(gtParameterValue-90.0)<angularTolerance) isPolar=true;
3480
                                                        else if(Math.abs(gtParameterValue-(-90.0))<angularTolerance)  isPolar=true;
3481
                                                        break;
3482
                                                }
3483
                                        }
3484
                                        if(isPolar)
3485
                                        {
3486
                                                isSterePolar=true;
3487
                                                strProjectionAcronym="stere";
3488
                                                for(int j=0;j<gtParameterNames.length;j++)
3489
                                                {
3490
                                                        String gtParameterName=gtParameterNames[j].trim();
3491
                                                        if(gtParameterName.equalsIgnoreCase("scale_factor"))
3492
                                                        {
3493
                                                                double value_sf=Double.parseDouble(gtParameterValues[j]);
3494
                                                                exists_sf=true;
3495
                                                                //if(Math.abs(value_sf-1.0)>0.000001)
3496
                                                                //        exists_sf=true;
3497
                                                        }
3498
                                                        if(gtParameterName.equalsIgnoreCase("latitude_of_standard_parallel"))
3499
                                                        {
3500
                                                                value_stdPar=Double.parseDouble(gtParameterValues[j]);
3501
                                                                exists_stdPar=true;
3502
                                                        }
3503
                                                }
3504
                                        }
3505
                                        if(!isPolar)
3506
                                        {
3507
                                                isStereOblique=true;
3508
                                                if(exists_stdPar)
3509
                                                {
3510
                                                        throw new CrsException(new Exception("In proj4 projection Oblique Stereographic does not allow parameter latitude of standard parallel."));
3511
                                                }
3512
                                                strProjectionAcronym="sterea";
3513
                                        }
3514
                                }
3515
                        }
3516
                        else if(projectionAcronym[0].equals("omerc"))
3517
                        {
3518
                                boolean existsLat1=false;
3519
                                boolean existsLat2=false;
3520
                                boolean existsLon1=false;
3521
                                boolean existsLon2=false;
3522
                                // Necesito buscar un caso de ejemplo
3523
                        }
3524
                        else if(projectionAcronym[0].equals("mill"))
3525
                        {
3526
                                strExtraProj4="+R_A ";
3527
                        }
3528
                        else if(projectionAcronym[0].equals("vandg"))
3529
                        {
3530
                                strExtraProj4="+R_A ";
3531
                        }
3532
                        else if(projectionAcronym[0].equals("labrd"))
3533
                        {
3534
                                isLaborde=true;
3535
                        }
3536
                        
3537
                        strProj4=strProj4+strProjectionAcronym+" ";
3538

    
3539
                        for(int i=0;i<parameterNames.size();i++)
3540
                        {
3541
                                boolean control=true;
3542
                                String parameterName=((String)parameterNames.get(i)).trim();
3543
                                String parameterAcronym=((String)parameterAcronyms.get(i)).trim();
3544
                                String strParameterValue=((String)parameterValues.get(i)).trim();
3545
                                if(isMerc)
3546
                                {
3547
                                        if(parameterName.equalsIgnoreCase("latitude_of_origin")
3548
                                                        ||parameterName.equalsIgnoreCase("standard_parallel_1")
3549
                                                        ||parameterName.equalsIgnoreCase("latitude_of_center"))
3550
                                        {
3551
                                                if(!exists_lo)
3552
                                                        control=false;
3553
                                        }
3554
                                        if(parameterName.equalsIgnoreCase("scale_factor"))
3555
                                        {
3556
                                                if(!exists_sf)
3557
                                                        control=false;
3558
                                        }
3559
                                }
3560
                                if(isSterePolar)
3561
                                {
3562
                                        String gtParameterAcronymn=((String)parameterAcronyms.get(i)).trim();
3563
                                        if(gtParameterAcronymn.equalsIgnoreCase("lat_0")) // Esto resuelve el caso del EPSG:3031
3564
                                        {
3565
                                                if(exists_stdPar){
3566
                                                        double parameterValue=Double.parseDouble(strParameterValue);
3567
                                                        if((parameterValue>0)&&(value_stdPar<0)){
3568
                                                                strParameterValue="-90.0";
3569
                                                        }
3570
                                                        if((parameterValue<0)&&(value_stdPar>0)){
3571
                                                                strParameterValue="90.0";
3572
                                                        }
3573
                                                }
3574
                                        }
3575
                                        
3576
                                        if(gtParameterAcronymn.equalsIgnoreCase("lat_ts"))
3577
                                        {
3578
                                                if(exists_sf)
3579
                                                        control=false;
3580
                                        }
3581
                                        if(parameterName.equalsIgnoreCase("scale_factor"))
3582
                                        {
3583
                                                if(!exists_sf)
3584
                                                        control=false;
3585
                                        }
3586
                                }
3587
                                if(isSomerc)
3588
                                {
3589
                                        if(parameterName.equals("rectified_grid_angle"))
3590
                                                control=false;
3591
                                        if(parameterName.equals("azimuth"))
3592
                                                control=false;
3593
                                }
3594
                                if(isOmerc)
3595
                                {
3596
                                        if(parameterName.equals("rectified_grid_angle"))
3597
                                        {
3598
                                                if(existsAlpha)
3599
                                                        control=false;
3600
                                                else
3601
                                                        parameterAcronym="alpha";
3602
                                        }
3603
                                }
3604
                                if(parameterAcronym.equals("lon_0")
3605
                                                ||parameterAcronym.equals("lonc"))
3606
                                {
3607
                                        double parameterValue=Double.parseDouble(strParameterValue);
3608
                                        if(!projectionAcronym[0].equalsIgnoreCase("krovak"))
3609
                                        {
3610
                                                parameterValue=parameterValue-primeMeridianValue;
3611
                                        }
3612
                                        strParameterValue=Double.toString(parameterValue);
3613
                                }
3614
                                if(control)
3615
                                        strProj4=strProj4+"+"+parameterAcronym+"="+strParameterValue+" ";
3616
                                if(isLcc1sp)
3617
                                {
3618
                                        if(parameterAcronym.equals("lat_0"))
3619
                                        {
3620
                                                strProj4=strProj4+"+lat_1="+strParameterValue+" ";
3621
                                                strProj4=strProj4+"+lat_2="+strParameterValue+" ";
3622
                                        }
3623
                                }
3624
                        }
3625
                        if(isLaborde)
3626
                                strProj4+="+azi=18.9 +lat_0=-18.9 +lon_0=44.1 +k_0=0.9995 +x_0=400000 +y_0=800000 +ellps=intl ";
3627
                        strProj4+=strExtraProj4;
3628
                        //getProj4ProjectionName();
3629
                }
3630
                
3631
                // Que pasa si no hay elipsoide? -> OGR por defecto pone WGS84
3632
                double a=0;
3633
                double inv_f=0;
3634
                String elipName=crs.getCrsWkt().getSpheroid()[0];
3635
                a=Double.parseDouble(crs.getCrsWkt().getSpheroid()[1]);
3636
                inv_f=Double.parseDouble(crs.getCrsWkt().getSpheroid()[2]);
3637
                if (crs.getCode() == 3857)
3638
                        inv_f = Double.POSITIVE_INFINITY;
3639
                String strEllipseAcronym=ellipseToProj4(a,inv_f);
3640
                String strEllipse="";                        
3641
                if(strEllipseAcronym.equals(""))
3642
                {
3643
                        if (!Double.isInfinite(inv_f))
3644
                        {
3645
                                if(inv_f>0.0)
3646
                                        strEllipse="+a="+a+" +rf="+inv_f+" ";
3647
                                else
3648
                                        strEllipse="+R="+a+" ";
3649
                        }
3650
                        /*
3651
                        else
3652
                                strEllipse="+R="+a+" ";
3653
                        */
3654
                }
3655
                else
3656
                {
3657
                        strEllipse="+ellps="+strEllipseAcronym+" ";
3658
                }
3659
                strProj4+=strEllipse;
3660
                //System.out.println("Elipsoide["+elipName+"]=("+a+","+inv_f+")");
3661
                if(!strProj4Datum.equals(""))
3662
                {
3663
                        strProj4+=strProj4Datum;
3664
                }
3665
                strProj4+=primeMeridianAcronym;
3666
                String strWkt=crs.getWKT();
3667
                if(!strProj4ToMeter.equals(""))
3668
                        strProj4+=strProj4ToMeter;
3669
                
3670
                //System.out.println("- Cadena proj4: "+strProj4);
3671
                return strProj4;                
3672
        }
3673
                
3674
        public String exportToProj4(CoordinateReferenceSystem crs) throws CrsException
3675
        {
3676
                String strProj4="+proj=";
3677
                String[] primeMeridian = new String[2];
3678
                String strProj="";
3679
                String strProjName="";
3680
                String strDatumName="";
3681
                String strDatumCode="";
3682
                String strProj4Datum="";
3683
                String strProj4ToMeter="";
3684
                String[] gtParameterValues=new String[1];
3685
                String[] gtParameterNames= new String[1];
3686
                String[] spheroid = new String[3];
3687
                double a=0;
3688
                double inv_f=0;
3689
                String elipName="";
3690
                if (crs instanceof DefaultProjectedCRS) {
3691
                        DefaultProjectedCRS crsProjected = (DefaultProjectedCRS) crs;
3692
                        primeMeridian = Primem(((DefaultGeodeticDatum) crsProjected.getDatum()).getPrimeMeridian());
3693
                        String[] proj = crsProjected.getName().toString().split(":");
3694
                        if (proj.length>1)
3695
                                strProj = proj[1];
3696
                        else
3697
                                strProj = proj[0];
3698
                        strProjName = getName(crsProjected.getConversionFromBase().getMethod().getName());
3699
                        gtParameterValues = new String[crsProjected.getConversionFromBase().getParameterValues().values().size()];
3700
                        gtParameterNames = new String[crsProjected.getConversionFromBase().getParameterValues().values().size()];
3701
                        String str;
3702
                        for (int i=0; i< crsProjected.getConversionFromBase().getParameterValues().values().size();i++) {
3703
                                str = crsProjected.getConversionFromBase().getParameterValues().values().get(i).toString();
3704
                                Unit u = crsProjected.getConversionFromBase().getParameterValues().parameter(str.split("=")[0]).getUnit();
3705
                                double value = crsProjected.getConversionFromBase().getParameterValues().parameter(str.split("=")[0]).doubleValue();
3706
                                value = convert(value, u.toString());
3707
                                gtParameterNames[i] = str.split("=")[0];
3708
                                gtParameterValues [i] = String.valueOf(value);
3709
                        }
3710
                        spheroid = Spheroid(((DefaultGeodeticDatum) crsProjected.getDatum()).getEllipsoid());
3711
                        elipName=spheroid[0];
3712
                        a=Double.parseDouble(spheroid[1]);
3713
                        inv_f=Double.parseDouble(spheroid[2]);
3714
                        Ellipsoid ellip = ((DefaultGeodeticDatum) crsProjected.getDatum()).getEllipsoid();
3715
            Unit unit = ellip.getAxisUnit();
3716
            String[] i_un = unit.toString().split("[*]");
3717
                if (i_un.length>1)
3718
                {
3719
                        try{
3720
                                a=a*Double.parseDouble(i_un[1].replaceAll("]", ""));
3721
                                //factor_to_meter=Double.parseDouble(un[1].replaceAll("]", ""));
3722
                        }
3723
                        catch(java.lang.NumberFormatException t){}
3724
                }
3725
                else if (i_un[0].equals("m"))
3726
                {
3727
                        try{
3728
                                //factor_to_meter=Double.parseDouble(un[0]);
3729
                        }
3730
                        catch(java.lang.NumberFormatException t){}
3731
                } else if (i_un[0].equals("ft")) {
3732
                        /**
3733
                         * Cuando viene en otro formato, coger el valor de la unidad
3734
                         * correspondiente...
3735
                         */
3736
                        //Caso de los pies
3737
                        //factor_to_meter = 0.3048;
3738
                }
3739
                        // Extracci?n del c?digo de Datum
3740
                        String codDatum="0";
3741
                        String[] val=((DefaultProjectedCRS)crs).getDatum().getName().toString().split(":");
3742
                        if (val.length<2)
3743
                                strDatumName=val[0];
3744
                        else
3745
                                strDatumName=val[1];
3746
                for (Iterator iter =((DefaultProjectedCRS)crs).getDatum().getIdentifiers().iterator();iter.hasNext();) {
3747
                    Identifier element = (Identifier) iter.next();
3748
                    codDatum = element.getCode();          
3749
                }
3750
                int intCodDatum=Integer.parseInt(codDatum);
3751
                strProj4Datum=datumToProj4(strDatumName,intCodDatum);
3752
                double factor_to_meter=1.0;
3753
                Unit u = crs.getCoordinateSystem().getAxis(0).getUnit();
3754
                String[] un = u.toString().split("[*]");
3755
                if (un.length>1)
3756
                {
3757
                        try{
3758
                                factor_to_meter=Double.parseDouble(un[1].replaceAll("]", ""));
3759
                        }
3760
                        catch(java.lang.NumberFormatException t){}
3761
                }
3762
                else if (un[0].equals("m"))
3763
                {
3764
                        try{
3765
                                factor_to_meter=Double.parseDouble(un[0]);
3766
                        }
3767
                        catch(java.lang.NumberFormatException t){}
3768
                } else if (un[0].equals("ft")) {
3769
                        /**
3770
                         * Cuando viene en otro formato, coger el valor de la unidad
3771
                         * correspondiente...
3772
                         */
3773
                        //Caso de los pies
3774
                        factor_to_meter = 0.3048;
3775
                }
3776
                if(factor_to_meter!=1.0)
3777
                        strProj4ToMeter="+to_meter="+factor_to_meter+" ";
3778
                else
3779
                        strProj4ToMeter="+units=m ";
3780

    
3781
                }
3782
                else if (crs instanceof DefaultGeographicCRS) {
3783
                        DefaultGeographicCRS crsGeographic = (DefaultGeographicCRS) crs;
3784
                        primeMeridian = Primem(((DefaultGeodeticDatum) crsGeographic.getDatum()).getPrimeMeridian());
3785
                        spheroid = Spheroid(((DefaultGeodeticDatum) crsGeographic.getDatum()).getEllipsoid());
3786
                        elipName=spheroid[0];
3787
                        a=Double.parseDouble(spheroid[1]);
3788
                        inv_f=Double.parseDouble(spheroid[2]);
3789
                        Ellipsoid ellip = ((DefaultGeodeticDatum) crsGeographic.getDatum()).getEllipsoid();
3790
            Unit unit = ellip.getAxisUnit();
3791
            String[] i_un = unit.toString().split("[*]");
3792
                if (i_un.length>1)
3793
                {
3794
                        try{
3795
                                a=a*Double.parseDouble(i_un[1].replaceAll("]", ""));
3796
                                //factor_to_meter=Double.parseDouble(un[1].replaceAll("]", ""));
3797
                        }
3798
                        catch(java.lang.NumberFormatException t){}
3799
                }
3800
                else if (i_un[0].equals("m"))
3801
                {
3802
                        try{
3803
                                //factor_to_meter=Double.parseDouble(un[0]);
3804
                        }
3805
                        catch(java.lang.NumberFormatException t){}
3806
                } else if (i_un[0].equals("ft")) {
3807
                        /**
3808
                         * Cuando viene en otro formato, coger el valor de la unidad
3809
                         * correspondiente...
3810
                         */
3811
                        //Caso de los pies
3812
                        //factor_to_meter = 0.3048;
3813
                }
3814

    
3815
            // Extracci?n del c?digo de Datum
3816
                        String codDatum="0";
3817
                        String[] val=((DefaultGeographicCRS)crs).getDatum().getName().toString().split(":");
3818
                        if (val.length<2)
3819
                                strDatumName=val[0];
3820
                        else
3821
                                strDatumName=val[1];
3822
                for (Iterator iter =((DefaultGeographicCRS)crs).getDatum().getIdentifiers().iterator();iter.hasNext();) {
3823
                    Identifier element = (Identifier) iter.next();
3824
                    codDatum = element.getCode();          
3825
                }
3826
                int intCodDatum=Integer.parseInt(codDatum);
3827
                strProj4Datum=datumToProj4(strDatumName,intCodDatum);
3828
                }
3829
                else {
3830
                        throw(new CrsException(new Exception("the crs is not a geographic nor projected CRS")));
3831
                }
3832
                
3833
                String primeMeridianName=primeMeridian[0];
3834
                double primeMeridianValue = -1;
3835
                if (primeMeridian[1] == null) {
3836
                        throw(new CrsException(new Exception("Null value not allowed for prime meridiam parameters")));
3837
                } else {
3838
                        primeMeridianValue=Double.parseDouble(primeMeridian[1]); // -> hacer el cambio de unidades
3839
                }                
3840
                String[] strPrimeMeridianProj4=primeMeridianToProj4(primeMeridianName,primeMeridianValue);
3841
                primeMeridianValue=Double.parseDouble(strPrimeMeridianProj4[1]);
3842
                primeMeridianName=strPrimeMeridianProj4[0];
3843
                String primeMeridianAcronym=strPrimeMeridianProj4[2]; // Puede ser cadena vacia->Analizar
3844

    
3845
                if(strProj.equals(""))
3846
                {
3847
                        //System.out.println("Projection Name = "+"Geodetic");
3848
                        strProj4+="longlat ";
3849
                }
3850
                else
3851
                {
3852
                        int indexProj=findProjection(strProjName);
3853
                        if(indexProj==-1) {
3854
                                throw(new CrsException(new Exception("The projection '"+strProjName+"' not in proj4.")));
3855
                        }
3856
                        String projectionName=(getProj4ProjectionName(indexProj)).trim();
3857
                        ArrayList parameterNames=getProj4ProjectionParameters(indexProj);
3858
                        ArrayList parameterAcronyms=getProj4ProjectionParameterAcronyms(indexProj);
3859
                        ArrayList parameterValues=getProj4ProjectionParameterDefaultValues(indexProj);
3860
                        ArrayList parameterMaxValues=getProj4ProjectionParameterMaxValues(indexProj);
3861
                        ArrayList parameterMinValues=getProj4ProjectionParameterMinValues(indexProj);
3862
                        for(int i=0;i<parameterNames.size();i++)
3863
                        {
3864
                                boolean existsParameter=false;
3865
                                String parameterValue="";
3866
                                for(int j=0;j<gtParameterNames.length;j++)
3867
                                {
3868
                                        String gtParameterName=gtParameterNames[j].trim();
3869
                                        //System.out.println( gtParameterName);
3870
                                        //int posGtParameter=findProjectionParameter(gtParameterName);
3871
                                        int posGtParameter=findProjectionParameters(gtParameterName,(String)parameterNames.get(i));
3872
                                        //int posParameter=findProjectionParameter((String)parameterNames.get(i));
3873
                                        //if(((String)parameterNames.get(i)).trim().equals(gtParameterNames[j].trim()))
3874
                                        if(posGtParameter!=-1)
3875
                                        {
3876
                                                gtParameterName=getProj4ProjectionParameterName(posGtParameter);
3877
                                                gtParameterNames[j]=gtParameterName;
3878
                                                existsParameter=true;
3879
                                                double maxValue=Double.parseDouble((String)parameterMaxValues.get(i));
3880
                                                double minValue=Double.parseDouble((String)parameterMinValues.get(i));
3881
                                                //parameterValue=Double.parseDouble(gtParameterValues[j]);
3882
                                                parameterValue=gtParameterValues[j]; // Ojo unidades -> analizar
3883
                                                double auxValue=Double.parseDouble(parameterValue);
3884
                                                if((auxValue<minValue)||(auxValue>maxValue)) {
3885
                                                        throw(new CrsException(new Exception("The parameter '"+gtParameterName+"' is out of domain.")));
3886
                                                } else if (((String)parameterNames.get(i)).trim().equals("scale_factor") && (auxValue==minValue)) {
3887
                                                        String strError="the_parameter";
3888
                                                        String strError2=gtParameterName;
3889
                                                        String strError3="out_of_domain";
3890
                                                        throw(new CrsException(new Exception("The parameter '"+gtParameterName+"' is out of domain.")));
3891
                                                }
3892
                                                break;
3893
                                        }
3894
                                        /*else
3895
                                        {
3896
                                                String strError="El parametro recibido de GeoTools ";
3897
                                                strError+=gtParameterName;
3898
                                                strError+=" no esta contemplado en la proyeccion";
3899
                                                System.out.println(strError);
3900
                                                throw new CrsException(new Exception());
3901
                                        }*/
3902
                                }
3903
                                if(existsParameter)
3904
                                {
3905
                                        parameterValues.set(i,parameterValue);
3906
                                }                        
3907
                        }
3908
                        boolean isSomerc=false;
3909
                        boolean isOmerc=false;
3910
                        boolean isLcc=false;
3911
                        double valueAlpha=0;
3912
                        double valueGamma=0;
3913
                        boolean existsAlpha=false;
3914
                        boolean existsGamma=false;
3915
                        String[] projectionAcronym=(String[])projectionAcronymList.get(indexProj);
3916
                        if(projectionName.equals("Lambert_Conformal_Conic"))
3917
                        {
3918
                                for(int i=0;i<parameterNames.size();i++)
3919
                                {
3920
                                        boolean control=true;
3921
                                        String parameterName=((String)parameterNames.get(i)).trim();
3922
                                        if(parameterName.equalsIgnoreCase("standard_parallel_2"))
3923
                                                isLcc=true;
3924
                                }
3925
                        }
3926
                        if(projectionName.equals("Oblique_Mercator"))
3927
                        {
3928
                                isOmerc=true;
3929
                                // TODO Set isSomerc as true for EPSG:21781  
3930
                                //if (crs.getCode()==21781)
3931
                                //        isSomerc=true;
3932
                                for(int j=0;j<gtParameterNames.length;j++)
3933
                                {
3934
                                        String gtParameterName=gtParameterNames[j].trim();
3935
                                        if(gtParameterName.equalsIgnoreCase("latitude_of_origin")
3936
                                                        ||gtParameterName.equalsIgnoreCase("standard_parallel_1")
3937
                                                        ||gtParameterName.equalsIgnoreCase("latitude_of_center"))
3938
                                        {
3939
                                                double value=Double.parseDouble(gtParameterValues[j]);
3940
                                                if(Math.abs(Math.abs(value)-90.0)<0.0001)
3941
                                                {
3942
                                                        throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow latitude origin close to the poles."));
3943
                                                }
3944
                                        }
3945
                                        if(gtParameterName.equalsIgnoreCase("azimuth"))
3946
                                        {
3947
                                                valueAlpha=Double.parseDouble(gtParameterValues[j]);
3948
                                                //if(Math.abs(valueAlpha-90.0)<0.0001)
3949
                                                if (valueAlpha > 90.0)
3950
                                                {
3951
                                                        //throw new CrsException(new Exception("In proj4 projection 'Oblique_Mercator' not allow azimut close to 90"));
3952
                                                        throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow azimut values > 90"));
3953
                                                }
3954
                                                if(Math.abs(valueAlpha-270.0)<0.0001)
3955
                                                {
3956
                                                        throw new CrsException(new Exception("In proj4 the 'Oblique_Mercator' projection doesn't allow azimut close to 270."));
3957
                                                }
3958
                                                existsAlpha=true;
3959
                                        }
3960
                                        if(gtParameterName.equalsIgnoreCase("rectified_grid_angle"))
3961
                                        {
3962
                                                valueGamma=Double.parseDouble(gtParameterValues[j]);
3963
                                                existsGamma=true;
3964
                                        }
3965
                                }
3966
                                if(existsAlpha&&existsGamma)
3967
                                {
3968
                                        if(Math.abs(valueAlpha-valueGamma)>0.00000001)
3969
                                        {
3970
                                                throw new CrsException(new Exception("The proj4 projection 'Oblique Mercator' not allow diferent azimut and spin axis."));
3971
                                        }
3972
                                }
3973
                                
3974
                                // Necesito buscar un caso de ejemplo
3975
                        }
3976
                        if(projectionName.equals("Hotine_Oblique_Mercator_Two_Point_Center"))
3977
                        {
3978
                                double lat_1=0.0;
3979
                                double lat_2=0.0;
3980
                                boolean exists_Lat_1=false;
3981
                                boolean exists_Lat_2=false;
3982
                                for(int j=0;j<gtParameterNames.length;j++)
3983
                                {
3984
                                        String gtParameterName=gtParameterNames[j].trim();
3985
                                        if(gtParameterName.equalsIgnoreCase("Latitude_Of_1st_Point"))
3986
                                        {
3987
                                                double value=Double.parseDouble(gtParameterValues[j]);
3988
                                        }
3989
                                        if(gtParameterName.equalsIgnoreCase("Latitude_Of_2nd_Point"))
3990
                                        {
3991
                                                double value=Double.parseDouble(gtParameterValues[j]);
3992
                                        }
3993
                                }
3994
                                if(exists_Lat_1&&exists_Lat_2)
3995
                                {
3996
                                        if(Math.abs(lat_1-lat_2)<0.0001)
3997
                                        {
3998
                                                throw new CrsException(new Exception("The proj4 projection 'Hotine-Oblique Mercator Two Points' not allow lat1 equal to lat2."));
3999
                                        }
4000
                                        if(Math.abs(lat_1)<0.0001)
4001
                                        {
4002
                                                throw new CrsException(new Exception("The proj4 projection 'Hotine-Oblique Mercator Two Points' not allow not zero lat1."));
4003
                                        }
4004
                                        if(Math.abs(Math.abs(lat_2)-90)<0.0001)
4005
                                        {
4006
                                                throw new CrsException(new Exception("The proj4 projection 'Hotine-Oblique Mercator Two Points' not allow values of 90 or minus 90 in lat2."));
4007
                                        }
4008
                                }
4009
                        }
4010
                        String projAcronym=projectionAcronym[0];
4011
                        if(isLcc)
4012
                                projAcronym="lcc";
4013
                        String strExtraProj4="";
4014
                        // Control de casos especiales
4015
                        boolean isLaborde=false;
4016
                        boolean isLcc1sp=false;
4017
                        boolean isMerc=false;
4018
                        boolean exists_sf=false;
4019
                        boolean exists_lo=false;
4020
                        boolean isSterePolar=false;
4021
                        boolean isStereOblique=false;  // pondremos +proj=sterea
4022
                        boolean exists_stdPar=false;
4023
                        double value_stdPar=0.0;
4024
                        if(projectionAcronym[0].equals("merc")) // 1 - Mercator
4025
                        {
4026
                                isMerc=true;
4027
                                double value_sf=0.0;
4028
                                double value_lo=0.0;
4029
                                for(int j=0;j<gtParameterNames.length;j++)
4030
                                {
4031
                                        String gtParameterName=gtParameterNames[j].trim();
4032
                                        if(gtParameterName.equalsIgnoreCase("latitude_of_origin")
4033
                                                        ||gtParameterName.equalsIgnoreCase("standard_parallel_1")
4034
                                                        ||gtParameterName.equalsIgnoreCase("latitude_of_center"))
4035
                                        {
4036
                                                exists_lo=true;
4037
                                                value_lo=Double.parseDouble(gtParameterValues[j]);
4038
                                        }
4039
                                        if(gtParameterName.equalsIgnoreCase("scale_factor"))
4040
                                        {
4041
                                                exists_sf=true;
4042
                                                value_sf=Double.parseDouble(gtParameterValues[j]);
4043
                                        }
4044
                                }
4045
                                if(exists_sf&&exists_lo)
4046
                                {
4047
                                        if(value_sf!=1.0&&value_lo!=0.0)
4048
                                        {
4049
                                                throw new CrsException(new Exception("The 'Mercator' proj4 projection doesn't allow scale factor and latitude of origin."));
4050
                                        }
4051
                                        else if(projectionName.equals("Mercator_1SP"))
4052
                                                exists_lo=false;
4053
                                        else if(projectionName.equals("Mercator_2SP"))
4054
                                                exists_sf=false;
4055
                                        /*
4056
                                        else if(value_sf!=1.0)
4057
                                                exists_lo=false;
4058
                                        else if(value_sf==1.0)
4059
                                                exists_sf=false;
4060
                                        */
4061
                                }
4062
                                if(projectionName.equalsIgnoreCase("Popular_Visualisation_Pseudo_Mercator"))
4063
                                        value_sf=1.0;
4064
                                        exists_sf=true;
4065
                                        inv_f = Double.POSITIVE_INFINITY;
4066
                        }
4067
                        else if(projectionAcronym[0].equals("lcc"))
4068
                        {
4069
                                if(projectionName.equalsIgnoreCase("Lambert_Conformal_Conic_1SP"))
4070
                                {
4071
                                        isLcc1sp=true;
4072
                                }
4073
                        }
4074
                        else if(projectionAcronym[0].equals("stere"))
4075
                        {
4076
                                if(projectionName.equalsIgnoreCase("Polar_Stereographic")) // lat_ts=lat_0={90 o -90)
4077
                                {
4078
                                        isSterePolar=true;
4079
                                        for(int j=0;j<gtParameterNames.length;j++)
4080
                                        {
4081
                                                String gtParameterName=gtParameterNames[j].trim();
4082
                                                if(gtParameterName.equalsIgnoreCase("scale_factor"))
4083
                                                {
4084
                                                        double value_sf=Double.parseDouble(gtParameterValues[j]);
4085
                                                        exists_sf=true;
4086
                                                        //if(Math.abs(value_sf-1.0)>0.000001)
4087
                                                        //        exists_sf=true;
4088
                                                }
4089
                                                if(gtParameterName.equalsIgnoreCase("latitude_of_standard_parallel"))
4090
                                                {
4091
                                                        value_stdPar=Double.parseDouble(gtParameterValues[j]);
4092
                                                        exists_stdPar=true;
4093
                                                }
4094
                                        }
4095
                                }
4096
                        }
4097
                        if(projectionName.equalsIgnoreCase("Stereographic")) // No admite lat_ts
4098
                        {
4099
                                // Comprobamos si es polar
4100
                                boolean isPolar=false;
4101
                                for(int j=0;j<gtParameterNames.length;j++)
4102
                                {
4103
                                        String gtParameterAcronymn=((String)parameterAcronyms.get(j)).trim();
4104
                                        //if(gtParameterAcronymn.equalsIgnoreCase("lat_0"))
4105
                                        if(gtParameterNames[j].equalsIgnoreCase("latitude_of_origin"))
4106
                                        {
4107
                                                double gtParameterValue=Double.parseDouble(gtParameterValues[j]);
4108
                                                if(Math.abs(gtParameterValue-90.0)<angularTolerance) isPolar=true;
4109
                                                else if(Math.abs(gtParameterValue-(-90.0))<angularTolerance)  isPolar=true;
4110
                                                break;
4111
                                        }
4112
                                }
4113
                                if(isPolar)
4114
                                {
4115
                                        isSterePolar=true;
4116
                                        projAcronym="stere";
4117
                                        for(int j=0;j<gtParameterNames.length;j++)
4118
                                        {
4119
                                                String gtParameterName=gtParameterNames[j].trim();
4120
                                                if(gtParameterName.equalsIgnoreCase("scale_factor"))
4121
                                                {
4122
                                                        double value_sf=Double.parseDouble(gtParameterValues[j]);
4123
                                                        exists_sf=true;
4124
                                                        //if(Math.abs(value_sf-1.0)>0.000001)
4125
                                                        //        exists_sf=true;
4126
                                                }
4127
                                                if(gtParameterName.equalsIgnoreCase("latitude_of_standard_parallel"))
4128
                                                {
4129
                                                        value_stdPar=Double.parseDouble(gtParameterValues[j]);
4130
                                                        exists_stdPar=true;
4131
                                                }
4132
                                        }
4133
                                }
4134
                                if(!isPolar)
4135
                                {
4136
                                        isStereOblique=true;
4137
                                        projAcronym="sterea";
4138
                                        if(exists_stdPar)
4139
                                        {
4140
                                                throw new CrsException(new Exception("The proj4 projection 'Oblique Stereographic' not allow parameter latitude of standard parallel."));
4141
                                        }
4142
                                }
4143
                        }
4144
                        else if(projectionAcronym[0].equals("mill"))
4145
                        {
4146
                                strExtraProj4="+R_A ";
4147
                        }
4148
                        else if(projectionAcronym[0].equals("vandg"))
4149
                        {
4150
                                strExtraProj4="+R_A ";
4151
                        }
4152
                        else if(projectionAcronym[0].equals("labrd"))
4153
                        {
4154
                                isLaborde=true;
4155
                        }
4156
                        strProj4=strProj4+projAcronym+" ";
4157

    
4158
                        for(int i=0;i<parameterNames.size();i++)
4159
                        {
4160
                                boolean control=true;
4161
                                String parameterName=((String)parameterNames.get(i)).trim();
4162
                                String parameterAcronym=((String)parameterAcronyms.get(i)).trim();
4163
                                String strParameterValue=((String)parameterValues.get(i)).trim();
4164
                                if(isMerc)
4165
                                {
4166
                                        if(parameterName.equalsIgnoreCase("latitude_of_origin")
4167
                                                        ||parameterName.equalsIgnoreCase("standard_parallel_1")
4168
                                                        ||parameterName.equalsIgnoreCase("latitude_of_center"))
4169
                                        {
4170
                                                if(!exists_lo)
4171
                                                        control=false;
4172
                                        }
4173
                                        if(parameterName.equalsIgnoreCase("scale_factor"))
4174
                                        {
4175
                                                if(!exists_sf)
4176
                                                        control=false;
4177
                                        }
4178
                                }
4179
                                if(isSterePolar)
4180
                                {
4181
                                        String gtParameterAcronymn=((String)parameterAcronyms.get(i)).trim();
4182
                                        if(gtParameterAcronymn.equalsIgnoreCase("lat_0")) // Esto resuelve el caso del EPSG:3031
4183
                                        {
4184
                                                if(exists_stdPar){
4185
                                                        double parameterValue=Double.parseDouble(strParameterValue);
4186
                                                        if((parameterValue>0)&&(value_stdPar<0)){
4187
                                                                strParameterValue="-90.0";
4188
                                                        }
4189
                                                        if((parameterValue<0)&&(value_stdPar>0)){
4190
                                                                strParameterValue="90.0";
4191
                                                        }
4192
                                                }
4193
                                        }
4194
                                        if(gtParameterAcronymn.equalsIgnoreCase("lat_ts"))
4195
                                        {
4196
                                                if(exists_sf)
4197
                                                        control=false;
4198
                                        }
4199
                                        if(parameterName.equalsIgnoreCase("scale_factor"))
4200
                                        {
4201
                                                if(!exists_sf)
4202
                                                        control=false;
4203
                                        }
4204
                                }
4205
                                if(isSomerc)
4206
                                {
4207
                                        if(parameterName.equals("rectified_grid_angle"))
4208
                                                control=false;
4209
                                        if(parameterName.equals("azimuth"))
4210
                                                control=false;
4211
                                }
4212
                                if(isOmerc)
4213
                                {
4214
                                        if(parameterName.equals("rectified_grid_angle"))
4215
                                        {
4216
                                                if(existsAlpha)
4217
                                                        control=false;
4218
                                                else
4219
                                                        parameterAcronym="alpha";
4220
                                        }
4221
                                }
4222
                                if(parameterAcronym.equals("lon_0")
4223
                                                ||parameterAcronym.equals("lonc"))
4224
                                {
4225
                                        double parameterValue=Double.parseDouble(strParameterValue);
4226
                                        if(!projectionAcronym[0].equalsIgnoreCase("krovak"))
4227
                                        {
4228
                                                parameterValue=parameterValue-primeMeridianValue;
4229
                                        }
4230
                                        strParameterValue=Double.toString(parameterValue);
4231
                                }
4232
                                if(control)
4233
                                        strProj4=strProj4+"+"+parameterAcronym+"="+strParameterValue+" ";
4234
                                if(isLcc1sp)
4235
                                {
4236
                                        if(parameterAcronym.equals("lat_0"))
4237
                                        {
4238
                                                strProj4=strProj4+"+lat_1="+strParameterValue+" ";
4239
                                                strProj4=strProj4+"+lat_2="+strParameterValue+" ";
4240
                                        }
4241
                                }
4242
                        }
4243
                        if(isLaborde)
4244
                                strProj4+="+azi=18.9 +lat_0=-18.9 +lon_0=44.1 +k_0=0.9995 +x_0=400000 +y_0=800000 +ellps=intl ";
4245
                        strProj4+=strExtraProj4;
4246
                        //getProj4ProjectionName();
4247
                }
4248
                
4249
                // Que pasa si no hay elipsoide? -> OGR por defecto pone WGS84
4250
                String strEllipseAcronym=ellipseToProj4(a,inv_f);
4251
                String strEllipse="";
4252
                if(strEllipseAcronym.equals(""))
4253
                {
4254
                        if (!Double.isInfinite(inv_f))
4255
                        {
4256
                                if(inv_f>0.0)
4257
                                        strEllipse="+a="+a+" +rf="+inv_f+" ";
4258
                                else
4259
                                        strEllipse="+R="+a+" ";
4260
                        }
4261
                        /*
4262
                        else
4263
                                strEllipse="+R="+a+" ";
4264
                        */
4265
                }
4266
                else
4267
                {
4268
                        strEllipse="+ellps="+strEllipseAcronym+" ";
4269
                }
4270
                strProj4+=strEllipse;
4271
                //System.out.println("Elipsoide["+elipName+"]=("+a+","+inv_f+")");
4272
                strProj4+=primeMeridianAcronym;
4273
                if(!strProj4Datum.equals(""))
4274
                        strProj4+=strProj4Datum;
4275
                if(!strProj4ToMeter.equals(""))
4276
                        strProj4+=strProj4ToMeter;
4277
                String strWkt=crs.toWKT();
4278
                
4279
                //System.out.println("- Cadena proj4: "+strProj4);
4280
                return strProj4;                
4281
        }
4282

    
4283
        private String[] primeMeridianToProj4(String pmName,double pmValue) throws CrsException
4284
        {
4285
            String[] primeMeridian=new String[3];
4286
                String pszPM="";
4287
                String acronym="";
4288
            double dfFromGreenwich = 0.0;
4289
            double tolerance=0.002/3600.0;
4290
            int    nPMCode = -1;
4291

    
4292
            dfFromGreenwich=-(9+7/60.0+54.862/3600.0);
4293
        if(pmName.equalsIgnoreCase("lisbon")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4294
        {
4295
            pszPM="lisbon";
4296
            nPMCode = 8902;
4297
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4298
            {
4299
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4300
                                System.out.println(strError);
4301
                                //throw new CrsException(new Exception(strError));
4302
            }
4303
            pmValue=dfFromGreenwich;
4304
            acronym="+pm="+pszPM+" ";
4305
        }
4306
        
4307
        dfFromGreenwich=(2+20/60.0+14.025/3600.0); 
4308
        if(pmName.equalsIgnoreCase("paris")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4309
        {
4310
            pszPM="paris";
4311
            nPMCode = 8903;
4312
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4313
            {
4314
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4315
                                System.out.println(strError);
4316
                                //throw new CrsException(new Exception(strError));
4317
            }
4318
            pmValue=dfFromGreenwich;
4319
            acronym="+pm="+pszPM+" ";
4320
        }
4321
        
4322
        dfFromGreenwich=-(74+4/60.0+51.3/3600.0);
4323
        if(pmName.equalsIgnoreCase("bogota")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4324
        {
4325
            pszPM="bogota";
4326
            nPMCode = 8904;
4327
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4328
            {
4329
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4330
                                System.out.println(strError);
4331
                                //throw new CrsException(new Exception(strError));
4332
            }
4333
            pmValue=dfFromGreenwich;
4334
            acronym="+pm="+pszPM+" ";
4335
        }
4336
        
4337
        dfFromGreenwich=-(3+41/60.0+16.58/3600.0);  // mal en ogr los segundos pone 16.48
4338
        if(pmName.equalsIgnoreCase("madrid")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4339
        {
4340
            pszPM="madrid";
4341
            nPMCode = 8905;
4342
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4343
            {
4344
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4345
                                System.out.println(strError);
4346
                                //throw new CrsException(new Exception(strError));
4347
            }
4348
            pmValue=dfFromGreenwich;
4349
            acronym="+pm="+pszPM+" ";
4350
        }
4351
        
4352
        dfFromGreenwich=(12+27/60.0+8.4/3600.0);
4353
        if(pmName.equalsIgnoreCase("rome")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4354
        {
4355
            pszPM="rome";
4356
            nPMCode = 8906;
4357
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4358
            {
4359
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4360
                                System.out.println(strError);
4361
                                //throw new CrsException(new Exception(strError));
4362
            }
4363
            pmValue=dfFromGreenwich;
4364
            acronym="+pm="+pszPM+" ";
4365
        }
4366
        
4367
        dfFromGreenwich=(7+26/60.0+22.5/3600.0);
4368
        if(pmName.equalsIgnoreCase("bern")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4369
        {
4370
            pszPM="bern";
4371
            nPMCode = 8907;
4372
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4373
            {
4374
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4375
                                System.out.println(strError);
4376
                                //throw new CrsException(new Exception(strError));
4377
            }
4378
            pmValue=dfFromGreenwich;
4379
            acronym="+pm="+pszPM+" ";
4380
        }
4381
        
4382
        dfFromGreenwich=(106+48/60.0+27.79/3600.0);
4383
        if(pmName.equalsIgnoreCase("jakarta")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4384
        {
4385
            pszPM="jakarta";
4386
            nPMCode = 8908;
4387
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4388
            {
4389
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4390
                                System.out.println(strError);
4391
                                //throw new CrsException(new Exception(strError));
4392
            }
4393
            pmValue=dfFromGreenwich;
4394
            acronym="+pm="+pszPM+" ";
4395
        }
4396
        
4397
        dfFromGreenwich=-(17+40/60.0+0.0/3600.0);
4398
        if(pmName.equalsIgnoreCase("ferro")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4399
        {
4400
            pszPM="ferro";
4401
            nPMCode = 8909;
4402
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4403
            {
4404
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4405
                                System.out.println(strError);
4406
                                //throw new CrsException(new Exception(strError));
4407
            }
4408
            pmValue=dfFromGreenwich;
4409
            acronym="+pm="+pszPM+" ";
4410
        }
4411
        
4412
        dfFromGreenwich=(4+22/60.0+4.71/3600.0);
4413
        if(pmName.equalsIgnoreCase("brussels")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4414
        {
4415
            pszPM="brussels";
4416
            nPMCode = 8910;
4417
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4418
            {
4419
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4420
                                System.out.println(strError);
4421
                                //throw new CrsException(new Exception(strError));
4422
            }
4423
            pmValue=dfFromGreenwich;
4424
            acronym="+pm="+pszPM+" ";
4425
        }
4426
        
4427
        dfFromGreenwich=(18+3/60.0+29.8/3600.0);
4428
        if(pmName.equalsIgnoreCase("stockholm")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4429
        {
4430
            pszPM="stockholm";
4431
            nPMCode = 8911;
4432
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4433
            {
4434
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4435
                                System.out.println(strError);
4436
                                //throw new CrsException(new Exception(strError));
4437
            }
4438
            pmValue=dfFromGreenwich;
4439
            acronym="+pm="+pszPM+" ";
4440
        }
4441
        
4442
        dfFromGreenwich=(23+42/60.0+58.815/3600.0);
4443
        if(pmName.equalsIgnoreCase("athens")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4444
        {
4445
            pszPM="athens";
4446
            nPMCode = 8912;
4447
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4448
            {
4449
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4450
                                System.out.println(strError);
4451
                                //throw new CrsException(new Exception(strError));
4452
            }
4453
            pmValue=dfFromGreenwich;
4454
            acronym="+pm="+pszPM+" ";
4455
        }
4456
        
4457
        dfFromGreenwich=(10+43/60.0+22.5/3600.0);
4458
        if(pmName.equalsIgnoreCase("oslo")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4459
        {
4460
            pszPM="oslo";
4461
            nPMCode = 8913;
4462
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4463
            {
4464
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4465
                                System.out.println(strError);
4466
                                //throw new CrsException(new Exception(strError));
4467
            }
4468
            pmValue=dfFromGreenwich;
4469
            acronym="+pm="+pszPM+" ";
4470
        }
4471
        
4472
        dfFromGreenwich=(0.0);
4473
        if(pmName.equalsIgnoreCase("Greenwich")||(Math.abs(dfFromGreenwich-pmValue)<tolerance))
4474
        {
4475
            pszPM="Greenwich";
4476
            nPMCode = 0;
4477
            if(Math.abs(dfFromGreenwich-pmValue)>tolerance)
4478
            {
4479
                                String strError="No concuerdan el nombre del meridiano origen y su valor";
4480
                                System.out.println(strError);
4481
                                //throw new CrsException(new Exception(strError));
4482
            }
4483
            pmValue=dfFromGreenwich;
4484
        }
4485
        primeMeridian[0]=pszPM;
4486
        primeMeridian[1]=Double.toString(pmValue);
4487
        primeMeridian[2]=acronym;
4488
                return primeMeridian;
4489
        }
4490

    
4491
        private String ellipseToProj4(double dfSemiMajor, double dfInvFlattening)
4492
        {
4493
                double yo=Math.abs(4.5);
4494
                String pszPROJ4Ellipse="";
4495
            if( Math.abs(dfSemiMajor-6378249.145) < 0.01
4496
                && Math.abs(dfInvFlattening-293.465) < 0.0001 )
4497
            {
4498
                pszPROJ4Ellipse = "clrk80";     /* Clark 1880 */
4499
            }
4500
            else if( Math.abs(dfSemiMajor-6378245.0) < 0.01
4501
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
4502
            {
4503
                pszPROJ4Ellipse = "krass";      /* Krassovsky */
4504
            }
4505
            else if( Math.abs(dfSemiMajor-6378388.0) < 0.01
4506
                     && Math.abs(dfInvFlattening-297.0) < 0.0001 )
4507
            {
4508
                pszPROJ4Ellipse = "intl";       /* International 1924 */
4509
            }
4510
            else if( Math.abs(dfSemiMajor-6378160.0) < 0.01
4511
                     && Math.abs(dfInvFlattening-298.25) < 0.0001 )
4512
            {
4513
                pszPROJ4Ellipse = "aust_SA";    /* Australian */
4514
            }
4515
            else if( Math.abs(dfSemiMajor-6377397.155) < 0.01
4516
                     && Math.abs(dfInvFlattening-299.1528128) < 0.0001 )
4517
            {
4518
                pszPROJ4Ellipse = "bessel";     /* Bessel 1841 */
4519
            }
4520
            else if( Math.abs(dfSemiMajor-6377483.865) < 0.01
4521
                     && Math.abs(dfInvFlattening-299.1528128) < 0.0001 )
4522
            {
4523
                pszPROJ4Ellipse = "bess_nam";   /* Bessel 1841 (Namibia / Schwarzeck)*/
4524
            }
4525
            else if( Math.abs(dfSemiMajor-6378160.0) < 0.01
4526
                     && Math.abs(dfInvFlattening-298.247167427) < 0.0001 )
4527
            {
4528
                pszPROJ4Ellipse = "GRS67";      /* GRS 1967 */
4529
            }
4530
            else if( Math.abs(dfSemiMajor-6378137) < 0.01
4531
                     && Math.abs(dfInvFlattening-298.257222101) < 0.000001 )
4532
            {
4533
                pszPROJ4Ellipse = "GRS80";      /* GRS 1980 */
4534
            }
4535
            else if( Math.abs(dfSemiMajor-6378206.4) < 0.01
4536
                     && Math.abs(dfInvFlattening-294.9786982) < 0.0001 )
4537
            {
4538
                pszPROJ4Ellipse = "clrk66";     /* Clarke 1866 */
4539
            }
4540
            else if( Math.abs(dfSemiMajor-6378206.4) < 0.01
4541
                     && Math.abs(dfInvFlattening-294.9786982) < 0.0001 )
4542
            {
4543
                pszPROJ4Ellipse = "mod_airy";   /* Modified Airy */
4544
            }
4545
            else if( Math.abs(dfSemiMajor-6377563.396) < 0.01
4546
                     && Math.abs(dfInvFlattening-299.3249646) < 0.0001 )
4547
            {
4548
                pszPROJ4Ellipse = "airy";       /* Modified Airy */
4549
            }
4550
            else if( Math.abs(dfSemiMajor-6378200) < 0.01
4551
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
4552
            {
4553
                pszPROJ4Ellipse = "helmert";    /* Helmert 1906 */
4554
            }
4555
            else if( Math.abs(dfSemiMajor-6378155) < 0.01
4556
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
4557
            {
4558
                pszPROJ4Ellipse = "fschr60m";   /* Modified Fischer 1960 */
4559
            }
4560
            else if( Math.abs(dfSemiMajor-6377298.556) < 0.01
4561
                     && Math.abs(dfInvFlattening-300.8017) < 0.0001 )
4562
            {
4563
                pszPROJ4Ellipse = "evrstSS";    /* Everest (Sabah & Sarawak) */
4564
            }
4565
            else if( Math.abs(dfSemiMajor-6378165.0) < 0.01
4566
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
4567
            {
4568
                pszPROJ4Ellipse = "WGS60";      
4569
            }
4570
            else if( Math.abs(dfSemiMajor-6378145.0) < 0.01
4571
                     && Math.abs(dfInvFlattening-298.25) < 0.0001 )
4572
            {
4573
                pszPROJ4Ellipse = "WGS66";      
4574
            }
4575
            else if( Math.abs(dfSemiMajor-6378135.0) < 0.01
4576
                     && Math.abs(dfInvFlattening-298.26) < 0.0001 )
4577
            {
4578
                pszPROJ4Ellipse = "WGS72";      
4579
            }
4580
            else if( Math.abs(dfSemiMajor-6378137.0) < 0.01
4581
                     && Math.abs(dfInvFlattening-298.257223563) < 0.000001 )
4582
            {
4583
                pszPROJ4Ellipse = "WGS84";
4584
            }
4585
            else if( Math.abs(dfSemiMajor-6378137.0) < 0.01
4586
                     && Double.isInfinite(dfInvFlattening) )
4587
            {
4588
                pszPROJ4Ellipse = "";                        /* Popular Visualisation Sphere */
4589
            }
4590
            /*
4591
            else if( EQUAL(pszDatum,"North_American_Datum_1927") )
4592
            {
4593
//                pszPROJ4Ellipse = "clrk66:+datum=nad27"; // NAD 27 
4594
                pszPROJ4Ellipse = "clrk66";
4595
            }
4596
            else if( EQUAL(pszDatum,"North_American_Datum_1983") )
4597
            {
4598
//                pszPROJ4Ellipse = "GRS80:+datum=nad83";       // NAD 83 
4599
                pszPROJ4Ellipse = "GRS80";
4600
            }
4601
            */
4602
            return pszPROJ4Ellipse;
4603
        }
4604

    
4605
        private String datumToProj4(String datumName,int epsgCode)
4606
        {
4607
            String datumProj4="";
4608
            String SRS_DN_NAD27="North_American_Datum_1927";
4609
            String SRS_DN_NAD83="North_American_Datum_1983";
4610
            String SRS_DN_WGS72="WGS_1972";
4611
            String SRS_DN_WGS84="WGS_1984";
4612
            if(datumName.equals(""))
4613
                    datumProj4="";
4614
                else if(datumName.equalsIgnoreCase(SRS_DN_NAD27) || epsgCode == 6267 )
4615
                        datumProj4 = "+datum=NAD27 ";
4616

    
4617
            else if(datumName.equalsIgnoreCase(SRS_DN_NAD83) || epsgCode == 6269 )
4618
                    datumProj4 = "+datum=NAD83 ";
4619

    
4620
            else if(datumName.equalsIgnoreCase(SRS_DN_WGS84) || epsgCode == 6326 )
4621
                    datumProj4 = "+datum=WGS84 ";
4622

    
4623
            else if( epsgCode == 6314 )
4624
                    datumProj4 = "+datum=potsdam ";
4625

    
4626
            else if( epsgCode == 6272 )
4627
                    datumProj4 = "+datum=nzgd49 ";
4628
                return datumProj4;
4629
        }
4630
        // Casos especiales
4631
        // - MERCATOR_1SP
4632
        // - HOTINE
4633
        // - MILLER
4634
        // - Polar_Stereographic
4635
        // - Polar_Stereographic
4636
        // - VanDerGrinten
4637
        // - Transverse Mercator
4638
        // - Cuando el meridiano origen no es 0 se pone pm=madrid y lon_0=
4639
        // +datum
4640
        
4641
        // Funciones privadas necesarias para el proceso
4642
        
4643
        private String getName(Identifier name) {
4644
                String[] correctName = name.toString().split(":");
4645
                if (correctName.length<2) 
4646
                        return correctName[0];
4647
                
4648
                else
4649
                        return correctName[1];
4650
        }
4651
        
4652
        private String[] Spheroid (Ellipsoid ellips) {
4653
                String[] spheroid = new String[3];
4654
                Unit u = ellips.getAxisUnit();
4655
                double semi_major = convert( ellips.getSemiMajorAxis(), u.toString());
4656
                //double inv_f = convert( ellips.getInverseFlattening(), u.toString());
4657
                double inv_f = ellips.getInverseFlattening();
4658
                String[] val =        ellips.getName().toString().split(":");
4659
                if (val.length<2)
4660
                        spheroid[0] = ellips.getName().toString().split(":")[0];
4661
                else
4662
                        spheroid[0] = ellips.getName().toString().split(":")[1];
4663
                spheroid[1] = String.valueOf(semi_major);
4664
                spheroid[2] = String.valueOf(inv_f);
4665
                return spheroid;
4666
        }
4667
        
4668
        private String[] Primem (PrimeMeridian prim) {
4669
                String[] primem = new String[2];
4670
                DefaultPrimeMeridian pm = (DefaultPrimeMeridian) prim;
4671
                Unit u = pm.getAngularUnit();
4672
                double value = convert( pm.getGreenwichLongitude(), u.toString());
4673
                String[] val = pm.getName().toString().split(":");
4674
                if (val.length<2)
4675
                        primem[0] = pm.getName().toString().split(":")[0];
4676
                else
4677
                        primem[0] = pm.getName().toString().split(":")[1];
4678
                primem[1] = String.valueOf(value);
4679
                return primem;
4680
        }
4681
        
4682
        public double convert(double value, String measure) throws ConversionException {
4683
                if (measure.equals("D.MS")) {                
4684
                        value *= this.divider;
4685
                int deg,min;
4686
                deg = (int) (value/10000); value -= 10000*deg;
4687
                min = (int) (value/  100); value -=   100*min;
4688
                if (min<=-60 || min>=60) {  // Accepts NaN
4689
                    if (Math.abs(Math.abs(min) - 100) <= EPS) {
4690
                        if (min >= 0) deg++; else deg--;
4691
                        min = 0;
4692
                    } else {
4693
                        throw new ConversionException("Invalid minutes: "+min);
4694
                    }
4695
                }
4696
                if (value<=-60 || value>=60) { // Accepts NaN
4697
                    if (Math.abs(Math.abs(value) - 100) <= EPS) {
4698
                        if (value >= 0) min++; else min--;
4699
                        value = 0;
4700
                    } else {
4701
                        throw new ConversionException("Invalid secondes: "+value);
4702
                    }
4703
                }
4704
                value = ((value/60) + min)/60 + deg;
4705
                return value;
4706
                }
4707
                if (measure.equals("grad") || measure.equals("grade")) 
4708
                        return ((value * 180.0) / 200.0);                        
4709
                if (measure.equals(""+(char)176)) 
4710
                        return value;                
4711
                if (measure.equals("DMS") ) 
4712
                        return value;                
4713
                if (measure.equals("m") || measure.startsWith("[m")) 
4714
                        return value;        
4715
                if (measure.equals("")) 
4716
                        return value;
4717
                if (measure.equalsIgnoreCase("ft")||measure.equalsIgnoreCase("foot")||measure.equalsIgnoreCase("feet")) 
4718
                        return (value*0.3048/1.0);
4719
                
4720
                throw new ConversionException("Conversion no contemplada: "+measure);
4721
    }
4722
        
4723
        public ArrayList getProjectionNameList(){
4724
                return projectionNameList;
4725
        }
4726
}