~ubuntu-branches/debian/sid/gdal/sid

« back to all changes in this revision

Viewing changes to swig/perl/lib/Geo/OSR.pm

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2012-05-07 15:04:42 UTC
  • mfrom: (5.5.16 experimental)
  • Revision ID: package-import@ubuntu.com-20120507150442-2eks97loeh6rq005
Tags: 1.9.0-1
* Ready for sid, starting transition.
* All symfiles updated to latest builds.
* Added dh_numpy call in debian/rules to depend on numpy ABI.
* Policy bumped to 3.9.3, no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# This file was automatically generated by SWIG (http://www.swig.org).
2
 
# Version 1.3.39
 
2
# Version 1.3.40
3
3
#
4
4
# Do not make changes to this file unless you know what you are doing--modify
5
5
# the SWIG interface file instead.
88
88
*__str__ = *Geo::OSRc::SpatialReference___str__;
89
89
*IsSame = *Geo::OSRc::SpatialReference_IsSame;
90
90
*IsSameGeogCS = *Geo::OSRc::SpatialReference_IsSameGeogCS;
 
91
*IsSameVertCS = *Geo::OSRc::SpatialReference_IsSameVertCS;
91
92
*IsGeographic = *Geo::OSRc::SpatialReference_IsGeographic;
92
93
*IsProjected = *Geo::OSRc::SpatialReference_IsProjected;
 
94
*IsCompound = *Geo::OSRc::SpatialReference_IsCompound;
 
95
*IsGeocentric = *Geo::OSRc::SpatialReference_IsGeocentric;
93
96
*IsLocal = *Geo::OSRc::SpatialReference_IsLocal;
 
97
*IsVertical = *Geo::OSRc::SpatialReference_IsVertical;
94
98
*EPSGTreatsAsLatLong = *Geo::OSRc::SpatialReference_EPSGTreatsAsLatLong;
95
99
*SetAuthority = *Geo::OSRc::SpatialReference_SetAuthority;
96
100
*GetAttrValue = *Geo::OSRc::SpatialReference_GetAttrValue;
97
101
*SetAttrValue = *Geo::OSRc::SpatialReference_SetAttrValue;
98
102
*SetAngularUnits = *Geo::OSRc::SpatialReference_SetAngularUnits;
99
103
*GetAngularUnits = *Geo::OSRc::SpatialReference_GetAngularUnits;
 
104
*SetTargetLinearUnits = *Geo::OSRc::SpatialReference_SetTargetLinearUnits;
100
105
*SetLinearUnits = *Geo::OSRc::SpatialReference_SetLinearUnits;
101
106
*SetLinearUnitsAndUpdateParameters = *Geo::OSRc::SpatialReference_SetLinearUnitsAndUpdateParameters;
102
107
*GetLinearUnits = *Geo::OSRc::SpatialReference_GetLinearUnits;
104
109
*GetAuthorityCode = *Geo::OSRc::SpatialReference_GetAuthorityCode;
105
110
*GetAuthorityName = *Geo::OSRc::SpatialReference_GetAuthorityName;
106
111
*SetUTM = *Geo::OSRc::SpatialReference_SetUTM;
 
112
*_GetUTMZone = *Geo::OSRc::SpatialReference__GetUTMZone;
107
113
*SetStatePlane = *Geo::OSRc::SpatialReference_SetStatePlane;
108
114
*AutoIdentifyEPSG = *Geo::OSRc::SpatialReference_AutoIdentifyEPSG;
109
115
*SetProjection = *Geo::OSRc::SpatialReference_SetProjection;
111
117
*GetProjParm = *Geo::OSRc::SpatialReference_GetProjParm;
112
118
*SetNormProjParm = *Geo::OSRc::SpatialReference_SetNormProjParm;
113
119
*GetNormProjParm = *Geo::OSRc::SpatialReference_GetNormProjParm;
 
120
*GetSemiMajor = *Geo::OSRc::SpatialReference_GetSemiMajor;
 
121
*GetSemiMinor = *Geo::OSRc::SpatialReference_GetSemiMinor;
 
