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 @ 300

History | View | Annotate | Download (177 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;
50
import org.geotools.referencing.crs.DefaultGeographicCRS;
51
import org.geotools.referencing.crs.DefaultProjectedCRS;
52
import org.geotools.referencing.datum.DefaultGeodeticDatum;
53
import org.geotools.referencing.datum.DefaultPrimeMeridian;
54
import org.opengis.metadata.Identifier;
55
import org.opengis.referencing.NoSuchAuthorityCodeException;
56
import org.opengis.referencing.crs.CoordinateReferenceSystem;
57
import org.opengis.referencing.datum.Ellipsoid;
58
import org.opengis.referencing.datum.PrimeMeridian;
59
import org.slf4j.Logger;
60
import org.slf4j.LoggerFactory;
61

    
62

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

    
71
public class Proj4 {        
72
        public static final Logger logger = LoggerFactory.getLogger(Proj4.class);
73

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

    
136
                { // azimuth
137
                        String[] parameterName={"azimuth"};
138
                        projectionParameterNameList.add(count,parameterName);
139
                        addProjectionParameterName(count,"Azimuth of initial line");                
140
                        addProjectionParameterName(count,"AzimuthAngle");                
141

    
142
                        String[] parameterUnit={"Angular"};
143
                        projectionParameterUnitList.add(count,parameterUnit);
144
                }
145

    
146
                count++;
147
                { // central_meridian
148
                        String[] parameterName={"central_meridian"};
149
                        projectionParameterNameList.add(count,parameterName);
150
                        addProjectionParameterName(count,"Longitude of natural origin");                
151
                        addProjectionParameterName(count,"NatOriginLong");                
152
                        addProjectionParameterName(count,"Longitude of projection center");
153
                        addProjectionParameterName(count,"Longitude_of_center");
154
                        addProjectionParameterName(count,"ProjCenterLong");
155
                        addProjectionParameterName(count,"Longitude of false origin");                
156
                        addProjectionParameterName(count,"FalseOriginLong");                
157
                        addProjectionParameterName(count,"StraightVertPoleLong");                
158
                        
159
                        String[] parameterUnit={"Angular"};
160
                        projectionParameterUnitList.add(count,parameterUnit);
161
                }
162
                
163
                count++;
164
                { // false_easting
165
                        String[] parameterName={"false_easting"};
166
                        projectionParameterNameList.add(count,parameterName);
167
                        addProjectionParameterName(count,"Easting at projection centre");                
168
                        addProjectionParameterName(count,"Easting of false origin");                
169
                        addProjectionParameterName(count,"FalseEasting");                
170
                        addProjectionParameterName(count,"False_Easting");                
171
                        addProjectionParameterName(count,"FalseOriginEasting");                
172

    
173
                        String[] parameterUnit={"Linear"};
174
                        projectionParameterUnitList.add(count,parameterUnit);
175
                }
176
                
177
                count++;
178
                { // false_northing
179
                        String[] parameterName={"false_northing"};
180
                        projectionParameterNameList.add(count,parameterName);
181
                        addProjectionParameterName(count,"Northing at projection centre");                
182
                        addProjectionParameterName(count,"Northing of false origin");                
183
                        addProjectionParameterName(count,"FalseNorthing");                
184
                        addProjectionParameterName(count,"False_Northing");                
185
                        addProjectionParameterName(count,"FalseOriginNorthing");                
186

    
187
                        String[] parameterUnit={"Linear"};
188
                        projectionParameterUnitList.add(count,parameterUnit);
189
                }
190

    
191
                count++;
192
                { // latitude_of_center
193
                        String[] parameterName={"latitude_of_center"};
194
                        projectionParameterNameList.add(count,parameterName);
195
                        addProjectionParameterName(count,"CenterLat");                
196
                        addProjectionParameterName(count,"FalseOriginLat");
197
                        addProjectionParameterName(count,"Latitude of false origin");                
198
                        addProjectionParameterName(count,"Latitude_of_origin");                
199
                        addProjectionParameterName(count,"Latitude of natural origin");
200
                        addProjectionParameterName(count,"Latitude of projection center");
201
                        addProjectionParameterName(count,"Latitude of projection centre");
202
                        addProjectionParameterName(count,"NatOriginLat");                
203
                        addProjectionParameterName(count,"ProjCenterLat");
204
                        addProjectionParameterName(count,"Spherical_latitude_of_origin");
205
                        addProjectionParameterName(count,"Central_Parallel");
206

    
207
                        String[] parameterUnit={"Angular"};
208
                        projectionParameterUnitList.add(count,parameterUnit);
209
                }
210

    
211
                count++;
212
                { // Latitude_Of_1st_Point
213
                        String[] parameterName={"Latitude_Of_1st_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_2nd_Point
223
                        String[] parameterName={"Latitude_Of_2nd_Point"};
224
                        projectionParameterNameList.add(count,parameterName);
225
                        //addProjectionParameterName(count,"CenterLat");                
226
                        
227
                        String[] parameterUnit={"Angular"};
228
                        projectionParameterUnitList.add(count,parameterUnit);
229
                }
230

    
231
                count++;
232
                { // latitude_of_origin
233
                        String[] parameterName={"latitude_of_origin"};
234
                        projectionParameterNameList.add(count,parameterName);
235
                        addProjectionParameterName(count,"CenterLat");                
236
                        addProjectionParameterName(count,"FalseOriginLat");
237
                        addProjectionParameterName(count,"Latitude of center");                
238
                        addProjectionParameterName(count,"Latitude of false origin");                
239
                        addProjectionParameterName(count,"Latitude of natural origin");
240
                        addProjectionParameterName(count,"Latitude of projection center");
241
                        addProjectionParameterName(count,"Latitude of projection centre");
242
                        addProjectionParameterName(count,"NatOriginLat");                
243
                        addProjectionParameterName(count,"ProjCenterLat");
244
                        
245
                        String[] parameterUnit={"Angular"};
246
                        projectionParameterUnitList.add(count,parameterUnit);
247
                }
248

    
249
                count++;
250
                { // latitude_of_origin
251
                        String[] parameterName={"latitude_of_standard_parallel"};
252
                        projectionParameterNameList.add(count,parameterName);
253
                        addProjectionParameterName(count,"CenterLat");                
254
                        addProjectionParameterName(count,"FalseOriginLat");
255
                        addProjectionParameterName(count,"Latitude of center");                
256
                        addProjectionParameterName(count,"Latitude of false origin");                
257
                        addProjectionParameterName(count,"Latitude of natural origin");
258
                        addProjectionParameterName(count,"Latitude of projection center");
259
                        addProjectionParameterName(count,"Latitude of projection centre");
260
                        addProjectionParameterName(count,"Latitude_of_standard_parallel");                
261
                        addProjectionParameterName(count,"NatOriginLat");                
262
                        addProjectionParameterName(count,"ProjCenterLat");
263
                        
264
                        String[] parameterUnit={"Angular"};
265
                        projectionParameterUnitList.add(count,parameterUnit);
266
                }
267

    
268
                count++;
269
                { // longitude_of_center
270
                        String[] parameterName={"longitude_of_center"};
271
                        projectionParameterNameList.add(count,parameterName);
272
                        addProjectionParameterName(count,"Longitude of origin");                
273
                        addProjectionParameterName(count,"Longitude of false origin");                
274
                        addProjectionParameterName(count,"NatOriginLong");                
275
                        addProjectionParameterName(count,"central_meridian");                
276
                        addProjectionParameterName(count,"CenterLong");                
277
                        addProjectionParameterName(count,"Spherical_latitude_of_origin");
278

    
279
                        String[] parameterUnit={"Angular"};
280
                        projectionParameterUnitList.add(count,parameterUnit);
281
                }
282

    
283
                count++;
284
                { // Longitude_Of_1st_Point
285
                        String[] parameterName={"Longitude_Of_1st_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
                { // Longitude_Of_2nd_Point
295
                        String[] parameterName={"Longitude_Of_2nd_Point"};
296
                        projectionParameterNameList.add(count,parameterName);
297
                        //addProjectionParameterName(count,"CenterLat");                
298
                        
299
                        String[] parameterUnit={"Angular"};
300
                        projectionParameterUnitList.add(count,parameterUnit);
301
                }
302

    
303
                count++;
304
                { // pseudo_standard_parallel_1
305
                        String[] parameterName={"pseudo_standard_parallel_1"};
306
                        projectionParameterNameList.add(count,parameterName);
307
                        addProjectionParameterName(count,"Latitude of Pseudo Standard Parallel");                
308

    
309
                        String[] parameterUnit={"Angular"};
310
                        projectionParameterUnitList.add(count,parameterUnit);
311
                }
312
                
313
                count++;
314
                { // satellite_height
315
                        String[] parameterName={"rectified_grid_angle"};
316
                        projectionParameterNameList.add(count,parameterName);
317
                        addProjectionParameterName(count,"Angle from Rectified to Skew Grid");                
318
                        addProjectionParameterName(count,"XY_Plane_Rotation");                
319
                        addProjectionParameterName(count,"RectifiedGridAngle");                
320

    
321
                        String[] parameterUnit={"Linear"};
322
                        projectionParameterUnitList.add(count,parameterUnit);
323
                }
324
                
325
                count++;
326
                { // satellite_height
327
                        String[] parameterName={"satellite_height"};
328
                        projectionParameterNameList.add(count,parameterName);
329
                        addProjectionParameterName(count,"Satellite Height");                
330

    
331
                        String[] parameterUnit={"Linear"};
332
                        projectionParameterUnitList.add(count,parameterUnit);
333
                }
334
                
335
                count++;
336
                { // scale_factor
337
                        String[] parameterName={"scale_factor"};
338
                        projectionParameterNameList.add(count,parameterName);
339
                        addProjectionParameterName(count,"Scale factor at natural origin");                
340
                        addProjectionParameterName(count,"ScaleAtNatOrigin");                
341
                        addProjectionParameterName(count,"ScaleAtCenter");                
342

    
343
                        String[] parameterUnit={"Unitless"};
344
                        projectionParameterUnitList.add(count,parameterUnit);
345
                }
346

    
347
                count++;
348
                { // standard_parallel_1
349
                        String[] parameterName={"standard_parallel_1"};
350
                        projectionParameterNameList.add(count,parameterName);
351
                        addProjectionParameterName(count,"Latitude of first standard parallel");                
352
                        addProjectionParameterName(count,"Latitude of origin");                
353
                        addProjectionParameterName(count,"StdParallel1");                
354

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

    
359
                count++;
360
                { // standard_parallel_2
361
                        String[] parameterName={"standard_parallel_2"};
362
                        projectionParameterNameList.add(count,parameterName);
363
                        addProjectionParameterName(count,"Latitude of second standard parallel");                
364
                        addProjectionParameterName(count,"StdParallel2");                
365

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

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

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

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

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

    
390
                count++;
391
                { // height
392
                        String[] parameterName={"Height"};
393
                        projectionParameterNameList.add(count,parameterName);
394
                        addProjectionParameterName(count,"altitude");                
395

    
396
                        String[] parameterUnit={"Linear"};
397
                        projectionParameterUnitList.add(count,parameterUnit);
398
                }
399

    
400
        }
401
        
402
        private void defineProjections() throws CrsException
403
        {
404
                int count=0;
405
                
406
                {// Aitoff
407
                        String[] projectionName={"Aitoff"};
408
                        projectionNameList.add(count,projectionName);
409

    
410
                        String[] parameterName={"central_meridian"};
411
                        projectionParameterList.add(count,parameterName);
412
                        addProjectionParameter(count,"false_easting");
413
                        addProjectionParameter(count,"false_northing");
414

    
415
                        String[] parameterAcronym={"lon_0"};
416
                        projectionParameterAcronymList.add(count,parameterAcronym);
417
                        addProjectionParameterAcronymList(count,"x_0");
418
                        addProjectionParameterAcronymList(count,"y_0");
419

    
420
                        String[] parameterDefaultValue={"0.0"};
421
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
422
                        addProjectionParameterDefaultValue(count,"0.0");
423
                        addProjectionParameterDefaultValue(count,"0.0");
424

    
425
                        String[] parameterMaxValue={"360.0"};
426
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
427
                        addProjectionParameterMaxValue(count,"100000000.0");
428
                        addProjectionParameterMaxValue(count,"100000000.0");
429

    
430
                        String[] parameterMinValue={"-360.0"};
431
                        projectionParameterMinValueList.add(count,parameterMinValue);
432
                        addProjectionParameterMinValue(count,"-100000000.0");
433
                        addProjectionParameterMinValue(count,"-100000000.0");
434

    
435
                        String[] projectionAcronym={"aitoff"};
436
                        projectionAcronymList.add(count,projectionAcronym);
437
                }
438
                
439
                count++;
440
                {// Albers Equal-Area Conic
441
                        String[] projectionName={"Albers_Conic_Equal_Area"};
442
                        projectionNameList.add(count,projectionName);
443
                        addProjectionName(count,"Albers Equal-Area Conic");
444
                        addProjectionName(count,"Albers Equal Area");
445
                        addProjectionName(count,"9822");
446
                        
447
                        String[] parameterName={"standard_parallel_1"};
448
                        projectionParameterList.add(count,parameterName);
449
                        addProjectionParameter(count,"standard_parallel_2");
450
                        addProjectionParameter(count,"latitude_of_center");
451
                        addProjectionParameter(count,"longitude_of_center");
452
                        addProjectionParameter(count,"false_easting");
453
                        addProjectionParameter(count,"false_northing");
454

    
455
                        String[] parameterAcronym={"lat_1"};
456
                        projectionParameterAcronymList.add(count,parameterAcronym);
457
                        addProjectionParameterAcronymList(count,"lat_2");
458
                        addProjectionParameterAcronymList(count,"lat_0");
459
                        addProjectionParameterAcronymList(count,"lon_0");
460
                        addProjectionParameterAcronymList(count,"x_0");
461
                        addProjectionParameterAcronymList(count,"y_0");
462

    
463
                        String[] parameterDefaultValue={"0.0"};
464
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
465
                        addProjectionParameterDefaultValue(count,"0.0");
466
                        addProjectionParameterDefaultValue(count,"0.0");
467
                        addProjectionParameterDefaultValue(count,"0.0");
468
                        addProjectionParameterDefaultValue(count,"0.0");
469
                        addProjectionParameterDefaultValue(count,"0.0");
470

    
471
                        String[] parameterMaxValue={"90.0"};
472
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
473
                        addProjectionParameterMaxValue(count,"90.0");
474
                        addProjectionParameterMaxValue(count,"90.0");
475
                        addProjectionParameterMaxValue(count,"360.0");
476
                        addProjectionParameterMaxValue(count,"100000000.0");
477
                        addProjectionParameterMaxValue(count,"100000000.0");
478

    
479
                        String[] parameterMinValue={"-90.0"};
480
                        projectionParameterMinValueList.add(count,parameterMinValue);
481
                        addProjectionParameterMinValue(count,"-90.0");
482
                        addProjectionParameterMinValue(count,"-90.0");
483
                        addProjectionParameterMinValue(count,"-360.0");
484
                        addProjectionParameterMinValue(count,"-100000000.0");
485
                        addProjectionParameterMinValue(count,"-100000000.0");
486

    
487
                        String[] projectionAcronym={"aea"};
488
                        projectionAcronymList.add(count,projectionAcronym);
489
                }
490
                
491
                count++;
492
                {// Azimuthal_Equidistantt
493
                        String[] projectionName={"Azimuthal_Equidistant"};
494
                        projectionNameList.add(count,projectionName);
495
                        addProjectionName(count,"Azimuthal Equidistant");
496
                        addProjectionName(count,"Azimuthal-Equidistant");
497
                        addProjectionName(count,"Postel");
498
                        addProjectionName(count,"Zenithal Equidistant");
499
                        addProjectionName(count,"Zenithal-Equidistant");
500
                        addProjectionName(count,"Zenithal_Equidistant");
501
                        
502
                        String[] parameterName={"latitude_of_center"};
503
                        projectionParameterList.add(count,parameterName);
504
                        addProjectionParameter(count,"longitude_of_center");
505
                        addProjectionParameter(count,"false_easting");
506
                        addProjectionParameter(count,"false_northing");
507

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

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

    
520
                        String[] parameterMaxValue={"90.0"};
521
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
522
                        addProjectionParameterMaxValue(count,"360.0");
523
                        addProjectionParameterMaxValue(count,"100000000.0");
524
                        addProjectionParameterMaxValue(count,"100000000.0");
525

    
526
                        String[] parameterMinValue={"-90.0"};
527
                        projectionParameterMinValueList.add(count,parameterMinValue);
528
                        addProjectionParameterMinValue(count,"-360.0");
529
                        addProjectionParameterMinValue(count,"-100000000.0");
530
                        addProjectionParameterMinValue(count,"-100000000.0");
531

    
532
                        String[] projectionAcronym={"aeqd"};
533
                        projectionAcronymList.add(count,projectionAcronym);
534
                }
535

    
536
                count++;
537
                {// Bonne
538
                        String[] projectionName={"Bonne"};
539
                        projectionNameList.add(count,projectionName);
540
                        addProjectionName(count,"Bonne");
541

    
542
                        String[] parameterName={"central_meridian"};
543
                        projectionParameterList.add(count,parameterName);
544
                        addProjectionParameter(count,"standard_parallel_1");
545
                        addProjectionParameter(count,"false_easting");
546
                        addProjectionParameter(count,"false_northing");
547

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

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

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

    
566
                        String[] parameterMinValue={"-360.0"};
567
                        projectionParameterMinValueList.add(count,parameterMinValue);
568
                        addProjectionParameterMinValue(count,"-90.0");
569
                        addProjectionParameterMinValue(count,"-100000000.0");
570
                        addProjectionParameterMinValue(count,"-100000000.0");
571

    
572
                        String[] projectionAcronym={"bonne"};
573
                        projectionAcronymList.add(count,projectionAcronym);
574
                }
575

    
576
                count++;
577
                {// Cassini_Soldner
578
                        String[] projectionName={"Cassini_Soldner"};
579
                        projectionNameList.add(count,projectionName);
580
                        addProjectionName(count,"Cassini-Soldner");
581
                        addProjectionName(count,"Cassini");
582
                        addProjectionName(count,"9806");
583

    
584
                        String[] parameterName={"latitude_of_origin"};
585
                        projectionParameterList.add(count,parameterName);
586
                        addProjectionParameter(count,"central_meridian");
587
                        addProjectionParameter(count,"false_easting");
588
                        addProjectionParameter(count,"false_northing");
589

    
590
                        String[] parameterAcronym={"lat_0"};
591
                        projectionParameterAcronymList.add(count,parameterAcronym);
592
                        addProjectionParameterAcronymList(count,"lon_0");
593
                        addProjectionParameterAcronymList(count,"x_0");
594
                        addProjectionParameterAcronymList(count,"y_0");
595

    
596
                        String[] parameterDefaultValue={"0.0"};
597
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
598
                        addProjectionParameterDefaultValue(count,"0.0");
599
                        addProjectionParameterDefaultValue(count,"0.0");
600
                        addProjectionParameterDefaultValue(count,"0.0");
601

    
602
                        String[] parameterMaxValue={"90.0"};
603
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
604
                        addProjectionParameterMaxValue(count,"360.0");
605
                        addProjectionParameterMaxValue(count,"100000000.0");
606
                        addProjectionParameterMaxValue(count,"100000000.0");
607

    
608
                        String[] parameterMinValue={"-90.0"};
609
                        projectionParameterMinValueList.add(count,parameterMinValue);
610
                        addProjectionParameterMinValue(count,"-360.0");
611
                        addProjectionParameterMinValue(count,"-100000000.0");
612
                        addProjectionParameterMinValue(count,"-100000000.0");
613

    
614
                        String[] projectionAcronym={"cass"};
615
                        projectionAcronymList.add(count,projectionAcronym);
616
                }
617
                
618
                count++;
619
                {// Craster Parabolic
620
                        String[] projectionName={"Craster_Parabolic"};
621
                        projectionNameList.add(count,projectionName);
622
                        addProjectionName(count,"Craster-Parabolic");
623
                        addProjectionName(count,"Craster Parabolic");
624

    
625
                        String[] parameterName={"central_meridian"};
626
                        projectionParameterList.add(count,parameterName);
627
                        addProjectionParameter(count,"false_easting");
628
                        addProjectionParameter(count,"false_northing");
629

    
630
                        String[] parameterAcronym={"lon_0"};
631
                        projectionParameterAcronymList.add(count,parameterAcronym);
632
                        addProjectionParameterAcronymList(count,"x_0");
633
                        addProjectionParameterAcronymList(count,"y_0");
634

    
635
                        String[] parameterDefaultValue={"0.0"};
636
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
637
                        addProjectionParameterDefaultValue(count,"0.0");
638
                        addProjectionParameterDefaultValue(count,"0.0");
639

    
640
                        String[] parameterMaxValue={"360.0"};
641
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
642
                        addProjectionParameterMaxValue(count,"100000000.0");
643
                        addProjectionParameterMaxValue(count,"100000000.0");
644

    
645
                        String[] parameterMinValue={"-360.0"};
646
                        projectionParameterMinValueList.add(count,parameterMinValue);
647
                        addProjectionParameterMinValue(count,"-100000000.0");
648
                        addProjectionParameterMinValue(count,"-100000000.0");
649

    
650
                        String[] projectionAcronym={"craster"};
651
                        projectionAcronymList.add(count,projectionAcronym);
652
                }
653

    
654
                count++;
655
                {// Cylindrical_Equal_Area
656
                        String[] projectionName={"Cylindrical_Equal_Area"};
657
                        projectionNameList.add(count,projectionName);
658
                        addProjectionName(count,"Cylindrical Equal Area");
659
                        addProjectionName(count,"Normal Authalic Cylindrical (FME)");
660
                        addProjectionName(count,"Lambert Cylindrical Equal Area");
661
                        addProjectionName(count,"Lambert_Cylindrical_Equal_Area");
662
                        addProjectionName(count,"Behrmann (standard parallel = 30)");
663
                        addProjectionName(count,"Behrmann");
664
                        addProjectionName(count,"Gall Orthographic (standard parallel = 45)");
665
                        addProjectionName(count,"Gall Orthographic");
666
                        addProjectionName(count,"Gall_Orthographic");
667
                        addProjectionName(count,"Peters (approximated by Gall Orthographic)");
668
                        addProjectionName(count,"Peters");
669
                        addProjectionName(count,"Lambert Cylindrical Equal Area (Spherical)");
670

    
671
                        String[] parameterName={"central_meridian"};
672
                        projectionParameterList.add(count,parameterName);
673
                        addProjectionParameter(count,"standard_parallel_1");
674
                        addProjectionParameter(count,"false_easting");
675
                        addProjectionParameter(count,"false_northing");
676

    
677
                        String[] parameterAcronym={"lon_0"};
678
                        projectionParameterAcronymList.add(count,parameterAcronym);
679
                        addProjectionParameterAcronymList(count,"lat_ts");
680
                        addProjectionParameterAcronymList(count,"x_0");
681
                        addProjectionParameterAcronymList(count,"y_0");
682

    
683
                        String[] parameterDefaultValue={"0.0"};
684
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
685
                        addProjectionParameterDefaultValue(count,"0.0");
686
                        addProjectionParameterDefaultValue(count,"0.0");
687
                        addProjectionParameterDefaultValue(count,"0.0");
688

    
689
                        String[] parameterMaxValue={"360.0"};
690
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
691
                        addProjectionParameterMaxValue(count,"90.0");
692
                        addProjectionParameterMaxValue(count,"100000000.0");
693
                        addProjectionParameterMaxValue(count,"100000000.0");
694

    
695
                        String[] parameterMinValue={"-360.0"};
696
                        projectionParameterMinValueList.add(count,parameterMinValue);
697
                        addProjectionParameterMinValue(count,"-90.0");
698
                        addProjectionParameterMinValue(count,"-100000000.0");
699
                        addProjectionParameterMinValue(count,"-100000000.0");
700

    
701
                        String[] projectionAcronym={"cea"};
702
                        projectionAcronymList.add(count,projectionAcronym);
703
                }
704

    
705
                count++;
706
                {// Eckert_I
707
                        String[] projectionName={"Eckert_I"};
708
                        projectionNameList.add(count,projectionName);
709
                        addProjectionName(count,"Eckert I");
710

    
711
                        String[] parameterName={"central_meridian"};
712
                        projectionParameterList.add(count,parameterName);
713
                        addProjectionParameter(count,"false_easting");
714
                        addProjectionParameter(count,"false_northing");
715

    
716
                        String[] parameterAcronym={"lon_0"};
717
                        projectionParameterAcronymList.add(count,parameterAcronym);
718
                        addProjectionParameterAcronymList(count,"x_0");
719
                        addProjectionParameterAcronymList(count,"y_0");
720

    
721
                        String[] parameterDefaultValue={"0.0"};
722
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
723
                        addProjectionParameterDefaultValue(count,"0.0");
724
                        addProjectionParameterDefaultValue(count,"0.0");
725

    
726
                        String[] parameterMaxValue={"360.0"};
727
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
728
                        addProjectionParameterMaxValue(count,"100000000.0");
729
                        addProjectionParameterMaxValue(count,"100000000.0");
730

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

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

    
740
                count++;
741
                {// Eckert_II
742
                        String[] projectionName={"Eckert_II"};
743
                        projectionNameList.add(count,projectionName);
744
                        addProjectionName(count,"Eckert II");
745

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

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

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

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

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

    
771
                        String[] projectionAcronym={"eck2"};
772
                        projectionAcronymList.add(count,projectionAcronym);
773
                }
774

    
775
                count++;
776
                {// Eckert_III
777
                        String[] projectionName={"Eckert_III"};
778
                        projectionNameList.add(count,projectionName);
779
                        addProjectionName(count,"Eckert III");
780

    
781
                        String[] parameterName={"central_meridian"};
782
                        projectionParameterList.add(count,parameterName);
783
                        addProjectionParameter(count,"false_easting");
784
                        addProjectionParameter(count,"false_northing");
785

    
786
                        String[] parameterAcronym={"lon_0"};
787
                        projectionParameterAcronymList.add(count,parameterAcronym);
788
                        addProjectionParameterAcronymList(count,"x_0");
789
                        addProjectionParameterAcronymList(count,"y_0");
790

    
791
                        String[] parameterDefaultValue={"0.0"};
792
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
793
                        addProjectionParameterDefaultValue(count,"0.0");
794
                        addProjectionParameterDefaultValue(count,"0.0");
795

    
796
                        String[] parameterMaxValue={"360.0"};
797
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
798
                        addProjectionParameterMaxValue(count,"100000000.0");
799
                        addProjectionParameterMaxValue(count,"100000000.0");
800

    
801
                        String[] parameterMinValue={"-360.0"};
802
                        projectionParameterMinValueList.add(count,parameterMinValue);
803
                        addProjectionParameterMinValue(count,"-100000000.0");
804
                        addProjectionParameterMinValue(count,"-100000000.0");
805

    
806
                        String[] projectionAcronym={"eck3"};
807
                        projectionAcronymList.add(count,projectionAcronym);
808
                }
809

    
810
                count++;
811
                {// Eckert_IV
812
                        String[] projectionName={"Eckert_IV"};
813
                        projectionNameList.add(count,projectionName);
814
                        addProjectionName(count,"Eckert IV");
815

    
816
                        String[] parameterName={"central_meridian"};
817
                        projectionParameterList.add(count,parameterName);
818
                        addProjectionParameter(count,"false_easting");
819
                        addProjectionParameter(count,"false_northing");
820

    
821
                        String[] parameterAcronym={"lon_0"};
822
                        projectionParameterAcronymList.add(count,parameterAcronym);
823
                        addProjectionParameterAcronymList(count,"x_0");
824
                        addProjectionParameterAcronymList(count,"y_0");
825

    
826
                        String[] parameterDefaultValue={"0.0"};
827
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
828
                        addProjectionParameterDefaultValue(count,"0.0");
829
                        addProjectionParameterDefaultValue(count,"0.0");
830

    
831
                        String[] parameterMaxValue={"360.0"};
832
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
833
                        addProjectionParameterMaxValue(count,"100000000.0");
834
                        addProjectionParameterMaxValue(count,"100000000.0");
835

    
836
                        String[] parameterMinValue={"-360.0"};
837
                        projectionParameterMinValueList.add(count,parameterMinValue);
838
                        addProjectionParameterMinValue(count,"-100000000.0");
839
                        addProjectionParameterMinValue(count,"-100000000.0");
840

    
841
                        String[] projectionAcronym={"eck4"};
842
                        projectionAcronymList.add(count,projectionAcronym);
843
                }
844

    
845
                count++;
846
                {// Eckert_V
847
                        String[] projectionName={"Eckert_V"};
848
                        projectionNameList.add(count,projectionName);
849
                        addProjectionName(count,"Eckert V");
850

    
851
                        String[] parameterName={"central_meridian"};
852
                        projectionParameterList.add(count,parameterName);
853
                        addProjectionParameter(count,"false_easting");
854
                        addProjectionParameter(count,"false_northing");
855

    
856
                        String[] parameterAcronym={"lon_0"};
857
                        projectionParameterAcronymList.add(count,parameterAcronym);
858
                        addProjectionParameterAcronymList(count,"x_0");
859
                        addProjectionParameterAcronymList(count,"y_0");
860

    
861
                        String[] parameterDefaultValue={"0.0"};
862
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
863
                        addProjectionParameterDefaultValue(count,"0.0");
864
                        addProjectionParameterDefaultValue(count,"0.0");
865

    
866
                        String[] parameterMaxValue={"360.0"};
867
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
868
                        addProjectionParameterMaxValue(count,"100000000.0");
869
                        addProjectionParameterMaxValue(count,"100000000.0");
870

    
871
                        String[] parameterMinValue={"-360.0"};
872
                        projectionParameterMinValueList.add(count,parameterMinValue);
873
                        addProjectionParameterMinValue(count,"-100000000.0");
874
                        addProjectionParameterMinValue(count,"-100000000.0");
875

    
876
                        String[] projectionAcronym={"eck5"};
877
                        projectionAcronymList.add(count,projectionAcronym);
878
                }
879

    
880
                count++;
881
                {// Eckert_VI
882
                        String[] projectionName={"Eckert_VI"};
883
                        projectionNameList.add(count,projectionName);
884
                        addProjectionName(count,"Eckert VI");
885

    
886
                        String[] parameterName={"central_meridian"};
887
                        projectionParameterList.add(count,parameterName);
888
                        addProjectionParameter(count,"false_easting");
889
                        addProjectionParameter(count,"false_northing");
890

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

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

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

    
906
                        String[] parameterMinValue={"-360.0"};
907
                        projectionParameterMinValueList.add(count,parameterMinValue);
908
                        addProjectionParameterMinValue(count,"-100000000.0");
909
                        addProjectionParameterMinValue(count,"-100000000.0");
910

    
911
                        String[] projectionAcronym={"eck6"};
912
                        projectionAcronymList.add(count,projectionAcronym);
913
                }
914
                
915
                count++;
916
                {// Equidistant_Conic
917
                        String[] projectionName={"Equidistant_Conic"};
918
                        projectionNameList.add(count,projectionName);
919
                        addProjectionName(count,"Equidistant Conic");
920
                        
921
                        String[] parameterName={"latitude_of_center"};
922
                        projectionParameterList.add(count,parameterName);
923
                        addProjectionParameter(count,"longitude_of_center");
924
                        addProjectionParameter(count,"standard_parallel_1");
925
                        addProjectionParameter(count,"standard_parallel_2");
926
                        addProjectionParameter(count,"false_easting");
927
                        addProjectionParameter(count,"false_northing");
928

    
929
                        String[] parameterAcronym={"lat_0"};
930
                        projectionParameterAcronymList.add(count,parameterAcronym);
931
                        addProjectionParameterAcronymList(count,"lon_0");
932
                        addProjectionParameterAcronymList(count,"lat_1");
933
                        addProjectionParameterAcronymList(count,"lat_2");
934
                        addProjectionParameterAcronymList(count,"x_0");
935
                        addProjectionParameterAcronymList(count,"y_0");
936

    
937
                        String[] parameterDefaultValue={"0.0"};
938
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
939
                        addProjectionParameterDefaultValue(count,"0.0");
940
                        addProjectionParameterDefaultValue(count,"0.0");
941
                        addProjectionParameterDefaultValue(count,"0.0");
942
                        addProjectionParameterDefaultValue(count,"0.0");
943
                        addProjectionParameterDefaultValue(count,"0.0");
944

    
945
                        String[] parameterMaxValue={"90.0"};
946
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
947
                        addProjectionParameterMaxValue(count,"360.0");
948
                        addProjectionParameterMaxValue(count,"90.0");
949
                        addProjectionParameterMaxValue(count,"90.0");
950
                        addProjectionParameterMaxValue(count,"100000000.0");
951
                        addProjectionParameterMaxValue(count,"100000000.0");
952

    
953
                        String[] parameterMinValue={"-90.0"};
954
                        projectionParameterMinValueList.add(count,parameterMinValue);
955
                        addProjectionParameterMinValue(count,"-360.0");
956
                        addProjectionParameterMinValue(count,"-90.0");
957
                        addProjectionParameterMinValue(count,"-90.0");
958
                        addProjectionParameterMinValue(count,"-100000000.0");
959
                        addProjectionParameterMinValue(count,"-100000000.0");
960

    
961
                        String[] projectionAcronym={"eqdc"};
962
                        projectionAcronymList.add(count,projectionAcronym);
963
                }
964

    
965
                count++;
966
                {// Equirectangular
967
                        String[] projectionName={"Equirectangular"};
968
                        projectionNameList.add(count,projectionName);
969
                        addProjectionName(count,"Plate Caree");
970
                        addProjectionName(count,"Plate Carree");
971
                        addProjectionName(count,"Plate_Caree");
972
                        addProjectionName(count,"Plate_Carree");
973
                        addProjectionName(count,"Equidistant Cylindrical");
974
                        addProjectionName(count,"Equidistant_Cylindrical");
975
                        addProjectionName(count,"9823");
976

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

    
983
                        String[] parameterAcronym={"lat_ts"};
984
                        projectionParameterAcronymList.add(count,parameterAcronym);
985
                        addProjectionParameterAcronymList(count,"lon_0");
986
                        addProjectionParameterAcronymList(count,"x_0");
987
                        addProjectionParameterAcronymList(count,"y_0");
988

    
989
                        String[] parameterDefaultValue={"0.0"};
990
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
991
                        addProjectionParameterDefaultValue(count,"0.0");
992
                        addProjectionParameterDefaultValue(count,"0.0");
993
                        addProjectionParameterDefaultValue(count,"0.0");
994

    
995
                        String[] parameterMaxValue={"90.0"};
996
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
997
                        addProjectionParameterMaxValue(count,"360.0");
998
                        addProjectionParameterMaxValue(count,"100000000.0");
999
                        addProjectionParameterMaxValue(count,"100000000.0");
1000

    
1001
                        String[] parameterMinValue={"-90.0"};
1002
                        projectionParameterMinValueList.add(count,parameterMinValue);
1003
                        addProjectionParameterMinValue(count,"-360.0");
1004
                        addProjectionParameterMinValue(count,"-100000000.0");
1005
                        addProjectionParameterMinValue(count,"-100000000.0");
1006

    
1007
                        String[] projectionAcronym={"eqc"};
1008
                        projectionAcronymList.add(count,projectionAcronym);
1009
                }
1010
                
1011
                count++;
1012
                {// McBryde-Thomas Flat-Polar Quartic
1013
                        String[] projectionName={"McBryde_Thomas_Flat_Polar_Quartic"};
1014
                        projectionNameList.add(count,projectionName);
1015
                        addProjectionName(count,"McBryde-Thomas-Flat-Polar-Quartic");
1016
                        addProjectionName(count,"McBryde Thomas Flat Polar Quartic");
1017
                        addProjectionName(count,"Flat Polar Quartic");
1018
                        addProjectionName(count,"Flat-Polar-Quartic");
1019
                        addProjectionName(count,"Flat_Polar_Quartic");
1020

    
1021
                        String[] parameterName={"central_meridian"};
1022
                        projectionParameterList.add(count,parameterName);
1023
                        addProjectionParameter(count,"false_easting");
1024
                        addProjectionParameter(count,"false_northing");
1025

    
1026
                        String[] parameterAcronym={"lon_0"};
1027
                        projectionParameterAcronymList.add(count,parameterAcronym);
1028
                        addProjectionParameterAcronymList(count,"x_0");
1029
                        addProjectionParameterAcronymList(count,"y_0");
1030

    
1031
                        String[] parameterDefaultValue={"0.0"};
1032
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1033
                        addProjectionParameterDefaultValue(count,"0.0");
1034
                        addProjectionParameterDefaultValue(count,"0.0");
1035

    
1036
                        String[] parameterMaxValue={"360.0"};
1037
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1038
                        addProjectionParameterMaxValue(count,"100000000.0");
1039
                        addProjectionParameterMaxValue(count,"100000000.0");
1040

    
1041
                        String[] parameterMinValue={"-360.0"};
1042
                        projectionParameterMinValueList.add(count,parameterMinValue);
1043
                        addProjectionParameterMinValue(count,"-100000000.0");
1044
                        addProjectionParameterMinValue(count,"-100000000.0");
1045

    
1046
                        String[] projectionAcronym={"mbtfpq"};
1047
                        projectionAcronymList.add(count,projectionAcronym);
1048
                }
1049

    
1050
                count++;
1051
                {// Gall_Stereographic
1052
                        String[] projectionName={"Gall_Stereographic"};
1053
                        projectionNameList.add(count,projectionName);
1054
                        addProjectionName(count,"Gall Stereograpic");
1055
                        addProjectionName(count,"Gall");
1056

    
1057
                        String[] parameterName={"central_meridian"};
1058
                        projectionParameterList.add(count,parameterName);
1059
                        addProjectionParameter(count,"false_easting");
1060
                        addProjectionParameter(count,"false_northing");
1061

    
1062
                        String[] parameterAcronym={"lon_0"};
1063
                        projectionParameterAcronymList.add(count,parameterAcronym);
1064
                        addProjectionParameterAcronymList(count,"x_0");
1065
                        addProjectionParameterAcronymList(count,"y_0");
1066

    
1067
                        String[] parameterDefaultValue={"0.0"};
1068
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1069
                        addProjectionParameterDefaultValue(count,"0.0");
1070
                        addProjectionParameterDefaultValue(count,"0.0");
1071

    
1072
                        String[] parameterMaxValue={"360.0"};
1073
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1074
                        addProjectionParameterMaxValue(count,"100000000.0");
1075
                        addProjectionParameterMaxValue(count,"100000000.0");
1076

    
1077
                        String[] parameterMinValue={"-360.0"};
1078
                        projectionParameterMinValueList.add(count,parameterMinValue);
1079
                        addProjectionParameterMinValue(count,"-100000000.0");
1080
                        addProjectionParameterMinValue(count,"-100000000.0");
1081

    
1082
                        String[] projectionAcronym={"gall"};
1083
                        projectionAcronymList.add(count,projectionAcronym);
1084
                }
1085

    
1086
                count++;
1087
                {// GEOS
1088
                        String[] projectionName={"GEOS"};
1089
                        projectionNameList.add(count,projectionName);
1090
                        addProjectionName(count,"Geostationary Satellite View");
1091
                        addProjectionName(count,"Normalized Geostationary Projection");
1092

    
1093
                        String[] parameterName={"central_meridian"};
1094
                        projectionParameterList.add(count,parameterName);
1095
                        addProjectionParameter(count,"satellite_height");
1096
                        addProjectionParameter(count,"false_easting");
1097
                        addProjectionParameter(count,"false_northing");
1098

    
1099
                        String[] parameterAcronym={"lon_0"};
1100
                        projectionParameterAcronymList.add(count,parameterAcronym);
1101
                        addProjectionParameterAcronymList(count,"h");
1102
                        addProjectionParameterAcronymList(count,"y_0");
1103

    
1104
                        String[] parameterDefaultValue={"0.0"};
1105
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1106
                        addProjectionParameterDefaultValue(count,"35785831.0");
1107
                        addProjectionParameterDefaultValue(count,"0.0");
1108
                        addProjectionParameterDefaultValue(count,"0.0");
1109

    
1110
                        String[] parameterMaxValue={"360.0"};
1111
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1112
                        addProjectionParameterMaxValue(count,"100000000.0");
1113
                        addProjectionParameterMaxValue(count,"100000000.0");
1114
                        addProjectionParameterMaxValue(count,"100000000.0");
1115

    
1116
                        String[] parameterMinValue={"-360.0"};
1117
                        projectionParameterMinValueList.add(count,parameterMinValue);
1118
                        addProjectionParameterMinValue(count,"-100000000.0");
1119
                        addProjectionParameterMinValue(count,"-100000000.0");
1120
                        addProjectionParameterMinValue(count,"-100000000.0");
1121

    
1122
                        String[] projectionAcronym={"geos"};
1123
                        projectionAcronymList.add(count,projectionAcronym);
1124
                }
1125

    
1126
                count++;
1127
                {// Gnomonic
1128
                        String[] projectionName={"Gnomonic"};
1129
                        projectionNameList.add(count,projectionName);
1130
                        addProjectionName(count,"Gnomonic");
1131
                        addProjectionName(count,"Central");
1132

    
1133
                        String[] parameterName={"latitude_of_origin"};
1134
                        projectionParameterList.add(count,parameterName);
1135
                        addProjectionParameter(count,"central_meridian");
1136
                        addProjectionParameter(count,"false_easting");
1137
                        addProjectionParameter(count,"false_northing");
1138

    
1139
                        String[] parameterAcronym={"lat_0"};
1140
                        projectionParameterAcronymList.add(count,parameterAcronym);
1141
                        addProjectionParameterAcronymList(count,"lon_0");
1142
                        addProjectionParameterAcronymList(count,"x_0");
1143
                        addProjectionParameterAcronymList(count,"y_0");
1144

    
1145
                        String[] parameterDefaultValue={"0.0"};
1146
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1147
                        addProjectionParameterDefaultValue(count,"0.0");
1148
                        addProjectionParameterDefaultValue(count,"0.0");
1149
                        addProjectionParameterDefaultValue(count,"0.0");
1150

    
1151
                        String[] parameterMaxValue={"90.0"};
1152
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1153
                        addProjectionParameterMaxValue(count,"360.0");
1154
                        addProjectionParameterMaxValue(count,"100000000.0");
1155
                        addProjectionParameterMaxValue(count,"100000000.0");
1156

    
1157
                        String[] parameterMinValue={"-90.0"};
1158
                        projectionParameterMinValueList.add(count,parameterMinValue);
1159
                        addProjectionParameterMinValue(count,"-360.0");
1160
                        addProjectionParameterMinValue(count,"-100000000.0");
1161
                        addProjectionParameterMinValue(count,"-100000000.0");
1162

    
1163
                        String[] projectionAcronym={"gnom"};
1164
                        projectionAcronymList.add(count,projectionAcronym);
1165
                }
1166

    
1167
                count++;
1168
                {// Goode
1169
                        String[] projectionName={"Goode"};
1170
                        projectionNameList.add(count,projectionName);
1171
                        addProjectionName(count,"Homolosine");
1172

    
1173
                        String[] parameterName={"central_meridian"};
1174
                        projectionParameterList.add(count,parameterName);
1175
                        addProjectionParameter(count,"false_easting");
1176
                        addProjectionParameter(count,"false_northing");
1177

    
1178
                        String[] parameterAcronym={"lon_0"};
1179
                        projectionParameterAcronymList.add(count,parameterAcronym);
1180
                        addProjectionParameterAcronymList(count,"x_0");
1181
                        addProjectionParameterAcronymList(count,"y_0");
1182

    
1183
                        String[] parameterDefaultValue={"0.0"};
1184
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1185
                        addProjectionParameterDefaultValue(count,"0.0");
1186
                        addProjectionParameterDefaultValue(count,"0.0");
1187

    
1188
                        String[] parameterMaxValue={"360.0"};
1189
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1190
                        addProjectionParameterMaxValue(count,"100000000.0");
1191
                        addProjectionParameterMaxValue(count,"100000000.0");
1192

    
1193
                        String[] parameterMinValue={"-360.0"};
1194
                        projectionParameterMinValueList.add(count,parameterMinValue);
1195
                        addProjectionParameterMinValue(count,"-100000000.0");
1196
                        addProjectionParameterMinValue(count,"-100000000.0");
1197

    
1198
                        String[] projectionAcronym={"goode"};
1199
                        projectionAcronymList.add(count,projectionAcronym);
1200
                }
1201
                
1202
                count++;
1203
                {// Hammer-Aitoff
1204
                        String[] projectionName={"Hammer_Aitoff"};
1205
                        projectionNameList.add(count,projectionName);
1206
                        addProjectionName(count,"Hammer Aitoff");
1207
                        addProjectionName(count,"Hammer-Aitoff");
1208
                        addProjectionName(count,"Hammer");
1209

    
1210
                        String[] parameterName={"central_meridian"};
1211
                        projectionParameterList.add(count,parameterName);
1212
                        addProjectionParameter(count,"false_easting");
1213
                        addProjectionParameter(count,"false_northing");
1214

    
1215
                        String[] parameterAcronym={"lon_0"};
1216
                        projectionParameterAcronymList.add(count,parameterAcronym);
1217
                        addProjectionParameterAcronymList(count,"x_0");
1218
                        addProjectionParameterAcronymList(count,"y_0");
1219

    
1220
                        String[] parameterDefaultValue={"0.0"};
1221
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1222
                        addProjectionParameterDefaultValue(count,"0.0");
1223
                        addProjectionParameterDefaultValue(count,"0.0");
1224

    
1225
                        String[] parameterMaxValue={"360.0"};
1226
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1227
                        addProjectionParameterMaxValue(count,"100000000.0");
1228
                        addProjectionParameterMaxValue(count,"100000000.0");
1229

    
1230
                        String[] parameterMinValue={"-360.0"};
1231
                        projectionParameterMinValueList.add(count,parameterMinValue);
1232
                        addProjectionParameterMinValue(count,"-100000000.0");
1233
                        addProjectionParameterMinValue(count,"-100000000.0");
1234

    
1235
                        String[] projectionAcronym={"hammer"};
1236
                        projectionAcronymList.add(count,projectionAcronym);
1237
                }
1238
                
1239
                count++;
1240
                {// Krovak
1241
                        String[] projectionName={"Krovak"};
1242
                        projectionNameList.add(count,projectionName);
1243
                        addProjectionName(count,"Krovak Oblique Conic Conformal");
1244
                        addProjectionName(count,"9819");
1245

    
1246
                        String[] parameterName={"latitude_of_center"};
1247
                        projectionParameterList.add(count,parameterName);
1248
                        addProjectionParameter(count,"longitude_of_center");
1249
                        //addProjectionParameter(count,"azimuth");
1250
                        addProjectionParameter(count,"scale_factor");
1251
                        addProjectionParameter(count,"false_easting");
1252
                        addProjectionParameter(count,"false_northing");
1253

    
1254
                        String[] parameterAcronym={"lat_0"};
1255
                        projectionParameterAcronymList.add(count,parameterAcronym);
1256
                        addProjectionParameterAcronymList(count,"lon_0");
1257
                        //addProjectionParameterAcronymList(count,"alpha");
1258
                        addProjectionParameterAcronymList(count,"k");
1259
                        addProjectionParameterAcronymList(count,"x_0");
1260
                        addProjectionParameterAcronymList(count,"y_0");
1261

    
1262
                        String[] parameterDefaultValue={"0.0"};
1263
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1264
                        addProjectionParameterDefaultValue(count,"0.0");
1265
                        //addProjectionParameterDefaultValue(count,"0.0");
1266
                        addProjectionParameterDefaultValue(count,"1.0");
1267
                        addProjectionParameterDefaultValue(count,"0.0");
1268
                        addProjectionParameterDefaultValue(count,"0.0");
1269

    
1270
                        String[] parameterMaxValue={"90.0"};
1271
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1272
                        addProjectionParameterMaxValue(count,"360.0");
1273
                        //addProjectionParameterMaxValue(count,"360.0");
1274
                        addProjectionParameterMaxValue(count,"10.0");
1275
                        addProjectionParameterMaxValue(count,"100000000.0");
1276
                        addProjectionParameterMaxValue(count,"100000000.0");
1277

    
1278
                        String[] parameterMinValue={"-90.0"};
1279
                        projectionParameterMinValueList.add(count,parameterMinValue);
1280
                        addProjectionParameterMinValue(count,"-360.0");
1281
                        //addProjectionParameterMinValue(count,"-360.0");
1282
                        addProjectionParameterMinValue(count,"0.0");
1283
                        addProjectionParameterMinValue(count,"-100000000.0");
1284
                        addProjectionParameterMinValue(count,"-100000000.0");
1285

    
1286
                        String[] projectionAcronym={"krovak"};
1287
                        projectionAcronymList.add(count,projectionAcronym);
1288
                }
1289
                
1290
                
1291
                count++;
1292
                {// Laborde Madagascar
1293
                        String[] projectionName={"Laborde_Madagascar"};
1294
                        projectionNameList.add(count,projectionName);
1295
                        addProjectionName(count,"Laborde Madagascar");
1296
                        addProjectionName(count,"Laborde");
1297
                        addProjectionName(count,"9813");
1298
                        addProjectionName(count,"Laborde_Oblique_Mercator");
1299

    
1300
                        String[] parameterName={};
1301
                        projectionParameterList.add(count,parameterName);
1302

    
1303
                        String[] parameterAcronym={};
1304
                        projectionParameterAcronymList.add(count,parameterAcronym);
1305

    
1306
                        String[] parameterDefaultValue={};
1307
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1308

    
1309
                        String[] parameterMaxValue={};
1310
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1311

    
1312
                        String[] parameterMinValue={};
1313
                        projectionParameterMinValueList.add(count,parameterMinValue);
1314

    
1315
                        String[] projectionAcronym={"labrd"};
1316
                        projectionAcronymList.add(count,projectionAcronym);
1317
                        
1318
                        /*String[] parameterName={"azimuth"};
1319
                        projectionParameterList.add(count,parameterName);
1320

1321
                        String[] parameterAcronym={"azi"};
1322
                        projectionParameterAcronymList.add(count,parameterAcronym);
1323

1324
                        String[] parameterDefaultValue={"18.9"};
1325
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1326

1327
                        String[] parameterMaxValue={"19"};
1328
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1329

1330
                        String[] parameterMinValue={"18"};
1331
                        projectionParameterMinValueList.add(count,parameterMinValue);
1332

1333
                        String[] projectionAcronym={"labrd"};
1334
                        projectionAcronymList.add(count,projectionAcronym);*/
1335
                }
1336

    
1337
                count++;
1338
                {// Lambert_Azimuthal_Equal_Area
1339
                        String[] projectionName={"Lambert_Azimuthal_Equal_Area"};
1340
                        projectionNameList.add(count,projectionName);
1341
                        addProjectionName(count,"Lambert Azimuthal Equal Area");
1342
                        addProjectionName(count,"Lambert Azimuthal Equal Area (Spherical)");
1343
                        addProjectionName(count,"Lambert_Azimuthal_Equal_Area_(Spherical)");
1344
                        addProjectionName(count,"Lorgna");
1345
                        addProjectionName(count,"Zenithal Equal Area");
1346
                        addProjectionName(count,"Zenithal Equal-Area");
1347
                        addProjectionName(count,"Zenithal_Equal-Area");
1348
                        addProjectionName(count,"Zenithal-Equal-Area");
1349
                        addProjectionName(count,"Zenithal Eqivalent");
1350
                        addProjectionName(count,"Zenithal-Eqivalent");
1351
                        addProjectionName(count,"Zenithal_Eqivalent");
1352
                        addProjectionName(count,"9820");
1353
                        addProjectionName(count,"9821");
1354

    
1355
                        String[] parameterName={"latitude_of_center"};
1356
                        projectionParameterList.add(count,parameterName);
1357
                        addProjectionParameter(count,"longitude_of_center");
1358
                        addProjectionParameter(count,"false_easting");
1359
                        addProjectionParameter(count,"false_northing");
1360

    
1361
                        String[] parameterAcronym={"lat_0"};
1362
                        projectionParameterAcronymList.add(count,parameterAcronym);
1363
                        addProjectionParameterAcronymList(count,"lon_0");
1364
                        addProjectionParameterAcronymList(count,"x_0");
1365
                        addProjectionParameterAcronymList(count,"y_0");
1366

    
1367
                        String[] parameterDefaultValue={"0.0"};
1368
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1369
                        addProjectionParameterDefaultValue(count,"0.0");
1370
                        addProjectionParameterDefaultValue(count,"0.0");
1371
                        addProjectionParameterDefaultValue(count,"0.0");
1372

    
1373
                        String[] parameterMaxValue={"90.0"};
1374
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1375
                        addProjectionParameterMaxValue(count,"360.0");
1376
                        addProjectionParameterMaxValue(count,"100000000.0");
1377
                        addProjectionParameterMaxValue(count,"100000000.0");
1378

    
1379
                        String[] parameterMinValue={"-90.0"};
1380
                        projectionParameterMinValueList.add(count,parameterMinValue);
1381
                        addProjectionParameterMinValue(count,"-360.0");
1382
                        addProjectionParameterMinValue(count,"-100000000.0");
1383
                        addProjectionParameterMinValue(count,"-100000000.0");
1384

    
1385
                        String[] projectionAcronym={"laea"};
1386
                        projectionAcronymList.add(count,projectionAcronym);
1387
                }
1388
                count++;
1389
                {// Lambert_Conformal_Conic_1SP
1390
                        String[] projectionName={"Lambert_Conic_Near_Conformal"};
1391
                        projectionNameList.add(count,projectionName);
1392
                        addProjectionName(count,"Lambert Conic Near-Conformal");
1393
                        addProjectionName(count,"Lambert Conic Near Conformal");
1394
                        addProjectionName(count,"Lambert_Conic_Near-Conformal");
1395
                        addProjectionName(count,"9817");
1396

    
1397
                        String[] parameterName={"latitude_of_origin"};
1398
                        projectionParameterList.add(count,parameterName);
1399
                        addProjectionParameter(count,"central_meridian");
1400
                        addProjectionParameter(count,"scale_factor");
1401
                        addProjectionParameter(count,"false_easting");
1402
                        addProjectionParameter(count,"false_northing");
1403

    
1404
                        String[] parameterAcronym={"lat_0"};
1405
                        projectionParameterAcronymList.add(count,parameterAcronym);
1406
                        addProjectionParameterAcronymList(count,"lon_0");
1407
                        addProjectionParameterAcronymList(count,"k_0");
1408
                        addProjectionParameterAcronymList(count,"x_0");
1409
                        addProjectionParameterAcronymList(count,"y_0");
1410

    
1411
                        String[] parameterDefaultValue={"0.0"};
1412
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1413
                        addProjectionParameterDefaultValue(count,"0.0");
1414
                        addProjectionParameterDefaultValue(count,"1.0");
1415
                        addProjectionParameterDefaultValue(count,"0.0");
1416
                        addProjectionParameterDefaultValue(count,"0.0");
1417

    
1418
                        String[] parameterMaxValue={"90.0"};
1419
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1420
                        addProjectionParameterMaxValue(count,"360.0");
1421
                        addProjectionParameterMaxValue(count,"10.0");
1422
                        addProjectionParameterMaxValue(count,"100000000.0");
1423
                        addProjectionParameterMaxValue(count,"100000000.0");
1424

    
1425
                        String[] parameterMinValue={"-90.0"};
1426
                        projectionParameterMinValueList.add(count,parameterMinValue);
1427
                        addProjectionParameterMinValue(count,"-360.0");
1428
                        addProjectionParameterMinValue(count,"0.0");
1429
                        addProjectionParameterMinValue(count,"-100000000.0");
1430
                        addProjectionParameterMinValue(count,"-100000000.0");
1431

    
1432
                        String[] projectionAcronym={"lcca"};
1433
                        projectionAcronymList.add(count,projectionAcronym);
1434
                }
1435
                
1436
                count++;
1437
                {// Lambert_Conformal_Conic_1SP
1438
                        String[] projectionName={"Lambert_Conformal_Conic_1SP"};
1439
                        projectionNameList.add(count,projectionName);
1440
                        addProjectionName(count,"Lambert Conic Conformal (1SP)");
1441
                        addProjectionName(count,"9801");
1442

    
1443
                        String[] parameterName={"latitude_of_origin"};
1444
                        projectionParameterList.add(count,parameterName);
1445
                        addProjectionParameter(count,"central_meridian");
1446
                        addProjectionParameter(count,"scale_factor");
1447
                        addProjectionParameter(count,"false_easting");
1448
                        addProjectionParameter(count,"false_northing");
1449

    
1450
                        String[] parameterAcronym={"lat_0"};
1451
                        projectionParameterAcronymList.add(count,parameterAcronym);
1452
                        addProjectionParameterAcronymList(count,"lon_0");
1453
                        addProjectionParameterAcronymList(count,"k_0");
1454
                        addProjectionParameterAcronymList(count,"x_0");
1455
                        addProjectionParameterAcronymList(count,"y_0");
1456

    
1457
                        String[] parameterDefaultValue={"0.0"};
1458
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1459
                        addProjectionParameterDefaultValue(count,"0.0");
1460
                        addProjectionParameterDefaultValue(count,"1.0");
1461
                        addProjectionParameterDefaultValue(count,"0.0");
1462
                        addProjectionParameterDefaultValue(count,"0.0");
1463

    
1464
                        String[] parameterMaxValue={"90.0"};
1465
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1466
                        addProjectionParameterMaxValue(count,"360.0");
1467
                        addProjectionParameterMaxValue(count,"10.0");
1468
                        addProjectionParameterMaxValue(count,"100000000.0");
1469
                        addProjectionParameterMaxValue(count,"100000000.0");
1470

    
1471
                        String[] parameterMinValue={"-90.0"};
1472
                        projectionParameterMinValueList.add(count,parameterMinValue);
1473
                        addProjectionParameterMinValue(count,"-360.0");
1474
                        addProjectionParameterMinValue(count,"0.0");
1475
                        addProjectionParameterMinValue(count,"-100000000.0");
1476
                        addProjectionParameterMinValue(count,"-100000000.0");
1477

    
1478
                        String[] projectionAcronym={"lcc"};
1479
                        projectionAcronymList.add(count,projectionAcronym);
1480
                }
1481
                
1482
                count++;
1483
                {// Lambert_Conformal_Conic_2SP
1484
                        String[] projectionName={"Lambert_Conformal_Conic_2SP"};
1485
                        projectionNameList.add(count,projectionName);
1486
                        addProjectionName(count,"Lambert Conic Conformal (2SP)");
1487
                        addProjectionName(count,"9802");
1488

    
1489
                        String[] parameterName={"standard_parallel_1"};
1490
                        projectionParameterList.add(count,parameterName);
1491
                        addProjectionParameter(count,"standard_parallel_2");
1492
                        addProjectionParameter(count,"latitude_of_origin");
1493
                        addProjectionParameter(count,"central_meridian");
1494
                        addProjectionParameter(count,"false_easting");
1495
                        addProjectionParameter(count,"false_northing");
1496

    
1497
                        String[] parameterAcronym={"lat_1"};
1498
                        projectionParameterAcronymList.add(count,parameterAcronym);
1499
                        addProjectionParameterAcronymList(count,"lat_2");
1500
                        addProjectionParameterAcronymList(count,"lat_0");
1501
                        addProjectionParameterAcronymList(count,"lon_0");
1502
                        addProjectionParameterAcronymList(count,"x_0");
1503
                        addProjectionParameterAcronymList(count,"y_0");
1504

    
1505
                        String[] parameterDefaultValue={"0.0"};
1506
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1507
                        addProjectionParameterDefaultValue(count,"0.0");
1508
                        addProjectionParameterDefaultValue(count,"0.0");
1509
                        addProjectionParameterDefaultValue(count,"0.0");
1510
                        addProjectionParameterDefaultValue(count,"0.0");
1511
                        addProjectionParameterDefaultValue(count,"0.0");
1512

    
1513
                        String[] parameterMaxValue={"90.0"};
1514
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1515
                        addProjectionParameterMaxValue(count,"90.0");
1516
                        addProjectionParameterMaxValue(count,"90.0");
1517
                        addProjectionParameterMaxValue(count,"360.0");
1518
                        addProjectionParameterMaxValue(count,"100000000.0");
1519
                        addProjectionParameterMaxValue(count,"100000000.0");
1520

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

    
1529
                        String[] projectionAcronym={"lcc"};
1530
                        projectionAcronymList.add(count,projectionAcronym);
1531
                }
1532
                
1533
                count++;
1534
                {// Lambert_Conformal_Conic
1535
                        String[] projectionName={"Lambert_Conformal_Conic"};
1536
                        projectionNameList.add(count,projectionName);
1537
                        addProjectionName(count,"Lambert Conic Conformal");
1538
                        addProjectionName(count,"9801");
1539

    
1540
                        String[] parameterName={"latitude_of_origin"};
1541
                        projectionParameterList.add(count,parameterName);
1542
                        addProjectionParameter(count,"standard_parallel_1");
1543
                        addProjectionParameter(count,"standard_parallel_2");
1544
                        addProjectionParameter(count,"central_meridian");
1545
                        addProjectionParameter(count,"scale_factor");
1546
                        addProjectionParameter(count,"false_easting");
1547
                        addProjectionParameter(count,"false_northing");
1548

    
1549
                        String[] parameterAcronym={"lat_0"};
1550
                        projectionParameterAcronymList.add(count,parameterAcronym);
1551
                        addProjectionParameterAcronymList(count,"lat_1");
1552
                        addProjectionParameterAcronymList(count,"lat_2");
1553
                        addProjectionParameterAcronymList(count,"lon_0");
1554
                        addProjectionParameterAcronymList(count,"k_0");
1555
                        addProjectionParameterAcronymList(count,"x_0");
1556
                        addProjectionParameterAcronymList(count,"y_0");
1557

    
1558
                        String[] parameterDefaultValue={"0.0"};
1559
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1560
                        addProjectionParameterDefaultValue(count,"0.0");
1561
                        addProjectionParameterDefaultValue(count,"0.0");
1562
                        addProjectionParameterDefaultValue(count,"0.0");
1563
                        addProjectionParameterDefaultValue(count,"1.0");
1564
                        addProjectionParameterDefaultValue(count,"0.0");
1565
                        addProjectionParameterDefaultValue(count,"0.0");
1566

    
1567
                        String[] parameterMaxValue={"90.0"};
1568
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1569
                        addProjectionParameterMaxValue(count,"90.0");
1570
                        addProjectionParameterMaxValue(count,"90.0");
1571
                        addProjectionParameterMaxValue(count,"360.0");
1572
                        addProjectionParameterMaxValue(count,"10.0");
1573
                        addProjectionParameterMaxValue(count,"100000000.0");
1574
                        addProjectionParameterMaxValue(count,"100000000.0");
1575

    
1576
                        String[] parameterMinValue={"-90.0"};
1577
                        projectionParameterMinValueList.add(count,parameterMinValue);
1578
                        addProjectionParameterMinValue(count,"-90.0");
1579
                        addProjectionParameterMinValue(count,"-90.0");
1580
                        addProjectionParameterMinValue(count,"-360.0");
1581
                        addProjectionParameterMinValue(count,"0.0");
1582
                        addProjectionParameterMinValue(count,"-100000000.0");
1583
                        addProjectionParameterMinValue(count,"-100000000.0");
1584

    
1585
                        String[] projectionAcronym={"lcc"};
1586
                        projectionAcronymList.add(count,projectionAcronym);
1587
                }
1588
                
1589
                count++;
1590
                {// Lambert_Conformal_Conic_2SP_Belgium
1591
                        String[] projectionName={"Lambert_Conformal_Conic_2SP_Belgium"};
1592
                        projectionNameList.add(count,projectionName);
1593
                        addProjectionName(count,"Lambert Conic Conformal (2SP Belgium)");
1594
                        addProjectionName(count,"9803");
1595
                        addProjectionName(count,"Lambert_Conic_Conformal_(2SP_Belgium)");
1596

    
1597
                        String[] parameterName={"standard_parallel_1"};
1598
                        projectionParameterList.add(count,parameterName);
1599
                        addProjectionParameter(count,"standard_parallel_2");
1600
                        addProjectionParameter(count,"latitude_of_origin");
1601
                        addProjectionParameter(count,"central_meridian");
1602
                        addProjectionParameter(count,"false_easting");
1603
                        addProjectionParameter(count,"false_northing");
1604

    
1605
                        String[] parameterAcronym={"lat_1"};
1606
                        projectionParameterAcronymList.add(count,parameterAcronym);
1607
                        addProjectionParameterAcronymList(count,"lat_2");
1608
                        addProjectionParameterAcronymList(count,"lat_0");
1609
                        addProjectionParameterAcronymList(count,"lon_0");
1610
                        addProjectionParameterAcronymList(count,"x_0");
1611
                        addProjectionParameterAcronymList(count,"y_0");
1612

    
1613
                        String[] parameterDefaultValue={"0.0"};
1614
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1615
                        addProjectionParameterDefaultValue(count,"0.0");
1616
                        addProjectionParameterDefaultValue(count,"0.0");
1617
                        addProjectionParameterDefaultValue(count,"0.0");
1618
                        addProjectionParameterDefaultValue(count,"0.0");
1619
                        addProjectionParameterDefaultValue(count,"0.0");
1620

    
1621
                        String[] parameterMaxValue={"90.0"};
1622
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1623
                        addProjectionParameterMaxValue(count,"90.0");
1624
                        addProjectionParameterMaxValue(count,"90.0");
1625
                        addProjectionParameterMaxValue(count,"360.0");
1626
                        addProjectionParameterMaxValue(count,"100000000.0");
1627
                        addProjectionParameterMaxValue(count,"100000000.0");
1628

    
1629
                        String[] parameterMinValue={"-90.0"};
1630
                        projectionParameterMinValueList.add(count,parameterMinValue);
1631
                        addProjectionParameterMinValue(count,"-90.0");
1632
                        addProjectionParameterMinValue(count,"-90.0");
1633
                        addProjectionParameterMinValue(count,"-360.0");
1634
                        addProjectionParameterMinValue(count,"-100000000.0");
1635
                        addProjectionParameterMinValue(count,"-100000000.0");
1636

    
1637
                        String[] projectionAcronym={"lcc"};
1638
                        projectionAcronymList.add(count,projectionAcronym);
1639
                }
1640

    
1641
                count++;
1642
                {// Loximuthal
1643
                        String[] projectionName={"Loximuthal"};
1644
                        projectionNameList.add(count,projectionName);
1645
                        //addProjectionName(count,"Winkel I");
1646

    
1647
                        String[] parameterName={"central_meridian"};
1648
                        projectionParameterList.add(count,parameterName);
1649
                        addProjectionParameter(count,"Central_Parallel");
1650
                        addProjectionParameter(count,"false_easting");
1651
                        addProjectionParameter(count,"false_northing");
1652

    
1653
                        String[] parameterAcronym={"lon_0"};
1654
                        projectionParameterAcronymList.add(count,parameterAcronym);
1655
                        addProjectionParameterAcronymList(count,"lat_1");
1656
                        addProjectionParameterAcronymList(count,"x_0");
1657
                        addProjectionParameterAcronymList(count,"y_0");
1658

    
1659
                        String[] parameterDefaultValue={"0.0"};
1660
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1661
                        addProjectionParameterDefaultValue(count,"0.0");
1662
                        addProjectionParameterDefaultValue(count,"0.0");
1663
                        addProjectionParameterDefaultValue(count,"0.0");
1664

    
1665
                        String[] parameterMaxValue={"360.0"};
1666
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1667
                        addProjectionParameterMaxValue(count,"90.0");
1668
                        addProjectionParameterMaxValue(count,"100000000.0");
1669
                        addProjectionParameterMaxValue(count,"100000000.0");
1670

    
1671
                        String[] parameterMinValue={"-360.0"};
1672
                        projectionParameterMinValueList.add(count,parameterMinValue);
1673
                        addProjectionParameterMinValue(count,"-90.0");
1674
                        addProjectionParameterMinValue(count,"-100000000.0");
1675
                        addProjectionParameterMinValue(count,"-100000000.0");
1676

    
1677
                        String[] projectionAcronym={"loxim"};
1678
                        projectionAcronymList.add(count,projectionAcronym);
1679
                }
1680
                
1681
                count++;
1682
                {// Mercator_1SP
1683
                        String[] projectionName={"Mercator_1SP"};
1684
                        projectionNameList.add(count,projectionName);
1685
                        addProjectionName(count,"Mercator");
1686
                        addProjectionName(count,"Wright");
1687
                        addProjectionName(count,"9804");
1688
                        addProjectionName(count, "Mercator (1SP)");
1689
                        addProjectionName(count, "Mercator_(1SP)");
1690
                        addProjectionName(count,"Mercator_(variant_A)");
1691

    
1692
                        String[] parameterName={"central_meridian"};
1693
                        projectionParameterList.add(count,parameterName);
1694
                        addProjectionParameter(count,"latitude_of_origin");  // o latitude_origin
1695
                        addProjectionParameter(count,"scale_factor");
1696
                        addProjectionParameter(count,"false_easting");
1697
                        addProjectionParameter(count,"false_northing");
1698

    
1699
                        String[] parameterAcronym={"lon_0"};
1700
                        projectionParameterAcronymList.add(count,parameterAcronym);
1701
                        addProjectionParameterAcronymList(count,"lat_ts");
1702
                        addProjectionParameterAcronymList(count,"k");
1703
                        addProjectionParameterAcronymList(count,"x_0");
1704
                        addProjectionParameterAcronymList(count,"y_0");
1705

    
1706
                        String[] parameterDefaultValue={"0.0"};
1707
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1708
                        addProjectionParameterDefaultValue(count,"0.0"); // o 0.0
1709
                        addProjectionParameterDefaultValue(count,"1.0"); // o 0.0
1710
                        addProjectionParameterDefaultValue(count,"0.0");
1711
                        addProjectionParameterDefaultValue(count,"0.0");
1712

    
1713
                        String[] parameterMaxValue={"360.0"};
1714
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1715
                        addProjectionParameterMaxValue(count,"90.0");
1716
                        addProjectionParameterMaxValue(count,"10.0");
1717
                        addProjectionParameterMaxValue(count,"100000000.0");
1718
                        addProjectionParameterMaxValue(count,"100000000.0");
1719

    
1720
                        String[] parameterMinValue={"-360.0"};
1721
                        projectionParameterMinValueList.add(count,parameterMinValue);
1722
                        addProjectionParameterMinValue(count,"-90.0");
1723
                        addProjectionParameterMinValue(count,"0.0");
1724
                        addProjectionParameterMinValue(count,"-100000000.0");
1725
                        addProjectionParameterMinValue(count,"-100000000.0");
1726

    
1727
                        String[] projectionAcronym={"merc"};
1728
                        projectionAcronymList.add(count,projectionAcronym);
1729
                }
1730
                
1731
                count++;
1732
                {// Mercator_2SP
1733
                        String[] projectionName={"Mercator_2SP"};
1734
                        projectionNameList.add(count,projectionName);
1735
                        addProjectionName(count,"Mercator");
1736
                        addProjectionName(count,"9805");
1737
                        addProjectionName(count, "Mercator (2SP)");
1738
                        addProjectionName(count, "Mercator_(variant_B)");
1739

    
1740
                        String[] parameterName={"central_meridian"};
1741
                        projectionParameterList.add(count,parameterName);
1742
                        addProjectionParameter(count,"standard_parallel_1");
1743
                        addProjectionParameter(count,"false_easting");
1744
                        addProjectionParameter(count,"false_northing");
1745

    
1746
                        String[] parameterAcronym={"lon_0"};
1747
                        projectionParameterAcronymList.add(count,parameterAcronym);
1748
                        addProjectionParameterAcronymList(count,"lat_ts");
1749
                        addProjectionParameterAcronymList(count,"x_0");
1750
                        addProjectionParameterAcronymList(count,"y_0");
1751

    
1752
                        String[] parameterDefaultValue={"0.0"};
1753
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1754
                        addProjectionParameterDefaultValue(count,"0.0"); // o 0.0
1755
                        addProjectionParameterDefaultValue(count,"0.0");
1756
                        addProjectionParameterDefaultValue(count,"0.0");
1757

    
1758
                        String[] parameterMaxValue={"360.0"};
1759
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1760
                        addProjectionParameterMaxValue(count,"90.0");
1761
                        addProjectionParameterMaxValue(count,"100000000.0");
1762
                        addProjectionParameterMaxValue(count,"100000000.0");
1763

    
1764
                        String[] parameterMinValue={"-360.0"};
1765
                        projectionParameterMinValueList.add(count,parameterMinValue);
1766
                        addProjectionParameterMinValue(count,"-90.0");
1767
                        addProjectionParameterMinValue(count,"-100000000.0");
1768
                        addProjectionParameterMinValue(count,"-100000000.0");
1769

    
1770
                        String[] projectionAcronym={"merc"};
1771
                        projectionAcronymList.add(count,projectionAcronym);
1772
                }
1773

    
1774
                count++;
1775
                {// Miller_Cylindrical
1776
                        String[] projectionName={"Miller_Cylindrical"};
1777
                        projectionNameList.add(count,projectionName);
1778
                        addProjectionName(count,"Miller Cylindrical");
1779

    
1780
                        String[] parameterName={"latitude_of_center"};
1781
                        projectionParameterList.add(count,parameterName);
1782
                        addProjectionParameter(count,"longitude_of_center");
1783
                        addProjectionParameter(count,"false_easting");
1784
                        addProjectionParameter(count,"false_northing");
1785

    
1786
                        String[] parameterAcronym={"lat_0"};
1787
                        projectionParameterAcronymList.add(count,parameterAcronym);
1788
                        addProjectionParameterAcronymList(count,"lon_0");
1789
                        addProjectionParameterAcronymList(count,"x_0");
1790
                        addProjectionParameterAcronymList(count,"y_0");
1791

    
1792
                        String[] parameterDefaultValue={"0.0"};
1793
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1794
                        addProjectionParameterDefaultValue(count,"0.0");
1795
                        addProjectionParameterDefaultValue(count,"0.0");
1796
                        addProjectionParameterDefaultValue(count,"0.0");
1797

    
1798
                        String[] parameterMaxValue={"90.0"};
1799
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1800
                        addProjectionParameterMaxValue(count,"360.0");
1801
                        addProjectionParameterMaxValue(count,"100000000.0");
1802
                        addProjectionParameterMaxValue(count,"100000000.0");
1803

    
1804
                        String[] parameterMinValue={"-90.0"};
1805
                        projectionParameterMinValueList.add(count,parameterMinValue);
1806
                        addProjectionParameterMinValue(count,"-360.0");
1807
                        addProjectionParameterMinValue(count,"-100000000.0");
1808
                        addProjectionParameterMinValue(count,"-100000000.0");
1809

    
1810
                        String[] projectionAcronym={"mill"};
1811
                        projectionAcronymList.add(count,projectionAcronym);
1812
                }
1813
                
1814
                count++;
1815
                {// Mollweide
1816
                        String[] projectionName={"Mollweide"};
1817
                        projectionNameList.add(count,projectionName);
1818
                        addProjectionName(count,"Homolographic");
1819
                        addProjectionName(count,"Homalographic");
1820
                        addProjectionName(count,"Babinet");
1821
                        addProjectionName(count,"Elliptical");
1822

    
1823
                        String[] parameterName={"central_meridian"};
1824
                        projectionParameterList.add(count,parameterName);
1825
                        addProjectionParameter(count,"false_easting");
1826
                        addProjectionParameter(count,"false_northing");
1827

    
1828
                        String[] parameterAcronym={"lon_0"};
1829
                        projectionParameterAcronymList.add(count,parameterAcronym);
1830
                        addProjectionParameterAcronymList(count,"x_0");
1831
                        addProjectionParameterAcronymList(count,"y_0");
1832

    
1833
                        String[] parameterDefaultValue={"0.0"};
1834
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1835
                        addProjectionParameterDefaultValue(count,"0.0");
1836
                        addProjectionParameterDefaultValue(count,"0.0");
1837

    
1838
                        String[] parameterMaxValue={"360.0"};
1839
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1840
                        addProjectionParameterMaxValue(count,"100000000.0");
1841
                        addProjectionParameterMaxValue(count,"100000000.0");
1842

    
1843
                        String[] parameterMinValue={"-360.0"};
1844
                        projectionParameterMinValueList.add(count,parameterMinValue);
1845
                        addProjectionParameterMinValue(count,"-100000000.0");
1846
                        addProjectionParameterMinValue(count,"-100000000.0");
1847

    
1848
                        String[] projectionAcronym={"moll"};
1849
                        projectionAcronymList.add(count,projectionAcronym);
1850
                }
1851
                
1852
                count++;
1853
                {// Near-Sided Perspective
1854
                        String[] projectionName={"Near_Sided_Perspective"};
1855
                        projectionNameList.add(count,projectionName);
1856
                        addProjectionName(count,"Near Sided Perspective");
1857
                        addProjectionName(count,"Near-Sided Perspective");
1858
                        addProjectionName(count,"Near-Sided-Perspective");
1859
                        addProjectionName(count,"Near-Sided_Perspective");
1860
                        addProjectionName(count,"Vertical Near Side Perspective");
1861
                        addProjectionName(count,"Vertical-Near-Side-Perspective");
1862
                        addProjectionName(count,"Vertical_Near_Side_Perspective");
1863
                        
1864
                        String[] parameterName={"latitude_of_center"};
1865
                        projectionParameterList.add(count,parameterName);
1866
                        addProjectionParameter(count,"longitude_of_center");
1867
                        addProjectionParameter(count,"Height");
1868
                        addProjectionParameter(count,"false_easting");
1869
                        addProjectionParameter(count,"false_northing");
1870

    
1871
                        String[] parameterAcronym={"lat_0"};
1872
                        projectionParameterAcronymList.add(count,parameterAcronym);
1873
                        addProjectionParameterAcronymList(count,"lon_0");
1874
                        addProjectionParameterAcronymList(count,"h");
1875
                        addProjectionParameterAcronymList(count,"x_0");
1876
                        addProjectionParameterAcronymList(count,"y_0");
1877

    
1878
                        String[] parameterDefaultValue={"0.0"};
1879
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1880
                        addProjectionParameterDefaultValue(count,"0.0");
1881
                        addProjectionParameterDefaultValue(count,"0.001");
1882
                        addProjectionParameterDefaultValue(count,"0.0");
1883
                        addProjectionParameterDefaultValue(count,"0.0");
1884

    
1885
                        String[] parameterMaxValue={"90.0"};
1886
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1887
                        addProjectionParameterMaxValue(count,"360.0");
1888
                        addProjectionParameterMaxValue(count,"100000000.0");
1889
                        addProjectionParameterMaxValue(count,"100000000.0");
1890
                        addProjectionParameterMaxValue(count,"100000000.0");
1891

    
1892
                        String[] parameterMinValue={"-90.0"};
1893
                        projectionParameterMinValueList.add(count,parameterMinValue);
1894
                        addProjectionParameterMinValue(count,"-360.0");
1895
                        addProjectionParameterMinValue(count,"0.001");
1896
                        addProjectionParameterMinValue(count,"-100000000.0");
1897
                        addProjectionParameterMinValue(count,"-100000000.0");
1898

    
1899
                        String[] projectionAcronym={"nsper"};
1900
                        projectionAcronymList.add(count,projectionAcronym);
1901
                }
1902

    
1903
                count++;
1904
                {// New_Zealand_Map_Grid
1905
                        String[] projectionName={"New_Zealand_Map_Grid"};
1906
                        projectionNameList.add(count,projectionName);
1907
                        addProjectionName(count,"New Zealand Map Grid");
1908
                        addProjectionName(count,"9811");
1909

    
1910
                        String[] parameterName={"latitude_of_origin"};
1911
                        projectionParameterList.add(count,parameterName);
1912
                        addProjectionParameter(count,"central_meridian");
1913
                        addProjectionParameter(count,"false_easting");
1914
                        addProjectionParameter(count,"false_northing");
1915

    
1916
                        String[] parameterAcronym={"lat_0"};
1917
                        projectionParameterAcronymList.add(count,parameterAcronym);
1918
                        addProjectionParameterAcronymList(count,"lon_0");
1919
                        addProjectionParameterAcronymList(count,"x_0");
1920
                        addProjectionParameterAcronymList(count,"y_0");
1921

    
1922
                        String[] parameterDefaultValue={"0.0"};
1923
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1924
                        addProjectionParameterDefaultValue(count,"0.0");
1925
                        addProjectionParameterDefaultValue(count,"0.0");
1926
                        addProjectionParameterDefaultValue(count,"0.0");
1927

    
1928
                        String[] parameterMaxValue={"90.0"};
1929
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1930
                        addProjectionParameterMaxValue(count,"360.0");
1931
                        addProjectionParameterMaxValue(count,"100000000.0");
1932
                        addProjectionParameterMaxValue(count,"100000000.0");
1933

    
1934
                        String[] parameterMinValue={"-90.0"};
1935
                        projectionParameterMinValueList.add(count,parameterMinValue);
1936
                        addProjectionParameterMinValue(count,"-360.0");
1937
                        addProjectionParameterMinValue(count,"-100000000.0");
1938
                        addProjectionParameterMinValue(count,"-100000000.0");
1939

    
1940
                        String[] projectionAcronym={"nzmg"};
1941
                        projectionAcronymList.add(count,projectionAcronym);
1942
                }
1943

    
1944
                count++;
1945
                {// Oblique_Mercator
1946
                        String[] projectionName={"Oblique_Mercator"};
1947
                        projectionNameList.add(count,projectionName);
1948
                        addProjectionName(count,"Oblique Mercator");
1949
                        addProjectionName(count,"9815");
1950
                        addProjectionName(count,"CT_ObliqueMercator");
1951
                        addProjectionName(count,"Hotine_Oblique_Mercator_Azimuth_Center");
1952
                        addProjectionName(count,"Rectified_Skew_Orthomorphic_Center");
1953
                        addProjectionName(count,"Hotine Oblique Mercator");
1954
                        addProjectionName(count,"Hotine_Oblique_Mercator");
1955
                        addProjectionName(count,"Hotine_Oblique_Mercator_(variant_B)");
1956

    
1957
                        String[] parameterName={"latitude_of_center"};
1958
                        projectionParameterList.add(count,parameterName);
1959
                        addProjectionParameter(count,"longitude_of_center");
1960
                        addProjectionParameter(count,"azimuth");
1961
                        addProjectionParameter(count,"rectified_grid_angle");
1962
                        addProjectionParameter(count,"scale_factor");
1963
                        addProjectionParameter(count,"false_easting");
1964
                        addProjectionParameter(count,"false_northing");
1965

    
1966
                        String[] parameterAcronym={"lat_0"};
1967
                        projectionParameterAcronymList.add(count,parameterAcronym);
1968
                        addProjectionParameterAcronymList(count,"lonc");
1969
                        addProjectionParameterAcronymList(count,"alpha");
1970
                        addProjectionParameterAcronymList(count,"gamma");
1971
                        addProjectionParameterAcronymList(count,"k");
1972
                        addProjectionParameterAcronymList(count,"x_0");
1973
                        addProjectionParameterAcronymList(count,"y_0");
1974

    
1975
                        String[] parameterDefaultValue={"0.0"};
1976
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
1977
                        addProjectionParameterDefaultValue(count,"0.0");
1978
                        addProjectionParameterDefaultValue(count,"0.0");
1979
                        addProjectionParameterDefaultValue(count,"0.0");
1980
                        addProjectionParameterDefaultValue(count,"1.0");
1981
                        addProjectionParameterDefaultValue(count,"0.0");
1982
                        addProjectionParameterDefaultValue(count,"0.0");
1983

    
1984
                        String[] parameterMaxValue={"90.0"};
1985
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
1986
                        addProjectionParameterMaxValue(count,"360.0");
1987
                        addProjectionParameterMaxValue(count,"360.0");
1988
                        addProjectionParameterMaxValue(count,"360.0");
1989
                        addProjectionParameterMaxValue(count,"10.0");
1990
                        addProjectionParameterMaxValue(count,"100000000.0");
1991
                        addProjectionParameterMaxValue(count,"100000000.0");
1992

    
1993
                        String[] parameterMinValue={"-90.0"};
1994
                        projectionParameterMinValueList.add(count,parameterMinValue);
1995
                        addProjectionParameterMinValue(count,"-360.0");
1996
                        addProjectionParameterMinValue(count,"-360.0");
1997
                        addProjectionParameterMinValue(count,"-360.0");
1998
                        addProjectionParameterMinValue(count,"0.0");
1999
                        addProjectionParameterMinValue(count,"-100000000.0");
2000
                        addProjectionParameterMinValue(count,"-100000000.0");
2001

    
2002
                        String[] projectionAcronym={"omerc"};
2003
                        projectionAcronymList.add(count,projectionAcronym);
2004
                }
2005

    
2006
                count++;
2007
                {// Oblique_Mercator
2008
                        String[] projectionName={"Hotine_Oblique_Mercator_Two_Point_Center"};
2009
                        projectionNameList.add(count,projectionName);
2010
                        addProjectionName(count,"Hotine_Oblique_Mercator_Two_Point_Natural_Origin");
2011

    
2012
            /*SEMI_MAJOR,          SEMI_MINOR,
2013
            LAT_OF_1ST_POINT,    LONG_OF_1ST_POINT,
2014
            LAT_OF_2ND_POINT,    LONG_OF_2ND_POINT,
2015
                    LAT_OF_CENTRE,       SCALE_FACTOR_LOCAL,
2016
            FALSE_EASTING_LOCAL,       FALSE_NORTHING_LOCAL*/
2017

    
2018
            String[] parameterName={"Latitude_Of_1st_Point"};
2019
                        projectionParameterList.add(count,parameterName);
2020
                        addProjectionParameter(count,"Longitude_Of_1st_Point");
2021
                        addProjectionParameter(count,"Latitude_Of_2nd_Point");
2022
                        addProjectionParameter(count,"Longitude_Of_2nd_Point");
2023
                        addProjectionParameter(count,"scale_factor");
2024
                        addProjectionParameter(count,"false_easting");
2025
                        addProjectionParameter(count,"false_northing");
2026

    
2027
                        String[] parameterAcronym={"lat_1"};
2028
                        projectionParameterAcronymList.add(count,parameterAcronym);
2029
                        addProjectionParameterAcronymList(count,"lon_1");
2030
                        addProjectionParameterAcronymList(count,"lat_2");
2031
                        addProjectionParameterAcronymList(count,"lon_2");
2032
                        addProjectionParameterAcronymList(count,"k");
2033
                        addProjectionParameterAcronymList(count,"x_0");
2034
                        addProjectionParameterAcronymList(count,"y_0");
2035

    
2036
                        String[] parameterDefaultValue={"0.0"};
2037
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2038
                        addProjectionParameterDefaultValue(count,"0.0");
2039
                        addProjectionParameterDefaultValue(count,"0.0");
2040
                        addProjectionParameterDefaultValue(count,"0.0");
2041
                        addProjectionParameterDefaultValue(count,"1.0");
2042
                        addProjectionParameterDefaultValue(count,"0.0");
2043
                        addProjectionParameterDefaultValue(count,"0.0");
2044

    
2045
                        String[] parameterMaxValue={"90.0"};
2046
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2047
                        addProjectionParameterMaxValue(count,"360.0");
2048
                        addProjectionParameterMaxValue(count,"90.0");
2049
                        addProjectionParameterMaxValue(count,"360.0");
2050
                        addProjectionParameterMaxValue(count,"10.0");
2051
                        addProjectionParameterMaxValue(count,"100000000.0");
2052
                        addProjectionParameterMaxValue(count,"100000000.0");
2053

    
2054
                        String[] parameterMinValue={"-90.0"};
2055
                        projectionParameterMinValueList.add(count,parameterMinValue);
2056
                        addProjectionParameterMinValue(count,"-360.0");
2057
                        addProjectionParameterMinValue(count,"-90.0");
2058
                        addProjectionParameterMinValue(count,"-360.0");
2059
                        addProjectionParameterMinValue(count,"0.0");
2060
                        addProjectionParameterMinValue(count,"-100000000.0");
2061
                        addProjectionParameterMinValue(count,"-100000000.0");
2062

    
2063
                        String[] projectionAcronym={"omerc"};
2064
                        projectionAcronymList.add(count,projectionAcronym);
2065
                }
2066

    
2067
                count++;
2068
                {// Oblique_Stereographic
2069
                        String[] projectionName={"Oblique_Stereographic"};
2070
                        projectionNameList.add(count,projectionName);
2071
                        addProjectionName(count,"Oblique Stereographic");
2072
                        addProjectionName(count,"9809");
2073

    
2074
                        String[] parameterName={"latitude_of_origin"};
2075
                        projectionParameterList.add(count,parameterName);
2076
                        addProjectionParameter(count,"central_meridian");
2077
                        addProjectionParameter(count,"scale_factor");
2078
                        addProjectionParameter(count,"false_easting");
2079
                        addProjectionParameter(count,"false_northing");
2080

    
2081
                        String[] parameterAcronym={"lat_0"};
2082
                        projectionParameterAcronymList.add(count,parameterAcronym);
2083
                        addProjectionParameterAcronymList(count,"lon_0");
2084
                        addProjectionParameterAcronymList(count,"k");
2085
                        addProjectionParameterAcronymList(count,"x_0");
2086
                        addProjectionParameterAcronymList(count,"y_0");
2087

    
2088
                        String[] parameterDefaultValue={"0.0"};
2089
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2090
                        addProjectionParameterDefaultValue(count,"0.0");
2091
                        addProjectionParameterDefaultValue(count,"1.0");
2092
                        addProjectionParameterDefaultValue(count,"0.0");
2093
                        addProjectionParameterDefaultValue(count,"0.0");
2094

    
2095
                        String[] parameterMaxValue={"90.0"};
2096
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2097
                        addProjectionParameterMaxValue(count,"360.0");
2098
                        addProjectionParameterMaxValue(count,"10.0");
2099
                        addProjectionParameterMaxValue(count,"100000000.0");
2100
                        addProjectionParameterMaxValue(count,"100000000.0");
2101

    
2102
                        String[] parameterMinValue={"-90.0"};
2103
                        projectionParameterMinValueList.add(count,parameterMinValue);
2104
                        addProjectionParameterMinValue(count,"-360.0");
2105
                        addProjectionParameterMinValue(count,"0.0");
2106
                        addProjectionParameterMinValue(count,"-100000000.0");
2107
                        addProjectionParameterMinValue(count,"-100000000.0");
2108

    
2109
                        String[] projectionAcronym={"sterea"};
2110
                        projectionAcronymList.add(count,projectionAcronym);
2111
                }
2112

    
2113
                count++;
2114
                {// Orthographic
2115
                        String[] projectionName={"Orthographic"};
2116
                        projectionNameList.add(count,projectionName);
2117

    
2118
                        String[] parameterName={"latitude_of_origin"};
2119
                        projectionParameterList.add(count,parameterName);
2120
                        addProjectionParameter(count,"central_meridian");
2121
                        addProjectionParameter(count,"false_easting");
2122
                        addProjectionParameter(count,"false_northing");
2123

    
2124
                        String[] parameterAcronym={"lat_0"};
2125
                        projectionParameterAcronymList.add(count,parameterAcronym);
2126
                        addProjectionParameterAcronymList(count,"lon_0");
2127
                        addProjectionParameterAcronymList(count,"x_0");
2128
                        addProjectionParameterAcronymList(count,"y_0");
2129

    
2130
                        String[] parameterDefaultValue={"0.0"};
2131
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2132
                        addProjectionParameterDefaultValue(count,"0.0");
2133
                        addProjectionParameterDefaultValue(count,"0.0");
2134
                        addProjectionParameterDefaultValue(count,"0.0");
2135

    
2136
                        String[] parameterMaxValue={"90.0"};
2137
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2138
                        addProjectionParameterMaxValue(count,"360.0");
2139
                        addProjectionParameterMaxValue(count,"100000000.0");
2140
                        addProjectionParameterMaxValue(count,"100000000.0");
2141

    
2142
                        String[] parameterMinValue={"-90.0"};
2143
                        projectionParameterMinValueList.add(count,parameterMinValue);
2144
                        addProjectionParameterMinValue(count,"-360.0");
2145
                        addProjectionParameterMinValue(count,"-100000000.0");
2146
                        addProjectionParameterMinValue(count,"-100000000.0");
2147

    
2148
                        String[] projectionAcronym={"ortho"};
2149
                        projectionAcronymList.add(count,projectionAcronym);
2150
                }
2151

    
2152
                count++;
2153
                {// Polar_Stereographic
2154
                        String[] projectionName={"Polar_Stereographic"};
2155
                        projectionNameList.add(count,projectionName);
2156
                        addProjectionName(count,"Polar Stereographic");
2157
                        addProjectionName(count,"Polar_Stereographic_(variant_A)");
2158
                        addProjectionName(count,"Polar_Stereographic_(variant_B)");
2159
                        addProjectionName(count,"9810");
2160
                        addProjectionName(count,"9829");
2161

    
2162
                        String[] parameterName={"latitude_of_origin"};
2163
                        projectionParameterList.add(count,parameterName);
2164
                        addProjectionParameter(count,"latitude_of_standard_parallel");
2165
                        addProjectionParameter(count,"central_meridian");
2166
                        addProjectionParameter(count,"scale_factor");
2167
                        addProjectionParameter(count,"false_easting");
2168
                        addProjectionParameter(count,"false_northing");
2169

    
2170
                        String[] parameterAcronym={"lat_0"};
2171
                        //lat_0=90 o lat_0=-90
2172
                        projectionParameterAcronymList.add(count,parameterAcronym);
2173
                        addProjectionParameterAcronymList(count,"lat_ts");
2174
                        addProjectionParameterAcronymList(count,"lon_0");
2175
                        addProjectionParameterAcronymList(count,"k_0");
2176
                        addProjectionParameterAcronymList(count,"x_0");
2177
                        addProjectionParameterAcronymList(count,"y_0");
2178

    
2179
                        String[] parameterDefaultValue={"90.0"};
2180
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2181
                        addProjectionParameterDefaultValue(count,"90.0");
2182
                        addProjectionParameterDefaultValue(count,"0.0");
2183
                        addProjectionParameterDefaultValue(count,"1.0");
2184
                        addProjectionParameterDefaultValue(count,"0.0");
2185
                        addProjectionParameterDefaultValue(count,"0.0");
2186

    
2187
                        String[] parameterMaxValue={"90.0"};
2188
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2189
                        addProjectionParameterMaxValue(count,"90.0");
2190
                        addProjectionParameterMaxValue(count,"360.0");
2191
                        addProjectionParameterMaxValue(count,"10.0");
2192
                        addProjectionParameterMaxValue(count,"100000000.0");
2193
                        addProjectionParameterMaxValue(count,"100000000.0");
2194

    
2195
                        String[] parameterMinValue={"-90.0"};
2196
                        projectionParameterMinValueList.add(count,parameterMinValue);
2197
                        addProjectionParameterMinValue(count,"-90.0");
2198
                        addProjectionParameterMinValue(count,"-360.0");
2199
                        addProjectionParameterMinValue(count,"0.0");
2200
                        addProjectionParameterMinValue(count,"-100000000.0");
2201
                        addProjectionParameterMinValue(count,"-100000000.0");
2202

    
2203
                        String[] projectionAcronym={"stere"};
2204
                        projectionAcronymList.add(count,projectionAcronym);
2205
                }
2206

    
2207
                count++;
2208
                {// Polyconic
2209
                        String[] projectionName={"Polyconic"};
2210
                        projectionNameList.add(count,projectionName);
2211
                        addProjectionName(count,"American_Polyconic");
2212
                        addProjectionName(count,"American Polyconic");
2213
                        addProjectionName(count,"9818");
2214

    
2215
                        String[] parameterName={"latitude_of_origin"};
2216
                        projectionParameterList.add(count,parameterName);
2217
                        addProjectionParameter(count,"central_meridian");
2218
                        addProjectionParameter(count,"false_easting");
2219
                        addProjectionParameter(count,"false_northing");
2220

    
2221
                        String[] parameterAcronym={"lat_0"};
2222
                        projectionParameterAcronymList.add(count,parameterAcronym);
2223
                        addProjectionParameterAcronymList(count,"lon_0");
2224
                        addProjectionParameterAcronymList(count,"x_0");
2225
                        addProjectionParameterAcronymList(count,"y_0");
2226

    
2227
                        String[] parameterDefaultValue={"0.0"};
2228
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2229
                        addProjectionParameterDefaultValue(count,"0.0");
2230
                        addProjectionParameterDefaultValue(count,"0.0");
2231
                        addProjectionParameterDefaultValue(count,"0.0");
2232

    
2233
                        String[] parameterMaxValue={"90.0"};
2234
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2235
                        addProjectionParameterMaxValue(count,"360.0");
2236
                        addProjectionParameterMaxValue(count,"100000000.0");
2237
                        addProjectionParameterMaxValue(count,"100000000.0");
2238

    
2239
                        String[] parameterMinValue={"-90.0"};
2240
                        projectionParameterMinValueList.add(count,parameterMinValue);
2241
                        addProjectionParameterMinValue(count,"-360.0");
2242
                        addProjectionParameterMinValue(count,"-100000000.0");
2243
                        addProjectionParameterMinValue(count,"-100000000.0");
2244

    
2245
                        String[] projectionAcronym={"poly"};
2246
                        projectionAcronymList.add(count,projectionAcronym);
2247
                }
2248

    
2249
                count++;
2250
                {// Quartic Authalic
2251
                        String[] projectionName={"Quartic_Authalic"};
2252
                        projectionNameList.add(count,projectionName);
2253
                        addProjectionName(count,"Quartic Authalic");
2254
                        addProjectionName(count,"Quartic-Authalic");
2255

    
2256
                        String[] parameterName={"central_meridian"};
2257
                        projectionParameterList.add(count,parameterName);
2258
                        addProjectionParameter(count,"false_easting");
2259
                        addProjectionParameter(count,"false_northing");
2260

    
2261
                        String[] parameterAcronym={"lon_0"};
2262
                        projectionParameterAcronymList.add(count,parameterAcronym);
2263
                        addProjectionParameterAcronymList(count,"x_0");
2264
                        addProjectionParameterAcronymList(count,"y_0");
2265

    
2266
                        String[] parameterDefaultValue={"0.0"};
2267
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2268
                        addProjectionParameterDefaultValue(count,"0.0");
2269
                        addProjectionParameterDefaultValue(count,"0.0");
2270

    
2271
                        String[] parameterMaxValue={"360.0"};
2272
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2273
                        addProjectionParameterMaxValue(count,"100000000.0");
2274
                        addProjectionParameterMaxValue(count,"100000000.0");
2275

    
2276
                        String[] parameterMinValue={"-360.0"};
2277
                        projectionParameterMinValueList.add(count,parameterMinValue);
2278
                        addProjectionParameterMinValue(count,"-100000000.0");
2279
                        addProjectionParameterMinValue(count,"-100000000.0");
2280

    
2281
                        String[] projectionAcronym={"qua_aut"};
2282
                        projectionAcronymList.add(count,projectionAcronym);
2283
                }
2284

    
2285
                count++;
2286
                {// Robinson
2287
                        String[] projectionName={"Robinson"};
2288
                        projectionNameList.add(count,projectionName);
2289
                        addProjectionName(count,"Orthophanic");
2290

    
2291
                        String[] parameterName={"longitude_of_center"};
2292
                        projectionParameterList.add(count,parameterName);
2293
                        addProjectionParameter(count,"false_easting");
2294
                        addProjectionParameter(count,"false_northing");
2295

    
2296
                        String[] parameterAcronym={"lon_0"};
2297
                        projectionParameterAcronymList.add(count,parameterAcronym);
2298
                        addProjectionParameterAcronymList(count,"x_0");
2299
                        addProjectionParameterAcronymList(count,"y_0");
2300

    
2301
                        String[] parameterDefaultValue={"0.0"};
2302
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2303
                        addProjectionParameterDefaultValue(count,"0.0");
2304
                        addProjectionParameterDefaultValue(count,"0.0");
2305

    
2306
                        String[] parameterMaxValue={"360.0"};
2307
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2308
                        addProjectionParameterMaxValue(count,"100000000.0");
2309
                        addProjectionParameterMaxValue(count,"100000000.0");
2310

    
2311
                        String[] parameterMinValue={"-360.0"};
2312
                        projectionParameterMinValueList.add(count,parameterMinValue);
2313
                        addProjectionParameterMinValue(count,"-100000000.0");
2314
                        addProjectionParameterMinValue(count,"-100000000.0");
2315

    
2316
                        String[] projectionAcronym={"robin"};
2317
                        projectionAcronymList.add(count,projectionAcronym);
2318
                }
2319

    
2320
                //         Rosenmund Oblique Mercator - No en EPSG
2321

    
2322
                count++;
2323
                {// Sinusoidal
2324
                        String[] projectionName={"Sinusoidal"};
2325
                        projectionNameList.add(count,projectionName);
2326
                        addProjectionName(count,"Sanson-Flamsteed");
2327
                        addProjectionName(count,"Sanson Flamsteed");
2328
                        addProjectionName(count,"Sanson_Flamsteed");
2329
                        addProjectionName(count,"Mercator equal area");
2330
                        addProjectionName(count,"Mercator_equal_area");
2331

    
2332
                        String[] parameterName={"longitude_of_center"};
2333
                        projectionParameterList.add(count,parameterName);
2334
                        addProjectionParameter(count,"false_easting");
2335
                        addProjectionParameter(count,"false_northing");
2336

    
2337
                        String[] parameterAcronym={"lon_0"};
2338
                        projectionParameterAcronymList.add(count,parameterAcronym);
2339
                        addProjectionParameterAcronymList(count,"x_0");
2340
                        addProjectionParameterAcronymList(count,"y_0");
2341

    
2342
                        String[] parameterDefaultValue={"0.0"};
2343
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2344
                        addProjectionParameterDefaultValue(count,"0.0");
2345
                        addProjectionParameterDefaultValue(count,"0.0");
2346

    
2347
                        String[] parameterMaxValue={"360.0"};
2348
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2349
                        addProjectionParameterMaxValue(count,"100000000.0");
2350
                        addProjectionParameterMaxValue(count,"100000000.0");
2351

    
2352
                        String[] parameterMinValue={"-360.0"};
2353
                        projectionParameterMinValueList.add(count,parameterMinValue);
2354
                        addProjectionParameterMinValue(count,"-100000000.0");
2355
                        addProjectionParameterMinValue(count,"-100000000.0");
2356

    
2357
                        String[] projectionAcronym={"sinu"};
2358
                        projectionAcronymList.add(count,projectionAcronym);
2359
                }
2360

    
2361
                count++;
2362
                {// Swiss_Oblique_Cylindrical
2363
                        String[] projectionName={"Swiss_Oblique_Cylindrical"};
2364
                        projectionNameList.add(count,projectionName);
2365
                        addProjectionName(count,"Swiss Oblique Cylindrical");
2366
                        addProjectionName(count,"Swiss Oblique Mercator");
2367
                        addProjectionName(count,"9814");
2368

    
2369
                        String[] parameterName={"latitude_of_origin"};
2370
                        projectionParameterList.add(count,parameterName);
2371
                        addProjectionParameter(count,"central_meridian");
2372
                        addProjectionParameter(count,"false_easting");
2373
                        addProjectionParameter(count,"false_northing");
2374

    
2375
                        String[] parameterAcronym={"lat_0"};
2376
                        projectionParameterAcronymList.add(count,parameterAcronym);
2377
                        addProjectionParameterAcronymList(count,"lon_0");
2378
                        addProjectionParameterAcronymList(count,"x_0");
2379
                        addProjectionParameterAcronymList(count,"y_0");
2380

    
2381
                        String[] parameterDefaultValue={"0.0"};
2382
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2383
                        addProjectionParameterDefaultValue(count,"0.0");
2384
                        addProjectionParameterDefaultValue(count,"0.0");
2385
                        addProjectionParameterDefaultValue(count,"0.0");
2386

    
2387
                        String[] parameterMaxValue={"90.0"};
2388
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2389
                        addProjectionParameterMaxValue(count,"360.0");
2390
                        addProjectionParameterMaxValue(count,"100000000.0");
2391
                        addProjectionParameterMaxValue(count,"100000000.0");
2392

    
2393
                        String[] parameterMinValue={"-90.0"};
2394
                        projectionParameterMinValueList.add(count,parameterMinValue);
2395
                        addProjectionParameterMinValue(count,"-360.0");
2396
                        addProjectionParameterMinValue(count,"-100000000.0");
2397
                        addProjectionParameterMinValue(count,"-100000000.0");
2398

    
2399
                        String[] projectionAcronym={"somerc"};
2400
                        projectionAcronymList.add(count,projectionAcronym);
2401
                }
2402

    
2403
                count++;
2404
                {// Stereographic
2405
                        String[] projectionName={"Stereographic"};
2406
                        projectionNameList.add(count,projectionName);
2407

    
2408
                        String[] parameterName={"latitude_of_origin"};
2409
                        projectionParameterList.add(count,parameterName);
2410
                        addProjectionParameter(count,"latitude_of_standard_parallel");
2411
                        addProjectionParameter(count,"central_meridian");
2412
                        addProjectionParameter(count,"scale_factor");
2413
                        addProjectionParameter(count,"false_easting");
2414
                        addProjectionParameter(count,"false_northing");
2415

    
2416
                        String[] parameterAcronym={"lat_0"};
2417
                        projectionParameterAcronymList.add(count,parameterAcronym);
2418
                        addProjectionParameterAcronymList(count,"lat_ts");
2419
                        addProjectionParameterAcronymList(count,"lon_0");
2420
                        addProjectionParameterAcronymList(count,"k");
2421
                        addProjectionParameterAcronymList(count,"x_0");
2422
                        addProjectionParameterAcronymList(count,"y_0");
2423

    
2424
                        String[] parameterDefaultValue={"0.0"};
2425
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2426
                        addProjectionParameterDefaultValue(count,"0.0");
2427
                        addProjectionParameterDefaultValue(count,"0.0");
2428
                        addProjectionParameterDefaultValue(count,"1.0");
2429
                        addProjectionParameterDefaultValue(count,"0.0");
2430
                        addProjectionParameterDefaultValue(count,"0.0");
2431

    
2432
                        String[] parameterMaxValue={"90.0"};
2433
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2434
                        addProjectionParameterMaxValue(count,"90.0");
2435
                        addProjectionParameterMaxValue(count,"360.0");
2436
                        addProjectionParameterMaxValue(count,"10.0");
2437
                        addProjectionParameterMaxValue(count,"100000000.0");
2438
                        addProjectionParameterMaxValue(count,"100000000.0");
2439

    
2440
                        String[] parameterMinValue={"-90.0"};
2441
                        projectionParameterMinValueList.add(count,parameterMinValue);
2442
                        addProjectionParameterMinValue(count,"-90.0");
2443
                        addProjectionParameterMinValue(count,"-360.0");
2444
                        addProjectionParameterMinValue(count,"0.0");
2445
                        addProjectionParameterMinValue(count,"-100000000.0");
2446
                        addProjectionParameterMinValue(count,"-100000000.0");
2447

    
2448
                        String[] projectionAcronym={"stere"};
2449
                        projectionAcronymList.add(count,projectionAcronym);
2450
                }
2451

    
2452
                count++;
2453
                {// Stereographic North Pole
2454
                        String[] projectionName={"Stereographic_North_Pole"};
2455
                        projectionNameList.add(count,projectionName);
2456

    
2457
                        String[] parameterName={"latitude_of_origin"};
2458
                        projectionParameterList.add(count,parameterName);
2459
                        addProjectionParameter(count,"standard_parallel_1");
2460
                        addProjectionParameter(count,"central_meridian");
2461
                        addProjectionParameter(count,"scale_factor");
2462
                        addProjectionParameter(count,"false_easting");
2463
                        addProjectionParameter(count,"false_northing");
2464

    
2465
                        String[] parameterAcronym={"lat_0"};
2466
                        projectionParameterAcronymList.add(count,parameterAcronym);
2467
                        addProjectionParameterAcronymList(count,"lat_ts");
2468
                        addProjectionParameterAcronymList(count,"lon_0");
2469
                        addProjectionParameterAcronymList(count,"k");
2470
                        addProjectionParameterAcronymList(count,"x_0");
2471
                        addProjectionParameterAcronymList(count,"y_0");
2472

    
2473
                        String[] parameterDefaultValue={"90.0"};
2474
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2475
                        addProjectionParameterDefaultValue(count,"0.0");
2476
                        addProjectionParameterDefaultValue(count,"0.0");
2477
                        addProjectionParameterDefaultValue(count,"1.0");
2478
                        addProjectionParameterDefaultValue(count,"0.0");
2479
                        addProjectionParameterDefaultValue(count,"0.0");
2480

    
2481
                        String[] parameterMaxValue={"90.0"};
2482
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2483
                        addProjectionParameterMaxValue(count,"90.0");
2484
                        addProjectionParameterMaxValue(count,"360.0");
2485
                        addProjectionParameterMaxValue(count,"10.0");
2486
                        addProjectionParameterMaxValue(count,"100000000.0");
2487
                        addProjectionParameterMaxValue(count,"100000000.0");
2488

    
2489
                        String[] parameterMinValue={"-90.0"};
2490
                        projectionParameterMinValueList.add(count,parameterMinValue);
2491
                        addProjectionParameterMinValue(count,"-90.0");
2492
                        addProjectionParameterMinValue(count,"-360.0");
2493
                        addProjectionParameterMinValue(count,"0.0");
2494
                        addProjectionParameterMinValue(count,"-100000000.0");
2495
                        addProjectionParameterMinValue(count,"-100000000.0");
2496

    
2497
                        String[] projectionAcronym={"stere"};
2498
                        projectionAcronymList.add(count,projectionAcronym);
2499
                }
2500

    
2501
                count++;
2502
                {// Stereographic South Pole
2503
                        String[] projectionName={"Stereographic_South_Pole"};
2504
                        projectionNameList.add(count,projectionName);
2505

    
2506
                        String[] parameterName={"latitude_of_origin"};
2507
                        projectionParameterList.add(count,parameterName);
2508
                        addProjectionParameter(count,"standard_parallel_1");
2509
                        addProjectionParameter(count,"central_meridian");
2510
                        addProjectionParameter(count,"scale_factor");
2511
                        addProjectionParameter(count,"false_easting");
2512
                        addProjectionParameter(count,"false_northing");
2513

    
2514
                        String[] parameterAcronym={"lat_0"};
2515
                        projectionParameterAcronymList.add(count,parameterAcronym);
2516
                        addProjectionParameterAcronymList(count,"lat_ts");
2517
                        addProjectionParameterAcronymList(count,"lon_0");
2518
                        addProjectionParameterAcronymList(count,"k");
2519
                        addProjectionParameterAcronymList(count,"x_0");
2520
                        addProjectionParameterAcronymList(count,"y_0");
2521

    
2522
                        String[] parameterDefaultValue={"-90.0"};
2523
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2524
                        addProjectionParameterDefaultValue(count,"0.0");
2525
                        addProjectionParameterDefaultValue(count,"0.0");
2526
                        addProjectionParameterDefaultValue(count,"1.0");
2527
                        addProjectionParameterDefaultValue(count,"0.0");
2528
                        addProjectionParameterDefaultValue(count,"0.0");
2529

    
2530
                        String[] parameterMaxValue={"90.0"};
2531
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2532
                        addProjectionParameterMaxValue(count,"90.0");
2533
                        addProjectionParameterMaxValue(count,"360.0");
2534
                        addProjectionParameterMaxValue(count,"10.0");
2535
                        addProjectionParameterMaxValue(count,"100000000.0");
2536
                        addProjectionParameterMaxValue(count,"100000000.0");
2537

    
2538
                        String[] parameterMinValue={"-90.0"};
2539
                        projectionParameterMinValueList.add(count,parameterMinValue);
2540
                        addProjectionParameterMinValue(count,"-90.0");
2541
                        addProjectionParameterMinValue(count,"-360.0");
2542
                        addProjectionParameterMinValue(count,"0.0");
2543
                        addProjectionParameterMinValue(count,"-100000000.0");
2544
                        addProjectionParameterMinValue(count,"-100000000.0");
2545

    
2546
                        String[] projectionAcronym={"stere"};
2547
                        projectionAcronymList.add(count,projectionAcronym);
2548
                }
2549

    
2550
                count++;
2551
                {// Transverse_Mercator
2552
                        String[] projectionName={"Transverse_Mercator"};
2553
                        projectionNameList.add(count,projectionName);
2554
                        addProjectionName(count,"Transverse Mercator");
2555
                        addProjectionName(count,"Gauss-Kruger");
2556
                        addProjectionName(count,"Gauss_Kruger");
2557
                        addProjectionName(count,"Gauss Conformal");
2558
                        addProjectionName(count,"Transverse Cylindrical Orthomorphic");
2559
                        addProjectionName(count,"9807");
2560

    
2561
                        String[] parameterName={"latitude_of_origin"};
2562
                        projectionParameterList.add(count,parameterName);
2563
                        addProjectionParameter(count,"central_meridian");
2564
                        addProjectionParameter(count,"scale_factor");
2565
                        addProjectionParameter(count,"false_easting");
2566
                        addProjectionParameter(count,"false_northing");
2567

    
2568
                        String[] parameterAcronym={"lat_0"};
2569
                        projectionParameterAcronymList.add(count,parameterAcronym);
2570
                        addProjectionParameterAcronymList(count,"lon_0");
2571
                        addProjectionParameterAcronymList(count,"k");
2572
                        addProjectionParameterAcronymList(count,"x_0");
2573
                        addProjectionParameterAcronymList(count,"y_0");
2574

    
2575
                        String[] parameterDefaultValue={"0.0"};
2576
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2577
                        addProjectionParameterDefaultValue(count,"0.0");
2578
                        addProjectionParameterDefaultValue(count,"1.0");
2579
                        addProjectionParameterDefaultValue(count,"0.0");
2580
                        addProjectionParameterDefaultValue(count,"0.0");
2581

    
2582
                        String[] parameterMaxValue={"90.0"};
2583
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2584
                        addProjectionParameterMaxValue(count,"360.0");
2585
                        addProjectionParameterMaxValue(count,"10.0");
2586
                        addProjectionParameterMaxValue(count,"100000000.0");
2587
                        addProjectionParameterMaxValue(count,"100000000.0");
2588

    
2589
                        String[] parameterMinValue={"-90.0"};
2590
                        projectionParameterMinValueList.add(count,parameterMinValue);
2591
                        addProjectionParameterMinValue(count,"-360.0");
2592
                        addProjectionParameterMinValue(count,"0.0");
2593
                        addProjectionParameterMinValue(count,"-100000000.0");
2594
                        addProjectionParameterMinValue(count,"-100000000.0");
2595

    
2596
                        String[] projectionAcronym={"tmerc"};
2597
                        projectionAcronymList.add(count,projectionAcronym);
2598
                }
2599

    
2600
                /*
2601
                count++;
2602
                {// Tunisia_Mining_Grid (not implemented in Proj 4.8.0)
2603
                        String[] projectionName={"Tunisia_Mining_Grid"};
2604
                        projectionNameList.add(count,projectionName);
2605
                        addProjectionName(count,"Tunisia Mining Grid");
2606
                        addProjectionName(count,"9816");
2607

2608
                        String[] parameterName={"latitude_of_origin"};
2609
                        projectionParameterList.add(count,parameterName);
2610
                        addProjectionParameter(count,"central_meridian");
2611
                        addProjectionParameter(count,"false_easting");
2612
                        addProjectionParameter(count,"false_northing");
2613

2614
                        String[] parameterAcronym={"lat_0"};
2615
                        projectionParameterAcronymList.add(count,parameterAcronym);
2616
                        addProjectionParameterAcronymList(count,"lon_0");
2617
                        addProjectionParameterAcronymList(count,"x_0");
2618
                        addProjectionParameterAcronymList(count,"y_0");
2619

2620
                        String[] parameterDefaultValue={"0.0"};
2621
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2622
                        addProjectionParameterDefaultValue(count,"0.0");
2623
                        addProjectionParameterDefaultValue(count,"0.0");
2624
                        addProjectionParameterDefaultValue(count,"0.0");
2625

2626
                        String[] parameterMaxValue={"90.0"};
2627
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2628
                        addProjectionParameterMaxValue(count,"360.0");
2629
                        addProjectionParameterMaxValue(count,"100000000.0");
2630
                        addProjectionParameterMaxValue(count,"100000000.0");
2631

2632
                        String[] parameterMinValue={"-90.0"};
2633
                        projectionParameterMinValueList.add(count,parameterMinValue);
2634
                        addProjectionParameterMinValue(count,"-360.0");
2635
                        addProjectionParameterMinValue(count,"-100000000.0");
2636
                        addProjectionParameterMinValue(count,"-100000000.0");
2637

2638
                        String[] projectionAcronym={"cass"};
2639
                        projectionAcronymList.add(count,projectionAcronym);
2640
                }
2641
                */
2642

    
2643
                count++;
2644
                {// VanDerGrinten
2645
                        String[] projectionName={"VanDerGrinten"};
2646
                        projectionNameList.add(count,projectionName);
2647
                        addProjectionName(count,"VanDerGrinten I");
2648
                        addProjectionName(count,"VanderGrinten");
2649
                        addProjectionName(count,"Van_der_Grinten_I");
2650

    
2651
                        String[] parameterName={"central_meridian"};
2652
                        projectionParameterList.add(count,parameterName);
2653
                        addProjectionParameter(count,"false_easting");
2654
                        addProjectionParameter(count,"false_northing");
2655

    
2656
                        String[] parameterAcronym={"lon_0"};
2657
                        projectionParameterAcronymList.add(count,parameterAcronym);
2658
                        addProjectionParameterAcronymList(count,"x_0");
2659
                        addProjectionParameterAcronymList(count,"y_0");
2660

    
2661
                        String[] parameterDefaultValue={"0.0"};
2662
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2663
                        addProjectionParameterDefaultValue(count,"0.0");
2664
                        addProjectionParameterDefaultValue(count,"0.0");
2665

    
2666
                        String[] parameterMaxValue={"360.0"};
2667
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2668
                        addProjectionParameterMaxValue(count,"100000000.0");
2669
                        addProjectionParameterMaxValue(count,"100000000.0");
2670

    
2671
                        String[] parameterMinValue={"-360.0"};
2672
                        projectionParameterMinValueList.add(count,parameterMinValue);
2673
                        addProjectionParameterMinValue(count,"-100000000.0");
2674
                        addProjectionParameterMinValue(count,"-100000000.0");
2675

    
2676
                        String[] projectionAcronym={"vandg"};
2677
                        projectionAcronymList.add(count,projectionAcronym);
2678
                }
2679

    
2680
                count++;
2681
                {// Winkel_I
2682
                        String[] projectionName={"Winkel_I"};
2683
                        projectionNameList.add(count,projectionName);
2684
                        addProjectionName(count,"Winkel I");
2685
                        addProjectionName(count,"Winkel-I");
2686

    
2687
                        String[] parameterName={"central_meridian"};
2688
                        projectionParameterList.add(count,parameterName);
2689
                        addProjectionParameter(count,"standard_parallel_1");
2690
                        addProjectionParameter(count,"false_easting");
2691
                        addProjectionParameter(count,"false_northing");
2692

    
2693
                        String[] parameterAcronym={"lon_0"};
2694
                        projectionParameterAcronymList.add(count,parameterAcronym);
2695
                        addProjectionParameterAcronymList(count,"lat_ts");
2696
                        addProjectionParameterAcronymList(count,"x_0");
2697
                        addProjectionParameterAcronymList(count,"y_0");
2698

    
2699
                        String[] parameterDefaultValue={"0.0"};
2700
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2701
                        addProjectionParameterDefaultValue(count,"0.0");
2702
                        addProjectionParameterDefaultValue(count,"0.0");
2703
                        addProjectionParameterDefaultValue(count,"0.0");
2704

    
2705
                        String[] parameterMaxValue={"360.0"};
2706
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2707
                        addProjectionParameterMaxValue(count,"90.0");
2708
                        addProjectionParameterMaxValue(count,"100000000.0");
2709
                        addProjectionParameterMaxValue(count,"100000000.0");
2710

    
2711
                        String[] parameterMinValue={"-360.0"};
2712
                        projectionParameterMinValueList.add(count,parameterMinValue);
2713
                        addProjectionParameterMinValue(count,"-90.0");
2714
                        addProjectionParameterMinValue(count,"-100000000.0");
2715
                        addProjectionParameterMinValue(count,"-100000000.0");
2716

    
2717
                        String[] projectionAcronym={"wink1"};
2718
                        projectionAcronymList.add(count,projectionAcronym);
2719
                }
2720

    
2721
                count++;
2722
                {// Winkel_II
2723
                        String[] projectionName={"Winkel_II"};
2724
                        projectionNameList.add(count,projectionName);
2725
                        addProjectionName(count,"Winkel II");
2726

    
2727
                        String[] parameterName={"central_meridian"};
2728
                        projectionParameterList.add(count,parameterName);
2729
                        addProjectionParameter(count,"standard_parallel_1");
2730
                        addProjectionParameter(count,"false_easting");
2731
                        addProjectionParameter(count,"false_northing");
2732

    
2733
                        String[] parameterAcronym={"lon_0"};
2734
                        projectionParameterAcronymList.add(count,parameterAcronym);
2735
                        addProjectionParameterAcronymList(count,"lat_ts");
2736
                        addProjectionParameterAcronymList(count,"x_0");
2737
                        addProjectionParameterAcronymList(count,"y_0");
2738

    
2739
                        String[] parameterDefaultValue={"0.0"};
2740
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2741
                        addProjectionParameterDefaultValue(count,"0.0");
2742
                        addProjectionParameterDefaultValue(count,"0.0");
2743
                        addProjectionParameterDefaultValue(count,"0.0");
2744

    
2745
                        String[] parameterMaxValue={"360.0"};
2746
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2747
                        addProjectionParameterMaxValue(count,"90.0");
2748
                        addProjectionParameterMaxValue(count,"100000000.0");
2749
                        addProjectionParameterMaxValue(count,"100000000.0");
2750

    
2751
                        String[] parameterMinValue={"-360.0"};
2752
                        projectionParameterMinValueList.add(count,parameterMinValue);
2753
                        addProjectionParameterMinValue(count,"-90.0");
2754
                        addProjectionParameterMinValue(count,"-100000000.0");
2755
                        addProjectionParameterMinValue(count,"-100000000.0");
2756

    
2757
                        String[] projectionAcronym={"wink2"};
2758
                        projectionAcronymList.add(count,projectionAcronym);
2759
                }
2760

    
2761
                count++;
2762
                {// Winkel Tripel
2763
                        String[] projectionName={"Winkel_Tripel"};
2764
                        projectionNameList.add(count,projectionName);
2765
                        addProjectionName(count,"Winkel-Tripel");
2766
                        addProjectionName(count,"Winkel Tripel");
2767

    
2768
                        String[] parameterName={"central_meridian"};
2769
                        projectionParameterList.add(count,parameterName);
2770
                        addProjectionParameter(count,"standard_parallel_1");
2771
                        addProjectionParameter(count,"false_easting");
2772
                        addProjectionParameter(count,"false_northing");
2773

    
2774
                        String[] parameterAcronym={"lon_0"};
2775
                        projectionParameterAcronymList.add(count,parameterAcronym);
2776
                        addProjectionParameterAcronymList(count,"lat_ts");
2777
                        addProjectionParameterAcronymList(count,"x_0");
2778
                        addProjectionParameterAcronymList(count,"y_0");
2779

    
2780
                        String[] parameterDefaultValue={"0.0"};
2781
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2782
                        addProjectionParameterDefaultValue(count,"0.0");
2783
                        addProjectionParameterDefaultValue(count,"0.0");
2784
                        addProjectionParameterDefaultValue(count,"0.0");
2785

    
2786
                        String[] parameterMaxValue={"360.0"};
2787
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2788
                        addProjectionParameterMaxValue(count,"90.0");
2789
                        addProjectionParameterMaxValue(count,"100000000.0");
2790
                        addProjectionParameterMaxValue(count,"100000000.0");
2791

    
2792
                        String[] parameterMinValue={"-360.0"};
2793
                        projectionParameterMinValueList.add(count,parameterMinValue);
2794
                        addProjectionParameterMinValue(count,"-90.0");
2795
                        addProjectionParameterMinValue(count,"-100000000.0");
2796
                        addProjectionParameterMinValue(count,"-100000000.0");
2797

    
2798
                        String[] projectionAcronym={"wintri"};
2799
                        projectionAcronymList.add(count,projectionAcronym);
2800
                }
2801
        
2802
                count++;
2803
                {// Popular_Visualisation_Pseudo_Mercator (based on Mercator_1SP)
2804
                        String[] projectionName={"Popular_Visualisation_Pseudo_Mercator"};
2805
                        projectionNameList.add(count,projectionName);
2806

    
2807
                        String[] parameterName={"central_meridian"};
2808
                        projectionParameterList.add(count,parameterName);
2809
                        addProjectionParameter(count,"latitude_of_origin");  // o latitude_origin
2810
                        addProjectionParameter(count,"scale_factor");
2811
                        addProjectionParameter(count,"false_easting");
2812
                        addProjectionParameter(count,"false_northing");
2813
                        addProjectionParameter(count,"semi_major");
2814
                        addProjectionParameter(count,"semi_minor");
2815

    
2816
                        String[] parameterAcronym={"lon_0"};
2817
                        projectionParameterAcronymList.add(count,parameterAcronym);
2818
                        addProjectionParameterAcronymList(count,"lat_ts");
2819
                        addProjectionParameterAcronymList(count,"k");
2820
                        addProjectionParameterAcronymList(count,"x_0");
2821
                        addProjectionParameterAcronymList(count,"y_0");
2822
                        addProjectionParameterAcronymList(count,"a");
2823
                        addProjectionParameterAcronymList(count,"b");
2824

    
2825
                        String[] parameterDefaultValue={"0.0"};
2826
                        projectionParameterDefaultValueList.add(count,parameterDefaultValue);
2827
                        addProjectionParameterDefaultValue(count,"0.0");
2828
                        addProjectionParameterDefaultValue(count,"1.0");
2829
                        addProjectionParameterDefaultValue(count,"0.0");
2830
                        addProjectionParameterDefaultValue(count,"0.0");
2831
                        addProjectionParameterDefaultValue(count,"6378137.0");
2832
                        addProjectionParameterDefaultValue(count,"6378137.0");
2833

    
2834
                        String[] parameterMaxValue={"360.0"};
2835
                        projectionParameterMaxValueList.add(count,parameterMaxValue);
2836
                        addProjectionParameterMaxValue(count,"90.0");
2837
                        addProjectionParameterMaxValue(count,"10.0");
2838
                        addProjectionParameterMaxValue(count,"100000000.0");
2839
                        addProjectionParameterMaxValue(count,"100000000.0");
2840
                        addProjectionParameterMaxValue(count,"6378137.0");
2841
                        addProjectionParameterMaxValue(count,"6378137.0");
2842

    
2843
                        String[] parameterMinValue={"-360.0"};
2844
                        projectionParameterMinValueList.add(count,parameterMinValue);
2845
                        addProjectionParameterMinValue(count,"-90.0");
2846
                        addProjectionParameterMinValue(count,"0.0");
2847
                        addProjectionParameterMinValue(count,"-100000000.0");
2848
                        addProjectionParameterMinValue(count,"-100000000.0");
2849
                        addProjectionParameterMinValue(count,"6378137.0");
2850
                        addProjectionParameterMinValue(count,"6378137.0");
2851

    
2852
                        String[] projectionAcronym={"merc"};
2853
                        projectionAcronymList.add(count,projectionAcronym);
2854
                }
2855

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

    
3195
        public String exportToProj4(Crs crs) throws CrsException
3196
        {
3197
                String strProj4="+proj=";
3198
                String strDatumName="";
3199
                String strDatumCode="";
3200
                String strProj4ToMeter="";
3201
                String strProj4Datum="";
3202
                String[] primeMeridian=crs.getCrsWkt().getPrimen();
3203
                String primeMeridianName=primeMeridian[0];
3204
                double primeMeridianValue=Double.parseDouble(primeMeridian[1]); // -> hacer el cambio de unidades
3205
                String[] strPrimeMeridianProj4=primeMeridianToProj4(primeMeridianName,primeMeridianValue);
3206
                primeMeridianValue=Double.parseDouble(strPrimeMeridianProj4[1]);
3207
                primeMeridianName=strPrimeMeridianProj4[0];
3208
                String primeMeridianAcronym=strPrimeMeridianProj4[2]; // Puede ser cadena vacia->Analizar
3209

    
3210
                // Extracci?n del c?digo de Datum
3211
                String codDatum="0";
3212
                strDatumName=crs.getCrsWkt().getDatumName();
3213
        int intCodDatum=0;//Integer.parseInt(codDatum);
3214
        strProj4Datum=datumToProj4(strDatumName,intCodDatum);
3215
        
3216

    
3217

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

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

    
3801
                }
3802
                else if (crs instanceof DefaultGeographicCRS) {
3803
                        DefaultGeographicCRS crsGeographic = (DefaultGeographicCRS) crs;
3804
                        primeMeridian = Primem(((DefaultGeodeticDatum) crsGeographic.getDatum()).getPrimeMeridian());
3805
                        spheroid = Spheroid(((DefaultGeodeticDatum) crsGeographic.getDatum()).getEllipsoid());
3806
                        elipName=spheroid[0];
3807
                        a=Double.parseDouble(spheroid[1]);
3808
                        inv_f=Double.parseDouble(spheroid[2]);
3809
                        Ellipsoid ellip = ((DefaultGeodeticDatum) crsGeographic.getDatum()).getEllipsoid();
3810
            Unit unit = ellip.getAxisUnit();
3811
            String[] i_un = unit.toString().split("[*]");
3812
                if (i_un.length>1)
3813
                {
3814
                        try{
3815
                                a=a*Double.parseDouble(i_un[1].replaceAll("]", ""));
3816
                                //factor_to_meter=Double.parseDouble(un[1].replaceAll("]", ""));
3817
                        }
3818
                        catch(java.lang.NumberFormatException t){}
3819
                }
3820
                else if (i_un[0].equals("m"))
3821
                {
3822
                        try{
3823
                                //factor_to_meter=Double.parseDouble(un[0]);
3824
                        }
3825
                        catch(java.lang.NumberFormatException t){}
3826
                } else if (i_un[0].equals("ft")) {
3827
                        /**
3828
                         * Cuando viene en otro formato, coger el valor de la unidad
3829
                         * correspondiente...
3830
                         */
3831
                        //Caso de los pies
3832
                        //factor_to_meter = 0.3048;
3833
                }
3834

    
3835
            // Extracci?n del c?digo de Datum
3836
                        String codDatum="0";
3837
                        String[] val=((DefaultGeographicCRS)crs).getDatum().getName().toString().split(":");
3838
                        if (val.length<2)
3839
                                strDatumName=val[0];
3840
                        else
3841
                                strDatumName=val[1];
3842
                for (Iterator iter =((DefaultGeographicCRS)crs).getDatum().getIdentifiers().iterator();iter.hasNext();) {
3843
                    Identifier element = (Identifier) iter.next();
3844
                    codDatum = element.getCode();          
3845
                }
3846
                int intCodDatum=Integer.parseInt(codDatum);
3847
                strProj4Datum=datumToProj4(strDatumName,intCodDatum);
3848
                }
3849
                else {
3850
                        throw(new CrsException(new Exception("the crs is not a geographic nor projected CRS")));
3851
                }
3852
                
3853
                String primeMeridianName=primeMeridian[0];
3854
                double primeMeridianValue = -1;
3855
                if (primeMeridian[1] == null) {
3856
                        throw(new CrsException(new Exception("Null value not allowed for prime meridiam parameters")));
3857
                } else {
3858
                        primeMeridianValue=Double.parseDouble(primeMeridian[1]); // -> hacer el cambio de unidades
3859
                }                
3860
                String[] strPrimeMeridianProj4=primeMeridianToProj4(primeMeridianName,primeMeridianValue);
3861
                primeMeridianValue=Double.parseDouble(strPrimeMeridianProj4[1]);
3862
                primeMeridianName=strPrimeMeridianProj4[0];
3863
                String primeMeridianAcronym=strPrimeMeridianProj4[2]; // Puede ser cadena vacia->Analizar
3864

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

    
4187
                        for(int i=0;i<parameterNames.size();i++)
4188
                        {
4189
                                boolean control=true;
4190
                                String parameterName=((String)parameterNames.get(i)).trim();
4191
                                String parameterAcronym=((String)parameterAcronyms.get(i)).trim();
4192
                                String strParameterValue=((String)parameterValues.get(i)).trim();
4193
                                if(isMerc)
4194
                                {
4195
                                        if(parameterName.equalsIgnoreCase("latitude_of_origin")
4196
                                                        ||parameterName.equalsIgnoreCase("standard_parallel_1")
4197
                                                        ||parameterName.equalsIgnoreCase("latitude_of_center"))
4198
                                        {
4199
                                                if(!exists_lo)
4200
                                                        control=false;
4201
                                        }
4202
                                        if(parameterName.equalsIgnoreCase("scale_factor"))
4203
                                        {
4204
                                                if(!exists_sf)
4205
                                                        control=false;
4206
                                        }
4207
                                }
4208
                                if(isSterePolar)
4209
                                {
4210
                                        String gtParameterAcronymn=((String)parameterAcronyms.get(i)).trim();
4211
                                        if(gtParameterAcronymn.equalsIgnoreCase("lat_0")) // Esto resuelve el caso del EPSG:3031
4212
                                        {
4213
                                                if(exists_stdPar){
4214
                                                        double parameterValue=Double.parseDouble(strParameterValue);
4215
                                                        if((parameterValue>0)&&(value_stdPar<0)){
4216
                                                                strParameterValue="-90.0";
4217
                                                        }
4218
                                                        if((parameterValue<0)&&(value_stdPar>0)){
4219
                                                                strParameterValue="90.0";
4220
                                                        }
4221
                                                }
4222
                                        }
4223
                                        if(gtParameterAcronymn.equalsIgnoreCase("lat_ts"))
4224
                                        {
4225
                                                if(exists_sf)
4226
                                                        control=false;
4227
                                        }
4228
                                        if(parameterName.equalsIgnoreCase("scale_factor"))
4229
                                        {
4230
                                                if(!exists_sf)
4231
                                                        control=false;
4232
                                        }
4233
                                }
4234
                                if(isSomerc)
4235
                                {
4236
                                        if(parameterName.equals("rectified_grid_angle")
4237
                                                        ||parameterName.equals("azimuth"))
4238
                                                control=false;
4239
                                        if(parameterAcronym.equals("lonc"))
4240
                                                parameterAcronym="lon_0";
4241
                                        if(parameterAcronym.equals("k"))
4242
                                                parameterAcronym="k_0";
4243
                                }
4244
                                if(isOmerc)
4245
                                {
4246
                                        if(parameterName.equals("rectified_grid_angle"))
4247
                                        {
4248
                                                if(existsAlpha)
4249
                                                        control=false;
4250
                                                else
4251
                                                        parameterAcronym="alpha";
4252
                                        }
4253
                                }
4254
                                if(parameterAcronym.equals("lon_0")
4255
                                                ||parameterAcronym.equals("lonc"))
4256
                                {
4257
                                        double parameterValue=Double.parseDouble(strParameterValue);
4258
                                        if(!projectionAcronym[0].equalsIgnoreCase("krovak"))
4259
                                        {
4260
                                                parameterValue=parameterValue-primeMeridianValue;
4261
                                        }
4262
                                        strParameterValue=Double.toString(parameterValue);
4263
                                }
4264
                                if(control)
4265
                                        strProj4=strProj4+"+"+parameterAcronym+"="+strParameterValue+" ";
4266
                                if(isLcc1sp)
4267
                                {
4268
                                        if(parameterAcronym.equals("lat_0"))
4269
                                        {
4270
                                                strProj4=strProj4+"+lat_1="+strParameterValue+" ";
4271
                                                strProj4=strProj4+"+lat_2="+strParameterValue+" ";
4272
                                        }
4273
                                }
4274
                        }
4275
                        if(isLaborde)
4276
                                strProj4+="+azi=18.9 +lat_0=-18.9 +lon_0=44.1 +k_0=0.9995 +x_0=400000 +y_0=800000 +ellps=intl ";
4277
                        strProj4+=strExtraProj4;
4278
                        //getProj4ProjectionName();
4279
                }
4280
                
4281
                // Que pasa si no hay elipsoide? -> OGR por defecto pone WGS84
4282
                String strEllipseAcronym=ellipseToProj4(a,inv_f);
4283
                String strEllipse="";
4284
                if(strEllipseAcronym.equals(""))
4285
                {
4286
                        if (!Double.isInfinite(inv_f))
4287
                        {
4288
                                if(inv_f>0.0)
4289
                                        strEllipse="+a="+a+" +rf="+inv_f+" ";
4290
                                else
4291
                                        strEllipse="+R="+a+" ";
4292
                        }
4293
                        /*
4294
                        else
4295
                                strEllipse="+R="+a+" ";
4296
                        */
4297
                }
4298
                else
4299
                {
4300
                        strEllipse="+ellps="+strEllipseAcronym+" ";
4301
                }
4302
                strProj4+=strEllipse;
4303
                //System.out.println("Elipsoide["+elipName+"]=("+a+","+inv_f+")");
4304
                strProj4+=primeMeridianAcronym;
4305
                if(!strProj4Datum.equals(""))
4306
                        strProj4+=strProj4Datum;
4307
                if(!strProj4ToMeter.equals(""))
4308
                        strProj4+=strProj4ToMeter;
4309
                String strWkt=crs.toWKT();
4310
                
4311
                strProj4 = strProj4.replace(".0 ", " ");
4312
                //System.out.println("- Cadena proj4: "+strProj4);
4313
                return strProj4;                
4314
        }
4315

    
4316
        private String[] primeMeridianToProj4(String pmName,double pmValue) throws CrsException
4317
        {
4318
            String[] primeMeridian=new String[3];
4319
                String pszPM="";
4320
                String acronym="";
4321
            double dfFromGreenwich = 0.0;
4322
            double tolerance=0.002/3600.0;
4323
            int    nPMCode = -1;
4324

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

    
4524
        private String ellipseToProj4(double dfSemiMajor, double dfInvFlattening)
4525
        {
4526
                double yo=Math.abs(4.5);
4527
                String pszPROJ4Ellipse="";
4528
            if( Math.abs(dfSemiMajor-6378249.145) < 0.01
4529
                && Math.abs(dfInvFlattening-293.465) < 0.0001 )
4530
            {
4531
                pszPROJ4Ellipse = "clrk80";     /* Clark 1880 */
4532
            }
4533
            else if( Math.abs(dfSemiMajor-6378245.0) < 0.01
4534
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
4535
            {
4536
                pszPROJ4Ellipse = "krass";      /* Krassovsky */
4537
            }
4538
            else if( Math.abs(dfSemiMajor-6378388.0) < 0.01
4539
                     && Math.abs(dfInvFlattening-297.0) < 0.0001 )
4540
            {
4541
                pszPROJ4Ellipse = "intl";       /* International 1924 */
4542
            }
4543
            else if( Math.abs(dfSemiMajor-6378160.0) < 0.01
4544
                     && Math.abs(dfInvFlattening-298.25) < 0.0001 )
4545
            {
4546
                pszPROJ4Ellipse = "aust_SA";    /* Australian */
4547
            }
4548
            else if( Math.abs(dfSemiMajor-6377397.155) < 0.01
4549
                     && Math.abs(dfInvFlattening-299.1528128) < 0.0001 )
4550
            {
4551
                pszPROJ4Ellipse = "bessel";     /* Bessel 1841 */
4552
            }
4553
            else if( Math.abs(dfSemiMajor-6377483.865) < 0.01
4554
                     && Math.abs(dfInvFlattening-299.1528128) < 0.0001 )
4555
            {
4556
                pszPROJ4Ellipse = "bess_nam";   /* Bessel 1841 (Namibia / Schwarzeck)*/
4557
            }
4558
            else if( Math.abs(dfSemiMajor-6378160.0) < 0.01
4559
                     && Math.abs(dfInvFlattening-298.247167427) < 0.0001 )
4560
            {
4561
                pszPROJ4Ellipse = "GRS67";      /* GRS 1967 */
4562
            }
4563
            else if( Math.abs(dfSemiMajor-6378137) < 0.01
4564
                     && Math.abs(dfInvFlattening-298.257222101) < 0.000001 )
4565
            {
4566
                pszPROJ4Ellipse = "GRS80";      /* GRS 1980 */
4567
            }
4568
            else if( Math.abs(dfSemiMajor-6378206.4) < 0.01
4569
                     && Math.abs(dfInvFlattening-294.9786982) < 0.0001 )
4570
            {
4571
                pszPROJ4Ellipse = "clrk66";     /* Clarke 1866 */
4572
            }
4573
            else if( Math.abs(dfSemiMajor-6378206.4) < 0.01
4574
                     && Math.abs(dfInvFlattening-294.9786982) < 0.0001 )
4575
            {
4576
                pszPROJ4Ellipse = "mod_airy";   /* Modified Airy */
4577
            }
4578
            else if( Math.abs(dfSemiMajor-6377563.396) < 0.01
4579
                     && Math.abs(dfInvFlattening-299.3249646) < 0.0001 )
4580
            {
4581
                pszPROJ4Ellipse = "airy";       /* Modified Airy */
4582
            }
4583
            else if( Math.abs(dfSemiMajor-6378200) < 0.01
4584
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
4585
            {
4586
                pszPROJ4Ellipse = "helmert";    /* Helmert 1906 */
4587
            }
4588
            else if( Math.abs(dfSemiMajor-6378155) < 0.01
4589
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
4590
            {
4591
                pszPROJ4Ellipse = "fschr60m";   /* Modified Fischer 1960 */
4592
            }
4593
            else if( Math.abs(dfSemiMajor-6377298.556) < 0.01
4594
                     && Math.abs(dfInvFlattening-300.8017) < 0.0001 )
4595
            {
4596
                pszPROJ4Ellipse = "evrstSS";    /* Everest (Sabah & Sarawak) */
4597
            }
4598
            else if( Math.abs(dfSemiMajor-6378165.0) < 0.01
4599
                     && Math.abs(dfInvFlattening-298.3) < 0.0001 )
4600
            {
4601
                pszPROJ4Ellipse = "WGS60";      
4602
            }
4603
            else if( Math.abs(dfSemiMajor-6378145.0) < 0.01
4604
                     && Math.abs(dfInvFlattening-298.25) < 0.0001 )
4605
            {
4606
                pszPROJ4Ellipse = "WGS66";      
4607
            }
4608
            else if( Math.abs(dfSemiMajor-6378135.0) < 0.01
4609
                     && Math.abs(dfInvFlattening-298.26) < 0.0001 )
4610
            {
4611
                pszPROJ4Ellipse = "WGS72";      
4612
            }
4613
            else if( Math.abs(dfSemiMajor-6378137.0) < 0.01
4614
                     && Math.abs(dfInvFlattening-298.257223563) < 0.000001 )
4615
            {
4616
                pszPROJ4Ellipse = "WGS84";
4617
            }
4618
            else if( Math.abs(dfSemiMajor-6378137.0) < 0.01
4619
                     && Double.isInfinite(dfInvFlattening) )
4620
            {
4621
                pszPROJ4Ellipse = "";                        /* Popular Visualisation Sphere */
4622
            }
4623
            /*
4624
            else if( EQUAL(pszDatum,"North_American_Datum_1927") )
4625
            {
4626
//                pszPROJ4Ellipse = "clrk66:+datum=nad27"; // NAD 27 
4627
                pszPROJ4Ellipse = "clrk66";
4628
            }
4629
            else if( EQUAL(pszDatum,"North_American_Datum_1983") )
4630
            {
4631
//                pszPROJ4Ellipse = "GRS80:+datum=nad83";       // NAD 83 
4632
                pszPROJ4Ellipse = "GRS80";
4633
            }
4634
            */
4635
            return pszPROJ4Ellipse;
4636
        }
4637

    
4638
        private String datumToProj4(String datumName,int epsgCode)
4639
        {
4640
            String datumProj4="";
4641
            String SRS_DN_NAD27="North_American_Datum_1927";
4642
            String SRS_DN_NAD83="North_American_Datum_1983";
4643
            String SRS_DN_WGS72="WGS_1972";
4644
            String SRS_DN_WGS84="WGS_1984";
4645
            if(datumName.equals(""))
4646
                    datumProj4="";
4647
                else if(datumName.equalsIgnoreCase(SRS_DN_NAD27) || epsgCode == 6267 )
4648
                        datumProj4 = "+datum=NAD27 ";
4649

    
4650
            else if(datumName.equalsIgnoreCase(SRS_DN_NAD83) || epsgCode == 6269 )
4651
                    datumProj4 = "+datum=NAD83 ";
4652

    
4653
            else if(datumName.equalsIgnoreCase(SRS_DN_WGS84) || epsgCode == 6326 )
4654
                    datumProj4 = "+datum=WGS84 ";
4655

    
4656
            else if( epsgCode == 6314 )
4657
                    datumProj4 = "+datum=potsdam ";
4658

    
4659
            else if( epsgCode == 6272 )
4660
                    datumProj4 = "+datum=nzgd49 ";
4661
                return datumProj4;
4662
        }
4663
        // Casos especiales
4664
        // - MERCATOR_1SP
4665
        // - HOTINE
4666
        // - MILLER
4667
        // - Polar_Stereographic
4668
        // - Polar_Stereographic
4669
        // - VanDerGrinten
4670
        // - Transverse Mercator
4671
        // - Cuando el meridiano origen no es 0 se pone pm=madrid y lon_0=
4672
        // +datum
4673
        
4674
        // Funciones privadas necesarias para el proceso
4675
        
4676
        private String getName(Identifier name) {
4677
                String[] correctName = name.toString().split(":");
4678
                if (correctName.length<2) 
4679
                        return correctName[0];
4680
                
4681
                else
4682
                        return correctName[1];
4683
        }
4684
        
4685
        private String[] Spheroid (Ellipsoid ellips) {
4686
                String[] spheroid = new String[3];
4687
                Unit u = ellips.getAxisUnit();
4688
                double semi_major = convert( ellips.getSemiMajorAxis(), u.toString());
4689
                //double inv_f = convert( ellips.getInverseFlattening(), u.toString());
4690
                double inv_f = ellips.getInverseFlattening();
4691
                String[] val =        ellips.getName().toString().split(":");
4692
                if (val.length<2)
4693
                        spheroid[0] = ellips.getName().toString().split(":")[0];
4694
                else
4695
                        spheroid[0] = ellips.getName().toString().split(":")[1];
4696
                spheroid[1] = String.valueOf(semi_major);
4697
                spheroid[2] = String.valueOf(inv_f);
4698
                return spheroid;
4699
        }
4700
        
4701
        private String[] Primem (PrimeMeridian prim) {
4702
                String[] primem = new String[2];
4703
                DefaultPrimeMeridian pm = (DefaultPrimeMeridian) prim;
4704
                Unit u = pm.getAngularUnit();
4705
                double value = convert( pm.getGreenwichLongitude(), u.toString());
4706
                String[] val = pm.getName().toString().split(":");
4707
                if (val.length<2)
4708
                        primem[0] = pm.getName().toString().split(":")[0];
4709
                else
4710
                        primem[0] = pm.getName().toString().split(":")[1];
4711
                primem[1] = String.valueOf(value);
4712
                return primem;
4713
        }
4714
        
4715
        public double convert(double value, String measure) throws ConversionException {
4716
                if (measure.equals("D.MS")) {                
4717
                        value *= this.divider;
4718
                int deg,min;
4719
                deg = (int) (value/10000); value -= 10000*deg;
4720
                min = (int) (value/  100); value -=   100*min;
4721
                if (min<=-60 || min>=60) {  // Accepts NaN
4722
                    if (Math.abs(Math.abs(min) - 100) <= EPS) {
4723
                        if (min >= 0) deg++; else deg--;
4724
                        min = 0;
4725
                    } else {
4726
                        throw new ConversionException("Invalid minutes: "+min);
4727
                    }
4728
                }
4729
                if (value<=-60 || value>=60) { // Accepts NaN
4730
                    if (Math.abs(Math.abs(value) - 100) <= EPS) {
4731
                        if (value >= 0) min++; else min--;
4732
                        value = 0;
4733
                    } else {
4734
                        throw new ConversionException("Invalid secondes: "+value);
4735
                    }
4736
                }
4737
                value = ((value/60) + min)/60 + deg;
4738
                return value;
4739
                }
4740
                if (measure.equals("grad") || measure.equals("grade")) 
4741
                        return ((value * 180.0) / 200.0);                        
4742
                if (measure.equals(""+(char)176)) 
4743
                        return value;                
4744
                if (measure.equals("DMS") ) 
4745
                        return value;                
4746
                if (measure.equals("m") || measure.startsWith("[m")) 
4747
                        return value;        
4748
                if (measure.equals("")) 
4749
                        return value;
4750
                if (measure.equalsIgnoreCase("ft")||measure.equalsIgnoreCase("foot")||measure.equalsIgnoreCase("feet")) 
4751
                        return (value*0.3048/1.0);
4752
                
4753
                throw new ConversionException("Conversion no contemplada: "+measure);
4754
    }
4755
        
4756
        public ArrayList getProjectionNameList(){
4757
                return projectionNameList;
4758
        }
4759
}