Geo::GDAL  2.0
Geo::OSR::SpatialReference Class Reference

A spatial reference system. More...

+ Inheritance diagram for Geo::OSR::SpatialReference:
+ Collaboration diagram for Geo::OSR::SpatialReference:

Public Member Functions

public method As ()
 
public method AutoIdentifyEPSG ()
 
public Geo::OSR::SpatialReference Clone ()
 
public Geo::OSR::SpatialReference CloneGeogCS ()
 
public method CopyGeogCSFrom (scalar rhs)
 
public method EPSGTreatsAsLatLong ()
 
public method EPSGTreatsAsNorthingEasting ()
 
public method Export (scalar format)
 
public method Fixup ()
 
public method FixupOrdering ()
 
public scalar GetAngularUnits ()
 
public scalar GetAttrValue (scalar name, scalar child=0)
 
public scalar GetAuthorityCode (scalar target_key)
 
public scalar GetAuthorityName (scalar target_key)
 
public method GetInvFlattening ()
 
public scalar GetLinearUnits ()
 
public scalar GetLinearUnitsName ()
 
public scalar GetNormProjParm (scalar name, scalar default_val=0.0)
 
public scalar GetProjParm (scalar name, scalar default_val=0.0)
 
public method GetSemiMajor ()
 
public method GetSemiMinor ()
 
public method GetTOWGS84 ()
 
public method GetUTMZone ()
 
public method ImportFromOzi ()
 
public scalar IsCompound ()
 
public scalar IsGeocentric ()
 
public scalar IsGeographic ()
 
public scalar IsLocal ()
 
public scalar IsProjected ()
 
public scalar IsSame (scalar rs)
 
public scalar IsSameGeogCS (scalar rs)
 
public scalar IsSameVertCS (scalar rs)
 
public scalar IsVertical ()
 
public method MorphFromESRI ()
 
public method MorphToESRI ()
 
public method Set (hash params)
 
public method StripCTParms ()
 
public method Validate ()
 
public Geo::OSR::SpatialReference new (hash params)
 
- Public Member Functions inherited from Geo::OSR
public list AngularUnits ()
 
public method CreateCoordinateTransformation ()
 
public list Datums ()
 
public list GetProjectionMethodParamInfo (scalar projection, scalar parameter)
 
public list GetProjectionMethodParameterList (scalar projection)
 
public array reference GetProjectionMethods ()
 
public scalar GetUserInputAsWKT (scalar name)
 
public scalar GetWellKnownGeogCSAsWKT (scalar name)
 Get well known geographic coordinate system as WKT. More...
 
public list LinearUnits ()
 
public list Parameters ()
 
public list Projections ()
 
public method SRS_PM_GREENWICH ()
 
public method SRS_WGS84_INVFLATTENING ()
 
public method SRS_WGS84_SEMIMAJOR ()
 
public method SRS_WKT_WGS84 ()
 

Detailed Description

A spatial reference system.

Documentation of the underlying C++ class at www.gdal.org

Definition at line 12476 of file all.pm.

Member Function Documentation

public method Geo::OSR::SpatialReference::As ( )
Code:
click to view
public method Geo::OSR::SpatialReference::AutoIdentifyEPSG ( )

Set EPSG authority info if possible.

Code:
click to view
public Geo::OSR::SpatialReference Geo::OSR::SpatialReference::Clone ( )

Make a duplicate of this SpatialReference object.

Returns
a new Geo::OSR::SpatialReference object
Code:
click to view
public Geo::OSR::SpatialReference Geo::OSR::SpatialReference::CloneGeogCS ( )

Make a duplicate of the GEOGCS node of this SpatialReference object.

Returns
a new Geo::OSR::SpatialReference object
Code:
click to view
public method Geo::OSR::SpatialReference::CopyGeogCSFrom ( scalar  rhs)
Parameters
rhsGeo::OSR::SpatialReference
Code:
click to view
public method Geo::OSR::SpatialReference::EPSGTreatsAsLatLong ( )

Returns TRUE if EPSG feels this geographic coordinate system should be treated as having lat/long coordinate ordering.

Code:
click to view
public method Geo::OSR::SpatialReference::EPSGTreatsAsNorthingEasting ( )
Code:
click to view
public method Geo::OSR::SpatialReference::Export ( scalar  format)