122
*GetInvFlattening = *Geo::OSRc::SpatialReference_GetInvFlattening;
114
123
*SetACEA = *Geo::OSRc::SpatialReference_SetACEA;
115
124
*SetAE = *Geo::OSRc::SpatialReference_SetAE;
116
125
*SetBonne = *Geo::OSRc::SpatialReference_SetBonne;
124
133
*SetGaussSchreiberTMercator = *Geo::OSRc::SpatialReference_SetGaussSchreiberTMercator;
125
134
*SetGS = *Geo::OSRc::SpatialReference_SetGS;
126
135
*SetGH = *Geo::OSRc::SpatialReference_SetGH;
 
136
*SetIGH = *Geo::OSRc::SpatialReference_SetIGH;
127
137
*SetGEOS = *Geo::OSRc::SpatialReference_SetGEOS;
128
138
*SetGnomonic = *Geo::OSRc::SpatialReference_SetGnomonic;
129
139
*SetHOM = *Geo::OSRc::SpatialReference_SetHOM;
158
168
*SetLocalCS = *Geo::OSRc::SpatialReference_SetLocalCS;
159
169
*SetGeogCS = *Geo::OSRc::SpatialReference_SetGeogCS;
160
170
*SetProjCS = *Geo::OSRc::SpatialReference_SetProjCS;
 
171
*SetGeocCS = *Geo::OSRc::SpatialReference_SetGeocCS;
 
172
*SetVertCS = *Geo::OSRc::SpatialReference_SetVertCS;
 
173
*SetCompoundCS = *Geo::OSRc::SpatialReference_SetCompoundCS;
161
174
*ImportFromWkt = *Geo::OSRc::SpatialReference_ImportFromWkt;
162
175
*ImportFromProj4 = *Geo::OSRc::SpatialReference_ImportFromProj4;
163
176
*ImportFromUrl = *Geo::OSRc::SpatialReference_ImportFromUrl;
167
180
*ImportFromPCI = *Geo::OSRc::SpatialReference_ImportFromPCI;
168
181
*ImportFromUSGS = *Geo::OSRc::SpatialReference_ImportFromUSGS;
169
182
*ImportFromXML = *Geo::OSRc::SpatialReference_ImportFromXML;
 
183
*ImportFromERM = *Geo::OSRc::SpatialReference_ImportFromERM;
170
184
*ImportFromMICoordSys = *Geo::OSRc::SpatialReference_ImportFromMICoordSys;
171
185
*ExportToWkt = *Geo::OSRc::SpatialReference_ExportToWkt;
172
186
*ExportToPrettyWkt = *Geo::OSRc::SpatialReference_ExportToPrettyWkt;
221
235
}
222
236
 
223
237
*TransformPoint = *Geo::OSRc::CoordinateTransformation_TransformPoint;
224
 
*TransformPoints = *Geo::OSRc::CoordinateTransformation_TransformPoints;
 
238
*_TransformPoints = *Geo::OSRc::CoordinateTransformation__TransformPoints;
225
239
sub DISOWN {
226
240
    my $self = shift;
227
241
    my $ptr = tied(%$self);
257
271
*SRS_PT_GAUSSSCHREIBERTMERCATOR = *Geo::OSRc::SRS_PT_GAUSSSCHREIBERTMERCATOR;
258
272
*SRS_PT_GEOSTATIONARY_SATELLITE = *Geo::OSRc::SRS_PT_GEOSTATIONARY_SATELLITE;
259
273
*SRS_PT_GOODE_HOMOLOSINE = *Geo::OSRc::SRS_PT_GOODE_HOMOLOSINE;
 
274
*SRS_PT_IGH = *Geo::OSRc::SRS_PT_IGH;
260
275
*SRS_PT_GNOMONIC = *Geo::OSRc::SRS_PT_GNOMONIC;
261
276
*SRS_PT_HOTINE_OBLIQUE_MERCATOR = *Geo::OSRc::SRS_PT_HOTINE_OBLIQUE_MERCATOR;
262
277
*SRS_PT_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN = *Geo::OSRc::SRS_PT_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN;
339
354
*SRS_UL_CHAIN_CONV = *Geo::OSRc::SRS_UL_CHAIN_CONV;
340
355
*SRS_UL_ROD = *Geo::OSRc::SRS_UL_ROD;
341
356
*SRS_UL_ROD_CONV = *Geo::OSRc::SRS_UL_ROD_CONV;
 
357
*SRS_UL_LINK_Clarke = *Geo::OSRc::SRS_UL_LINK_Clarke;
 
358
*SRS_UL_LINK_Clarke_CONV = *Geo::OSRc::SRS_UL_LINK_Clarke_CONV;
342
359
*SRS_UA_DEGREE = *Geo::OSRc::SRS_UA_DEGREE;
343
360
*SRS_UA_DEGREE_CONV = *Geo::OSRc::SRS_UA_DEGREE_CONV;
344
361
*SRS_UA_RADIAN = *Geo::OSRc::SRS_UA_RADIAN;
354
371
    }
