# Number of lines of code in Set: 151
my($self, %params) = @_;
if (exists $params{Authority} and exists $params{TargetKey} and exists $params{Node} and exists $params{Code}) {
SetAuthority($self, $params{TargetKey}, $params{Authority}, $params{Code});
} elsif (exists $params{Node} and exists $params{Value}) {
SetAttrValue($self, $params{Node}, $params{Value});
} elsif (exists $params{
AngularUnits} and exists $params{Value}) {
SetAngularUnits($self, $params{
AngularUnits}, $params{Value});
} elsif (exists $params{
LinearUnits} and exists $params{Node} and exists $params{Value}) {
SetTargetLinearUnits($self, $params{Node}, $params{
LinearUnits}, $params{Value});
} elsif (exists $params{
LinearUnits} and exists $params{Value}) {
SetLinearUnitsAndUpdateParameters($self, $params{
LinearUnits}, $params{Value});
} elsif ($params{Parameter} and exists $params{Value}) {
croak "Unknown projection parameter '$params{Parameter}'." unless exists $Geo::OSR::PARAMETERS{$params{Parameter}};
$params{Normalized} ?
SetNormProjParm($self, $params{Parameter}, $params{Value}) :
SetProjParm($self, $params{Parameter}, $params{Value});
} elsif ($params{Name}) {
SetWellKnownGeogCS($self, $params{Name});
} elsif ($params{GuessFrom}) {
SetFromUserInput($self, $params{GuessFrom});
} elsif ($params{LOCAL_CS}) {
SetLocalCS($self, $params{LOCAL_CS});
} elsif ($params{GeocentricCS}) {
SetGeocCS($self, $params{GeocentricCS});
} elsif ($params{VerticalCS} and $params{Datum}) {
my $type = $params{VertDatumType} || 2005;
SetVertCS($self, $params{VerticalCS}, $params{Datum}, $type);
} elsif ($params{CoordinateSystem}) {
my @parameters = ();
if ($params{CoordinateSystem} eq 'State Plane' and exists $params{Zone}) {
my $NAD83 = exists $params{NAD83} ? $params{NAD83} : 1;
my $name = exists $params{UnitName} ? $params{UnitName} : undef;
my $c = exists $params{UnitConversionFactor} ? $params{UnitConversionFactor} : 0.0;
SetStatePlane($self, $params{Zone}, $NAD83, $name, $c);
} elsif ($params{CoordinateSystem} eq 'UTM' and exists $params{Zone} and exists $params{North}) {
my $north = exists $params{North} ? $params{North} : 1;
SetUTM($self, $params{Zone}, $north);
} elsif ($params{CoordinateSystem} eq 'WGS') {
SetTOWGS84($self, @parameters);
} elsif ($params{CoordinateSystem} and $params{Datum} and $params{Spheroid}) {
SetGeogCS($self, $params{CoordinateSystem}, $params{Datum}, $params{Spheroid}, @parameters);
} elsif ($params{CoordinateSystem} and $params{HorizontalCS} and $params{VerticalCS}) {
SetCompoundCS($self, $params{CoordinateSystem}, $params{HorizontalCS}, $params{VerticalCS});
} else {
SetProjCS($self, $params{CoordinateSystem});
}
} elsif ($params{Projection}) {
confess "Unknown projection." unless exists $Geo::OSR::PROJECTIONS{$params{Projection}};
my @parameters = ();
if ($params{Projection} eq 'Albers_Conic_Equal_Area') {
SetACEA($self, @parameters);
} elsif ($params{Projection} eq 'Azimuthal_Equidistant') {
SetAE($self, @parameters);
} elsif ($params{Projection} eq 'Bonne') {
SetBonne($self, @parameters);
} elsif ($params{Projection} eq 'Cylindrical_Equal_Area') {
SetCEA($self, @parameters);
} elsif ($params{Projection} eq 'Cassini_Soldner') {
SetCS($self, @parameters);
} elsif ($params{Projection} eq 'Equidistant_Conic') {
SetEC($self, @parameters);
# Eckert_I, Eckert_II, Eckert_III, Eckert_V ?
} elsif ($params{Projection} eq 'Eckert_IV') {
SetEckertIV($self, @parameters);
} elsif ($params{Projection} eq 'Eckert_VI') {
SetEckertVI($self, @parameters);
} elsif ($params{Projection} eq 'Equirectangular') {
@parameters == 4 ?
SetEquirectangular($self, @parameters) :
SetEquirectangular2($self, @parameters);
} elsif ($params{Projection} eq 'Gauss_Schreiber_Transverse_Mercator') {
SetGaussSchreiberTMercator($self, @parameters);
} elsif ($params{Projection} eq 'Gall_Stereographic') {
SetGS($self, @parameters);
} elsif ($params{Projection} eq 'Goode_Homolosine') {
SetGH($self, @parameters);
} elsif ($params{Projection} eq 'Interrupted_Goode_Homolosine') {
SetIGH($self);
} elsif ($params{Projection} eq 'Geostationary_Satellite') {
SetGEOS($self, @parameters);
} elsif ($params{Projection} eq 'Gnomonic') {
SetGnomonic($self, @parameters);
} elsif ($params{Projection} eq 'Hotine_Oblique_Mercator') {
# Hotine_Oblique_Mercator_Azimuth_Center ?
SetHOM($self, @parameters);
} elsif ($params{Projection} eq 'Hotine_Oblique_Mercator_Two_Point_Natural_Origin') {
SetHOM2PNO($self, @parameters);
} elsif ($params{Projection} eq 'Krovak') {
SetKrovak($self, @parameters);
} elsif ($params{Projection} eq 'Lambert_Azimuthal_Equal_Area') {
SetLAEA($self, @parameters);
} elsif ($params{Projection} eq 'Lambert_Conformal_Conic_2SP') {
SetLCC($self, @parameters);
} elsif ($params{Projection} eq 'Lambert_Conformal_Conic_1SP') {
SetLCC1SP($self, @parameters);
} elsif ($params{Projection} eq 'Lambert_Conformal_Conic_2SP_Belgium') {
SetLCCB($self, @parameters);
} elsif ($params{Projection} eq 'miller_cylindrical') {
SetMC($self, @parameters);
} elsif ($params{Projection} =~ /^Mercator/) {
# Mercator_1SP, Mercator_2SP, Mercator_Auxiliary_Sphere ?
# variant is in Variant (or Name)
SetMercator($self, @parameters);
} elsif ($params{Projection} eq 'Mollweide') {
SetMollweide($self, @parameters);
} elsif ($params{Projection} eq 'New_Zealand_Map_Grid') {
SetNZMG($self, @parameters);
} elsif ($params{Projection} eq 'Oblique_Stereographic') {
SetOS($self, @parameters);
} elsif ($params{Projection} eq 'Orthographic') {
SetOrthographic($self, @parameters);
} elsif ($params{Projection} eq 'Polyconic') {
SetPolyconic($self, @parameters);
} elsif ($params{Projection} eq 'Polar_Stereographic') {
SetPS($self, @parameters);
} elsif ($params{Projection} eq 'Robinson') {
SetRobinson($self, @parameters);
} elsif ($params{Projection} eq 'Sinusoidal') {
SetSinusoidal($self, @parameters);
} elsif ($params{Projection} eq 'Stereographic') {
SetStereographic($self, @parameters);
} elsif ($params{Projection} eq 'Swiss_Oblique_Cylindrical') {
SetSOC($self, @parameters);
} elsif ($params{Projection} eq 'Transverse_Mercator_South_Orientated') {
SetTMSO($self, @parameters);
} elsif ($params{Projection} =~ /^Transverse_Mercator/) {
my($variant) = $params{Projection} =~ /^Transverse_Mercator_(\w+)/;
$variant = $params{Variant} unless $variant;
$variant = $params{Name} unless $variant;
$variant ?
SetTMVariant($self, $variant, @parameters) :
SetTM($self, @parameters);
} elsif ($params{Projection} eq 'Tunisia_Mining_Grid') {
SetTMG($self, @parameters);
} elsif ($params{Projection} eq 'VanDerGrinten') {
SetVDG($self, @parameters);
} else {
# Aitoff, Craster_Parabolic, International_Map_of_the_World_Polyconic, Laborde_Oblique_Mercator
# Loximuthal, Miller_Cylindrical, Quadrilateralized_Spherical_Cube, Quartic_Authalic, Two_Point_Equidistant
# Wagner_I, Wagner_II, Wagner_III, Wagner_IV, Wagner_V, Wagner_VI, Wagner_VII
# Winkel_I, Winkel_II, Winkel_Tripel
# ?
SetProjection($self, $params{Projection});
}
} else {
confess "Not enough information for a spatial reference object.";
}
}