Export the spatial reference to a selected format.

Note
a.k.a. As
Parameters
formatOne of the following. The return value is explained after the format. Other arguments are explained in parenthesis.
  • WKT (Text): Well Known Text string
  • PrettyWKT: Well Known Text string nicely formatted (simplify)
  • Proj4: PROJ.4 string
  • PCI: a list: ($proj_string, $units, [$parms1, ...])
  • USGS: a list: ($code, $zone, [$parms1, ...], $datum)
  • GML (XML): GML based string (dialect)
  • MapInfoCS (MICoordSys): MapInfo style co-ordinate system definition
Note
The named parameter syntax also works and is needed is those cases when other arguments need or may be given. The format should be given using key as, 'to' or 'format'.
ExportTo* and AsText methods also exist but are not documented here.
Returns
a scalar or a list depending on the export format
Code:
click to view
public method Geo::OSR::SpatialReference::Fixup ( )
Code:
click to view
public method Geo::OSR::SpatialReference::FixupOrdering ( )
Code:
click to view
public scalar Geo::OSR::SpatialReference::GetAngularUnits ( )
Returns
a number
Code:
click to view
public scalar Geo::OSR::SpatialReference::GetAttrValue ( scalar  name,
scalar  child = 0 
)
Parameters
name
child
Returns
string
Code:
click to view
public scalar Geo::OSR::SpatialReference::GetAuthorityCode ( scalar  target_key)
Parameters
target_key
Returns
string
Code:
click to view
public scalar Geo::OSR::SpatialReference::GetAuthorityName ( scalar  target_key)
Parameters
target_key
Returns
string
Code:
click to view
public method Geo::OSR::SpatialReference::GetInvFlattening ( )
Code:
click to view
public scalar Geo::OSR::SpatialReference::GetLinearUnits ( )
Returns
a number
Code:
click to view
public scalar Geo::OSR::SpatialReference::GetLinearUnitsName ( )
Returns
string
Code:
click to view
public scalar Geo::OSR::SpatialReference::GetNormProjParm ( scalar  name,
scalar  default_val = 0.0 
)
Parameters
name
default_val
Returns
a number
Code:
click to view
public scalar Geo::OSR::SpatialReference::GetProjParm ( scalar  name,
scalar  default_val = 0.0 
)
Parameters
name
default_val
Returns
a number
Code:
click to view
public method Geo::OSR::SpatialReference::GetSemiMajor ( )
Code:
click to view
public method Geo::OSR::SpatialReference::GetSemiMinor ( )
Code:
click to view
public method Geo::OSR::SpatialReference::GetTOWGS84 ( )
Returns
array = ($p1, $p2, $p3, $p4, $p5, $p6, $p7)
Code:
click to view
public method Geo::OSR::SpatialReference::GetUTMZone ( )

Get UTM zone information.

Returns
The UTM zone (integer). In scalar context the returned value is negative for southern hemisphere zones. In list context returns two values ($zone, $north), where $zone is always non-negative and $north is true or false.
Code:
click to view
public method Geo::OSR::SpatialReference::ImportFromOzi ( )
Code:
click to view
public scalar Geo::OSR::SpatialReference::IsCompound ( )
Returns
boolean
Code:
click to view
public scalar Geo::OSR::SpatialReference::IsGeocentric ( )
Returns
boolean
Code:
click to view
public scalar Geo::OSR::SpatialReference::IsGeographic ( )
Returns
boolean
Code:
click to view
public scalar Geo::OSR::SpatialReference::IsLocal ( )
Returns
boolean
Code:
click to view
public scalar Geo::OSR::SpatialReference::IsProjected ( )
Returns
boolean
Code:
click to view
public scalar Geo::OSR::SpatialReference::IsSame ( scalar  rs)
Parameters
rsa Geo::OSR::SpatialReference object
Returns
boolean
Code:
click to view
public scalar Geo::OSR::SpatialReference::IsSameGeogCS ( scalar  rs)
Parameters
rsa Geo::OSR::SpatialReference object
Returns
boolean
Code:
click to view
public scalar Geo::OSR::SpatialReference::IsSameVertCS ( scalar  rs)
Parameters
rsa Geo::OSR::SpatialReference object
Returns
boolean
Code:
click to view
public scalar Geo::OSR::SpatialReference::IsVertical ( )
Returns
boolean
Code:
click to view
public method Geo::OSR::SpatialReference::MorphFromESRI ( )
Code:
click to view
public method Geo::OSR::SpatialReference::MorphToESRI ( )
Code:
click to view
public Geo::OSR::SpatialReference Geo::OSR::SpatialReference::new ( hash  params)