355
372
    package Geo::OSR::SpatialReference;
356
373
    use strict;
 
374
    use Carp;
 
375
    use vars qw /@PROJECTIONS %PROJECTIONS @PARAMETERS %PARAMETERS/;
 
376
    @PROJECTIONS = qw/
 
377
ALBERS_CONIC_EQUAL_AREA
 
378
AZIMUTHAL_EQUIDISTANT
 
379
CASSINI_SOLDNER
 
380
CYLINDRICAL_EQUAL_AREA
 
381
BONNE
 
382
ECKERT_I
 
383
ECKERT_II
 
384
ECKERT_III
 
385
ECKERT_IV
 
386
ECKERT_V
 
387
ECKERT_VI
 
388
EQUIDISTANT_CONIC
 
389
EQUIRECTANGULAR
 
390
GALL_STEREOGRAPHIC
 
391
GAUSSSCHREIBERTMERCATOR
 
392
GEOSTATIONARY_SATELLITE
 
393
GOODE_HOMOLOSINE
 
394
IGH
 
395
GNOMONIC
 
396
HOTINE_OBLIQUE_MERCATOR
 
397
HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN
 
398
LABORDE_OBLIQUE_MERCATOR
 
399
LAMBERT_CONFORMAL_CONIC_1SP
 
400
LAMBERT_CONFORMAL_CONIC_2SP
 
401
LAMBERT_CONFORMAL_CONIC_2SP_BELGIUM
 
402
LAMBERT_AZIMUTHAL_EQUAL_AREA
 
403
MERCATOR_1SP
 
404
MERCATOR_2SP
 
405
MILLER_CYLINDRICAL
 
406
MOLLWEIDE
 
407
NEW_ZEALAND_MAP_GRID
 
408
OBLIQUE_STEREOGRAPHIC
 
409
ORTHOGRAPHIC
 
410
POLAR_STEREOGRAPHIC
 
411
POLYCONIC
 
412
ROBINSON
 
413
SINUSOIDAL
 
414
STEREOGRAPHIC
 
415
SWISS_OBLIQUE_CYLINDRICAL
 
416
TRANSVERSE_MERCATOR
 
417
TRANSVERSE_MERCATOR_SOUTH_ORIENTED
 
418
TRANSVERSE_MERCATOR_MI_21
 
419
TRANSVERSE_MERCATOR_MI_22
 
420
TRANSVERSE_MERCATOR_MI_23
 
421
TRANSVERSE_MERCATOR_MI_24
 
422
TRANSVERSE_MERCATOR_MI_25
 
423
TUNISIA_MINING_GRID
 
424
TWO_POINT_EQUIDISTANT
 
425
VANDERGRINTEN
 
426
KROVAK
 
427
IMW_POLYCONIC
 
428
WAGNER_I
 
429
WAGNER_II
 
430
WAGNER_III
 
431
WAGNER_IV
 
432
WAGNER_V
 
433
WAGNER_VI
 
434
WAGNER_VII
 
435
/;
 
436
    for my $s (@PROJECTIONS) {
 
437
        my $p = eval "\$Geo::OGR::SRS_PT_$s";
 
438
        $PROJECTIONS{$s} = $p;
 
439
    }
 
440
    @PARAMETERS = qw/
 
441
CENTRAL_MERIDIAN
 
442
SCALE_FACTOR
 
443
STANDARD_PARALLEL_1
 
444
STANDARD_PARALLEL_2
 
445
PSEUDO_STD_PARALLEL_1
 
446
LONGITUDE_OF_CENTER
 
447
LATITUDE_OF_CENTER
 
448
LONGITUDE_OF_ORIGIN
 
449
LATITUDE_OF_ORIGIN
 
450
FALSE_EASTING
 
451
FALSE_NORTHING
 
452
AZIMUTH
 
453
LONGITUDE_OF_POINT_1
 
454
LATITUDE_OF_POINT_1
 
455
LONGITUDE_OF_POINT_2
 
456
LATITUDE_OF_POINT_2
 
457
LONGITUDE_OF_POINT_3
 
458
LATITUDE_OF_POINT_3
 
459
RECTIFIED_GRID_ANGLE
 
460
LANDSAT_NUMBER
 
461
PATH_NUMBER
 
462
PERSPECTIVE_POINT_HEIGHT
 
463
SATELLITE_HEIGHT
 
464
FIPSZONE
 
465
ZONE
 
466
LATITUDE_OF_1ST_POINT
 
467
LONGITUDE_OF_1ST_POINT
 
468
LATITUDE_OF_2ND_POINT
 
469
LONGITUDE_OF_2ND_POINT
 
470
/;
 
471
    for my $s (@PARAMETERS) {
 
472
        my $p = eval "\$Geo::OGR::SRS_PP_$s";
 
473
        $PARAMETERS{$s} = $p;
 
474
    }
357
475
    sub create {
358
476
        my $pkg = shift;
359
477
        my %param = @_;
365
483
        } elsif ($param{Proj4}) {
366
484
            ImportFromProj4($self, $param{Proj4});
367
485
        } elsif ($param{ESRI}) {
368
 
            ImportFromESRI($self, $param{ESRI});
 
486
            ImportFromESRI($self, @{$param{ESRI}});
369
487
        } elsif ($param{EPSG}) {
370
488
            ImportFromEPSG($self, $param{EPSG});
 
489
        } elsif ($param{EPSGA}) {
 
490
            ImportFromEPSGA($self, $param{EPSGA});
371
491
        } elsif ($param{PCI}) {
372
 
            ImportFromPCI($self, $param{PCI});
 
492
            ImportFromPCI($self, @{$param{PCI}});
373
493
        } elsif ($param{USGS}) {
374
 
            ImportFromUSGS($self, $param{USGS});
 
494
            ImportFromUSGS($self, @{$param{USGS}});
375
495
        } elsif ($param{XML}) {
376
496
            ImportFromXML($self, $param{XML});
 
497
        } elsif ($param{GML}) {
 
498
            ImportFromGML($self, $param{GML});
 
499
        } elsif ($param{URL}) {
 
500
            ImportFromUrl($self, $param{URL});
 
501
        } elsif ($param{ERMapper}) {
 
502
            ImportFromERM($self, @{$param{ERMapper}} );
 
503
        } elsif ($param{ERM}) {
 
504
            ImportFromERM($self, @{$param{ERM}} );
 
505
        } elsif ($param{MICoordSys}) {
 
506
            ImportFromMICoordSys($self, $param{MICoordSys} );
 
507
        } elsif ($param{MapInfoCS}) {
 
508
            ImportFromMICoordSys($self, $param{MapInfoCS} );
 
509
        } else {
 
510
            croak "Unrecognized import format for Geo::OSR::SpatialReference.";
377
511
        }
378
512
        bless $self, $pkg if defined $self;
379
513
    }
 
514
    sub Export {
 
515
        my $self = shift;
 
516
        my $format = pop if @_ == 1;
 
517
        my %params = @_;
 
518
        $format = $params{to} unless $format;
 
519
        $format = $params{format} unless $format;
 
520
        $format = $params{as} unless $format;
 
521
        if ($format eq 'WKT' or $format eq 'Text') {
 
522
            return ExportToWkt($self);
 
523
        } elsif ($format eq 'PrettyWKT') {
 
524
            my $simplify = exists $params{simplify} ? $params{simplify} : 0;
 
525
            return ExportToPrettyWkt($self, $simplify);
 
526
        } elsif ($format eq 'Proj4') {
 
527
            return ExportToProj4($self);
 
528
        } elsif ($format eq 'PCI') {        
 
529
            return ExportToPCI($self);
 
530
        } elsif ($format eq 'USGS') {
 
531
            return ExportToUSGS($self);
 
532
        } elsif ($format eq 'GML' or $format eq 'XML') {
 
533
            my $dialect = exists $params{dialect} ? $params{dialect} : '';
 
534
            return ExportToXML($self, $dialect);
 
535
        } elsif ($format eq 'MICoordSys' or $format eq 'MapInfoCS') {
 
536
            return ExportToMICoordSys();
 
537
        } else {
 
538
            croak "Unrecognized export format for Geo::OSR::SpatialReference.";
 
539
        }
 
540
    }
380
541
    *AsText = *ExportToWkt;
 
542
    *As = *Export;
 
543
    sub Set {
 
544
        my($self, %params) = @_;
 
545
        if (exists $params{Authority} and exists $params{Node} and exists $params{Code}) {
 
546
            SetAuthority($self, $params{TargetKey}, $params{Authority}, $params{Code});
 
547
        } elsif (exists $params{Node} and exists $params{Value}) {
 
548
            SetAttrValue($self, $params{Node}, $params{Value});
 
549
        } elsif (exists $params{AngularUnits} and exists $params{Value}) {
 
550
            SetAngularUnits($self, $params{AngularUnits}, $params{Value});
 
551
        } elsif (exists $params{LinearUnits} and exists $params{Node} and exists $params{Value}) {
 
552
            SetTargetLinearUnits($self, $params{Node}, $params{LinearUnits}, $params{Value});
 
553
        } elsif (exists $params{LinearUnits} and exists $params{Value}) {
 
554
            SetLinearUnitsAndUpdateParameters($self, $params{LinearUnits}, $params{Value});
 
555
        } elsif ($params{CoordinateSystem} eq 'UTM' and exists $params{Zone} and exists $params{North}) {
 
556
            my $north = exists $params{North} ? $params{North} : 1;
 
557
            SetUTM($self, $params{Zone}, $north);
 
558
        } elsif ($params{CoordinateSystem} eq 'State Plane' and exists $params{Zone}) {
 
559
            my $NAD83 = exists $params{NAD83} ? $params{NAD83} : 1;
 
560
            my $name = exists $params{UnitName} ? $params{UnitName} : undef;
 
561
            my $c = exists $params{UnitConversionFactor} ? $params{UnitConversionFactor} : 0.0;
 
562
            SetStatePlane($self, $params{Zone}, $NAD83, $name, $c);
 
563
        } elsif ($params{Parameter} and exists $params{Value}) {
 
564
            croak "unknown parameter: $params{Parameter}" unless exists $PARAMETERS{$params{Parameter}};
 
565
            $params{Normalized} ?
 
566
                SetNormProjParm($self, $params{Parameter}, $params{Value}) :
 
567
                SetProjParm($self, $params{Parameter}, $params{Value});
 
568
        } elsif ($params{Projection}) {
 
569
            croak "unknown projection: $params{Projection}" unless exists $PROJECTIONS{$params{Projection}};
 
570
            if (not $params{Parameters}) {
 
571
                SetProjection($self, $PROJECTIONS{$params{Projection}});
 
572
            } elsif ($params{Projection} eq 'ALBERS_CONIC_EQUAL_AREA' and $params{Parameters}) {
 
573
                SetACEA($self, @{$params{Parameters}});
 
574
            } elsif ($params{Projection} eq 'AZIMUTHAL_EQUIDISTANT' and $params{Parameters}) {
 
575
                SetAE($self, @{$params{Parameters}});
 
576
            } elsif ($params{Projection} eq 'BONNE' and $params{Parameters}) {
 
577
                SetBonne($self, @{$params{Parameters}});
 
578
            } elsif ($params{Projection} eq 'CYLINDRICAL_EQUAL_AREA' and $params{Parameters}) {
 
579
                SetCEA($self, @{$params{Parameters}});
 
580
            } elsif ($params{Projection} eq 'CASSINI_SOLDNER' and $params{Parameters}) {
 
581
                SetCS($self, @{$params{Parameters}});
 
582
            } elsif ($params{Projection} eq 'EQUIDISTANT_CONIC' and $params{Parameters}) {
 
583
                SetEC($self, @{$params{Parameters}});
 
584
            } elsif ($params{Projection} eq 'ECKERT_IV' and $params{Parameters}) {
 
585
                SetEckertIV($self, @{$params{Parameters}});
 
586
            } elsif ($params{Projection} eq 'ECKERT_VI' and $params{Parameters}) {
 
587
                SetEckertVI($self, @{$params{Parameters}});
 
588
            } elsif ($params{Projection} eq 'EQUIRECTANGULAR' and $params{Parameters}) {
 
589
                @{$params{Parameters}} == 4 ?
 
590
                    SetEquirectangular($self, @{$params{Parameters}}) :
 
591
                    SetEquirectangular2($self, @{$params{Parameters}});
 
592
            } elsif ($params{Projection} eq 'GAUSSSCHREIBERTMERCATOR' and $params{Parameters}) {
 
593
                SetGaussSchreiberTMercator($self, @{$params{Parameters}});
 
594
            } elsif ($params{Projection} eq 'GALL_STEREOGRAPHIC' and $params{Parameters}) {
 
595
                SetGS($self, @{$params{Parameters}});
 
596
            } elsif ($params{Projection} eq 'GOODE_HOMOLOSINE' and $params{Parameters}) {
 
597
                SetGH($self, @{$params{Parameters}});
 
598
            } elsif ($params{Projection} eq 'IGH') {
 
599
                SetIGH($self);
 
600
            } elsif ($params{Projection} eq 'GEOSTATIONARY_SATELLITE' and $params{Parameters}) {
 
601
                SetGEOS($self, @{$params{Parameters}});
 
602
            } elsif ($params{Projection} eq 'GNOMONIC' and $params{Parameters}) {
 
603
                SetGnomonic($self, @{$params{Parameters}});
 
604
            } elsif ($params{Projection} eq 'HOTINE_OBLIQUE_MERCATOR' and $params{Parameters}) {
 
605
                SetHOM($self, @{$params{Parameters}});
 
606
            } elsif ($params{Projection} eq 'HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN' and $params{Parameters}) {
 
607
                SetHOM2PNO($self, @{$params{Parameters}});
 
608
            } elsif ($params{Projection} eq 'KROVAK' and $params{Parameters}) {
 
609
                SetKrovak($self, @{$params{Parameters}});
 
610
            } elsif ($params{Projection} eq 'LAMBERT_AZIMUTHAL_EQUAL_AREA' and $params{Parameters}) {
 
611
                SetLAEA($self, @{$params{Parameters}});
 
612
            } elsif ($params{Projection} eq 'LAMBERT_CONFORMAL_CONIC_2SP' and $params{Parameters}) {
 
613
                SetLCC($self, @{$params{Parameters}});
 
614
            } elsif ($params{Projection} eq 'LAMBERT_CONFORMAL_CONIC_1SP' and $params{Parameters}) {
 
615
                SetLCC1SP($self, @{$params{Parameters}});
 
616
            } elsif ($params{Projection} eq 'LAMBERT_CONFORMAL_CONIC_2SP_BELGIUM' and $params{Parameters}) {
 
617
                SetLCCB($self, @{$params{Parameters}});
 
618
            } elsif ($params{Projection} eq 'MILLER_CYLINDRICAL' and $params{Parameters}) {
 
619
                SetMC($self, @{$params{Parameters}});
 
620
            } elsif ($params{Projection} =~ /^MERCATOR/ and $params{Parameters}) {
 
621
                SetMercator($self, @{$params{Parameters}});
 
622
            } elsif ($params{Projection} eq 'MOLLWEIDE' and $params{Parameters}) {
 
623
                SetMollweide($self, @{$params{Parameters}});
 
624
            } elsif ($params{Projection} eq 'NEW_ZEALAND_MAP_GRID' and $params{Parameters}) {
 
625
                SetNZMG($self, @{$params{Parameters}});
 
626
            } elsif ($params{Projection} eq 'OBLIQUE_STEREOGRAPHIC' and $params{Parameters}) {
 
627
                SetOS($self, @{$params{Parameters}});
 
628
            } elsif ($params{Projection} eq 'ORTHOGRAPHIC' and $params{Parameters}) {
 
629
                SetOrthographic($self, @{$params{Parameters}});
 
630
            } elsif ($params{Projection} eq 'POLYCONIC' and $params{Parameters}) {
 
631
                SetPolyconic($self, @{$params{Parameters}});
 
632
            } elsif ($params{Projection} eq 'POLAR_STEREOGRAPHIC' and $params{Parameters}) {
 
633
                SetPS($self, @{$params{Parameters}});
 
634
            } elsif ($params{Projection} eq 'ROBINSON' and $params{Parameters}) {
 
635
                SetRobinson($self, @{$params{Parameters}});
 
636
            } elsif ($params{Projection} eq 'SINUSOIDAL' and $params{Parameters}) {
 
637
                SetSinusoidal($self, @{$params{Parameters}});
 
638
            } elsif ($params{Projection} eq 'STEREOGRAPHIC' and $params{Parameters}) {
 
639
                SetStereographic($self, @{$params{Parameters}});
 
640
            } elsif ($params{Projection} eq 'SWISS_OBLIQUE_CYLINDRICAL' and $params{Parameters}) {
 
641
                SetSOC($self, @{$params{Parameters}});
 
642
            } elsif ($params{Projection} eq 'TRANSVERSE_MERCATOR_SOUTH_ORIENTED' and $params{Parameters}) {
 
643
                SetTMSO($self, @{$params{Parameters}});
 
644
            } elsif ($params{Projection} =~ /^TRANSVERSE_MERCATOR/ and $params{Parameters}) {
 
645
                my($variant) = $params{Projection} =~ /^TRANSVERSE_MERCATOR_(\w+)/;
 
646
                $variant = $params{Name} unless $variant;
 
647
                $variant ?
 
648
                    SetTMVariant($self, $variant, @{$params{Parameters}}) :
 
649
                    SetTM($self, @{$params{Parameters}});
 
650
            } elsif ($params{Projection} eq 'TUNISIA_MINING_GRID' and $params{Parameters}) {
 
651
                SetTMG($self, @{$params{Parameters}});
 
652
            } elsif ($params{Projection} eq 'VANDERGRINTEN' and $params{Parameters}) {
 
653
                SetVDG($self, @{$params{Parameters}});
 
654
            } elsif ($params{Name}) {
 
655
                SetWellKnownGeogCS($self, $params{Name});
 
656
            } elsif ($params{GuessFrom}) {
 
657
                SetFromUserInput($self, $params{GuessFrom});
 
658
            } elsif ($params{CoordinateSystem} eq 'WGS' and $params{Parameters}) {
 
659
                SetTOWGS84($self, @{$params{Parameters}});
 
660
            } elsif ($params{LOCAL_CS}) {
 
661
                SetLocalCS($self, $params{LOCAL_CS});
 
662
            } elsif ($params{CoordinateSystem} and $params{Datum} and $params{Spheroid} and $params{Parameters}) {
 
663
                SetGeogCS($self, $params{CoordinateSystem}, $params{Datum}, $params{Spheroid}, @{$params{Parameters}});
 
664
            } elsif ($params{CoordinateSystem}) {
 
665
                SetProjCS($self, $params{CoordinateSystem});
 
666
            } elsif ($params{GeocentricCS}) {
 
667
                SetGeocCS($self, $params{GeocentricCS});
 
668
            } elsif ($params{VerticalCS} and $params{Datum}) {
 
669
                my $type = $params{VertDatumType} || 2005;
 
670
                SetVertCS($self, $params{VerticalCS}, $params{Datum}, $type);
 
671
            } elsif ($params{CoordinateSystem} and $params{HorizontalCS} and $params{VerticalCS}) {
 
672
                SetCompoundCS($self, $params{CoordinateSystem}, $params{HorizontalCS}, $params{VerticalCS});
 
673
            } else {
 
674
                croak "Not enough information to set anything in a spatial reference object.";
 
675
            }
 
676
        }
 
677
    }
 
678
    sub GetUTMZone {
 
679
        my $self = shift;
 
680
        my $zone = _GetUTMZone($self);
 
681
        if (wantarray) {            
 
682
            my $north = 1;
 
683
            if ($zone < 0) {
 
684
                $zone *= -1;
 
685
                $north = 0;
 
686
            }
 
687
            return ($zone, $north);
 
688
        } else {
 
689
            return $zone;
 
690
        }
 
691
    }
 
692
 
 
693
    package Geo::OSR::CoordinateTransformation;
 
694
    use strict;
 
695
    sub TransformPoints {
 
696
        my($self, $points) = @_;
 
697
        _TransformPoints($self, $points), return unless ref($points->[0]->[0]);
 
698
        for my $p (@$points) {
 
699
            TransformPoints($self, $p);
 
700
        }
 
701
    }
381
702
1;