Class method. Create a new spatial reference object using a named parameter. This constructor recognizes the following key words (alternative in parenthesis): WKT (Text), Proj4, ESRI, EPSG, EPSGA, PCI, USGS, GML (XML), URL, ERMapper (ERM), MapInfoCS (MICoordSys). The value depends on the key.

  • WKT: Well Known Text string
  • Proj4: PROJ.4 string
  • ESRI: reference to a list of strings (contents of ESRI .prj file)
  • EPSG: EPSG code number
  • EPSGA: EPSG code number (the resulting CS will have EPSG preferred axis ordering)
  • PCI: listref: [PCI_projection_string, Grid_units_code, [17 cs parameters]]
  • USGS: listref: [Projection_system_code, Zone, [15 cs parameters], Datum_code, Format_flag]
  • GML: GML string
  • URL: URL for downloading the spatial reference from
  • ERMapper: listref: [Projection, Datum, Units]
  • MapInfoCS: MapInfo style co-ordinate system definition

For more information, consult the import methods in OGR documentation.

Note
ImportFrom* methods also exist but are not documented here.

Usage:

$sr = Geo::OSR::SpatialReference->new( key => value );
Returns
a new Geo::OSR::SpatialReference object
Code:
click to view
public method Geo::OSR::SpatialReference::Set ( hash  params)

Set a parameter or parameters in the spatial reference object.

Parameters
paramsNamed parameters. Recognized keys and respective values are the following.
  • Authority: authority name (give also TargetKey, Node and Code)
  • TargetKey:
  • Node: partial or complete path to the target node (Node and Value together sets an attribute value)
  • Code: code for value with an authority
  • Value: value to be assigned to a node, a projection parameter or an object
  • AngularUnits: angular units for the geographic coordinate system (give also Value) (one of Geo::OSR::LinearUnits)
  • LinearUnits: linear units for the target node or the object (give also Value and optionally Node) (one of Geo::OSR::LinearUnits)
  • Parameter: projection parameter to set (give also Value and Normalized) (one of Geo::OSR::Parameters)
  • Normalized: set to true to indicate that the Value argument is in "normalized" form
  • Name: a well known name of a geographic coordinate system (e.g. WGS84)
  • GuessFrom: arbitrary text that specifies a projection ("user input")
  • LOCAL_CS: name of a local coordinate system
  • GeocentricCS: name of a geocentric coordinate system
  • VerticalCS: name of a vertical coordinate system (give also Datum and optionally VertDatumType [default is 2005])
  • Datum: a known (OGC or EPSG) name (or(?) one of Geo::OSR::Datums)
  • CoordinateSystem: 'WGS', 'UTM', 'State Plane', or a user visible name (give optionally also Parameters, Zone, North, NAD83, UnitName, UnitConversionFactor, Datum, Spheroid, HorizontalCS, and/or VerticalCS
  • Parameters: a reference to a list containing the coordinate system or projection parameters
  • Zone: zone for setting up UTM or State Plane coordinate systems (State Plane zone in USGS numbering scheme)
  • North: set false for southern hemisphere
  • NAD83: set false if the NAD27 zone definition should be used instead of NAD83
  • UnitName: to override the legal definition for a zone
  • UnitConversionFactor: to override the legal definition for a zone
  • Spheroid: user visible name
  • HorizontalCS: Horizontal coordinate system name
  • Projection: name of a projection, one of Geo::OSR::Projections (give also optionally Parameters and Variant)
Note
Numerous Set* methods also exist but are not documented here.
Code:
click to view
public method Geo::OSR::SpatialReference::StripCTParms ( )
Code:
click to view
public method Geo::OSR::SpatialReference::Validate ( )
Code:
click to view

The documentation for this class was generated from the following file: