Geo::GDAL  2.4
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 AddGuessedTOWGS84 ()
 
public method As ()
 
public method AutoIdentifyEPSG ()
 
public Geo::OSR::SpatialReference Clone ()
 
public Geo::OSR::SpatialReference CloneGeogCS ()
 
public method ConvertToOtherProjection ()
 
public method CopyGeogCSFrom (scalar rhs)
 
public method DemoteTo2D ()
 
public method EPSGTreatsAsLatLong ()
 
public method EPSGTreatsAsNorthingEasting ()
 
public method Export (scalar format)
 
public method ExportToPROJJSON ()
 
public scalar GetAngularUnits ()
 
public method GetAngularUnitsName ()
 
public method GetAreaOfUse ()
 
public scalar GetAttrValue (scalar name, scalar child=0)
 
public scalar GetAuthorityCode (scalar target_key)
 
public scalar GetAuthorityName (scalar target_key)
 
public method GetAxesCount ()
 
public method GetAxisMappingStrategy ()
 
public method GetAxisName ()
 
public method GetAxisOrientation ()
 
public method GetDataAxisToSRSAxisMapping ()
 
public method GetInvFlattening ()
 
public scalar GetLinearUnits ()
 
public scalar GetLinearUnitsName ()
 
public method GetName ()
 
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 GetTargetLinearUnits ()
 
public method GetUTMZone ()
 
public method HasTOWGS84 ()
 
public method ImportFromOzi ()
 
public scalar IsCompound ()
 
public method IsDerivedGeographic ()
 
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 PromoteTo3D ()
 
public method Set (hash params)
 
public method SetAxisMappingStrategy ()
 
public method SetDataAxisToSRSAxisMapping ()
 
public method SetMercator2SP ()
 
public method SetVerticalPerspective ()
 
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 method GetPROJSearchPaths ()
 
public method GetPROJVersionMajor ()
 
public method GetPROJVersionMicro ()
 
public method GetPROJVersionMinor ()
 
public scalar GetUserInputAsWKT (scalar name)
 
public scalar GetWellKnownGeogCSAsWKT (scalar name)
 Get well known geographic coordinate system as WKT
More...
 
public list LinearUnits ()
 
public method OAMS_AUTHORITY_COMPLIANT ()
 
public method OAMS_CUSTOM ()
 
public method OAMS_TRADITIONAL_GIS_ORDER ()
 
public method OAO_Down ()
 
public method OAO_East ()
 
public method OAO_North ()
 
public method OAO_Other ()
 
public method OAO_South ()
 
public method OAO_Up ()
 
public method OAO_West ()
 
public method OSRAreaOfUse_east_lon_degree_get ()
 
public method OSRAreaOfUse_name_get ()
 
public method OSRAreaOfUse_north_lat_degree_get ()
 
public method OSRAreaOfUse_south_lat_degree_get ()
 
public method OSRAreaOfUse_west_lon_degree_get ()
 
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_LAT_LONG ()
 
public method SetPROJSearchPath ()
 
public method SetPROJSearchPaths ()
 

Detailed Description

A spatial reference system.

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

Definition at line 18373 of file all.pm.

Member Function Documentation

◆ AddGuessedTOWGS84()

public method Geo::OSR::SpatialReference::AddGuessedTOWGS84 ( )


Code:
click to view

◆ As()

public method Geo::OSR::SpatialReference::As ( )


Code:
click to view

◆ AutoIdentifyEPSG()

public method Geo::OSR::SpatialReference::AutoIdentifyEPSG ( )

Object method.
Set EPSG authority info if possible.

Code:
click to view

◆ Clone()

public Geo::OSR::SpatialReference Geo::OSR::SpatialReference::Clone ( )

Object method.
Make a duplicate of this SpatialReference object.

Returns
a new Geo::OSR::SpatialReference object

Code:
click to view

◆ CloneGeogCS()

public Geo::OSR::SpatialReference Geo::OSR::SpatialReference::CloneGeogCS ( )

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

Returns
a new Geo::OSR::SpatialReference object

Code:
click to view

◆ ConvertToOtherProjection()

public method Geo::OSR::SpatialReference::ConvertToOtherProjection ( )


Code:
click to view

◆ CopyGeogCSFrom()

public method Geo::OSR::SpatialReference::CopyGeogCSFrom ( scalar  rhs)

Object method.

Parameters
rhsGeo::OSR::SpatialReference

Code:
click to view

◆ DemoteTo2D()

public method Geo::OSR::SpatialReference::DemoteTo2D ( )


Code:
click to view

◆ EPSGTreatsAsLatLong()

public method Geo::OSR::SpatialReference::EPSGTreatsAsLatLong ( )

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

Code:
click to view

◆ EPSGTreatsAsNorthingEasting()

public method Geo::OSR::SpatialReference::EPSGTreatsAsNorthingEasting ( )


Code:
click to view

◆ Export()

public method Geo::OSR::SpatialReference::Export ( scalar  format)

Object method.
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

◆ ExportToPROJJSON()

public method Geo::OSR::SpatialReference::ExportToPROJJSON ( )


Code:
click to view

◆ GetAngularUnits()

public scalar Geo::OSR::SpatialReference::GetAngularUnits ( )

Object method.

Returns
a number

Code:
click to view

◆ GetAngularUnitsName()

public method Geo::OSR::SpatialReference::GetAngularUnitsName ( )


Code:
click to view

◆ GetAreaOfUse()

public method Geo::OSR::SpatialReference::GetAreaOfUse ( )


Code:
click to view

◆ GetAttrValue()

public scalar Geo::OSR::SpatialReference::GetAttrValue ( scalar  name,
scalar  child = 0 
)

Object method.

Parameters
name
child
Returns
string

Code:
click to view

◆ GetAuthorityCode()

public scalar Geo::OSR::SpatialReference::GetAuthorityCode ( scalar  target_key)

Object method.

Parameters
target_key
Returns
string

Code:
click to view

◆ GetAuthorityName()

public scalar Geo::OSR::SpatialReference::GetAuthorityName ( scalar  target_key)

Object method.

Parameters
target_key
Returns
string

Code:
click to view

◆ GetAxesCount()

public method Geo::OSR::SpatialReference::GetAxesCount ( )


Code:
click to view

◆ GetAxisMappingStrategy()

public method Geo::OSR::SpatialReference::GetAxisMappingStrategy ( )


Code:
click to view

◆ GetAxisName()

public method Geo::OSR::SpatialReference::GetAxisName ( )


Code:
click to view

◆ GetAxisOrientation()

public method Geo::OSR::SpatialReference::GetAxisOrientation ( )


Code:
click to view

◆ GetDataAxisToSRSAxisMapping()

public method Geo::OSR::SpatialReference::GetDataAxisToSRSAxisMapping ( )


Code:
click to view

◆ GetInvFlattening()

public method Geo::OSR::SpatialReference::GetInvFlattening ( )

Object method.

Code:
click to view

◆ GetLinearUnits()

public scalar Geo::OSR::SpatialReference::GetLinearUnits ( )

Object method.

Returns
a number

Code:
click to view

◆ GetLinearUnitsName()

public scalar Geo::OSR::SpatialReference::GetLinearUnitsName ( )

Object method.

Returns
string

Code:
click to view

◆ GetName()

public method Geo::OSR::SpatialReference::GetName ( )


Code:
click to view

◆ GetNormProjParm()

public scalar Geo::OSR::SpatialReference::GetNormProjParm ( scalar  name,
scalar  default_val = 0.0 
)

Object method.

Parameters
name
default_val
Returns
a number

Code:
click to view

◆ GetProjParm()

public scalar Geo::OSR::SpatialReference::GetProjParm ( scalar  name,
scalar  default_val = 0.0 
)

Object method.

Parameters
name
default_val
Returns
a number

Code:
click to view

◆ GetSemiMajor()

public method Geo::OSR::SpatialReference::GetSemiMajor ( )

Object method.

Code:
click to view

◆ GetSemiMinor()

public method Geo::OSR::SpatialReference::GetSemiMinor ( )

Object method.

Code:
click to view

◆ GetTargetLinearUnits()

public method Geo::OSR::SpatialReference::GetTargetLinearUnits ( )


Code:
click to view

◆ GetTOWGS84()

public method Geo::OSR::SpatialReference::GetTOWGS84 ( )

Object method.

Returns
array = ($p1, $p2, $p3, $p4, $p5, $p6, $p7)

Code:
click to view

◆ GetUTMZone()

public method Geo::OSR::SpatialReference::GetUTMZone ( )

Object method.
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

◆ HasTOWGS84()

public method Geo::OSR::SpatialReference::HasTOWGS84 ( )


Code:
click to view

◆ ImportFromOzi()

public method Geo::OSR::SpatialReference::ImportFromOzi ( )


Code:
click to view

◆ IsCompound()

public scalar Geo::OSR::SpatialReference::IsCompound ( )

Object method.

Returns
boolean

Code:
click to view

◆ IsDerivedGeographic()

public method Geo::OSR::SpatialReference::IsDerivedGeographic ( )


Code:
click to view

◆ IsGeocentric()

public scalar Geo::OSR::SpatialReference::IsGeocentric ( )

Object method.

Returns
boolean

Code:
click to view

◆ IsGeographic()

public scalar Geo::OSR::SpatialReference::IsGeographic ( )

Object method.

Returns
boolean

Code:
click to view

◆ IsLocal()

public scalar Geo::OSR::SpatialReference::IsLocal ( )

Object method.

Returns
boolean

Code:
click to view

◆ IsProjected()

public scalar Geo::OSR::SpatialReference::IsProjected ( )

Object method.

Returns
boolean

Code:
click to view

◆ IsSame()

public scalar Geo::OSR::SpatialReference::IsSame ( scalar  rs)

Object method.

Parameters
rsa Geo::OSR::SpatialReference object
Returns
boolean

Code:
click to view

◆ IsSameGeogCS()

public scalar Geo::OSR::SpatialReference::IsSameGeogCS ( scalar  rs)

Object method.

Parameters
rsa Geo::OSR::SpatialReference object
Returns
boolean

Code:
click to view

◆ IsSameVertCS()

public scalar Geo::OSR::SpatialReference::IsSameVertCS ( scalar  rs)

Object method.

Parameters
rsa Geo::OSR::SpatialReference object
Returns
boolean

Code:
click to view

◆ IsVertical()

public scalar Geo::OSR::SpatialReference::IsVertical ( )

Object method.

Returns
boolean

Code:
click to view

◆ MorphFromESRI()

public method Geo::OSR::SpatialReference::MorphFromESRI ( )

Object method.

Code:
click to view

◆ MorphToESRI()

public method Geo::OSR::SpatialReference::MorphToESRI ( )

Object method.

Code:
click to view

◆ new()

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:
<br>$sr = Geo::OSR::SpatialReference->new( key => value );
<br>

Returns
a new Geo::OSR::SpatialReference object

Code:
click to view

◆ PromoteTo3D()

public method Geo::OSR::SpatialReference::PromoteTo3D ( )


Code:
click to view

◆ Set()

public method Geo::OSR::SpatialReference::Set ( hash  params)

Object method.
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

◆ SetAxisMappingStrategy()

public method Geo::OSR::SpatialReference::SetAxisMappingStrategy ( )


Code:
click to view

◆ SetDataAxisToSRSAxisMapping()

public method Geo::OSR::SpatialReference::SetDataAxisToSRSAxisMapping ( )


Code:
click to view

◆ SetMercator2SP()

public method Geo::OSR::SpatialReference::SetMercator2SP ( )


Code:
click to view

◆ SetVerticalPerspective()

public method Geo::OSR::SpatialReference::SetVerticalPerspective ( )


Code:
click to view

◆ Validate()

public method Geo::OSR::SpatialReference::Validate ( )

Object method.

Code:
click to view


The documentation for this class was generated from the following file:
Geo::OSR::SpatialReference::AutoIdentifyEPSG
public method AutoIdentifyEPSG()
Geo::OSR::SpatialReference::GetAuthorityName
public scalar GetAuthorityName(scalar target_key)
Geo::OSR::SpatialReference::GetProjParm
public scalar GetProjParm(scalar name, scalar default_val=0.0)
Geo::OSR::SpatialReference::EPSGTreatsAsNorthingEasting
public method EPSGTreatsAsNorthingEasting()
Geo::OSR::SpatialReference::ExportToPROJJSON
public method ExportToPROJJSON()
Geo::OSR::Parameters
public list Parameters()
Geo::OSR::SpatialReference::GetAreaOfUse
public method GetAreaOfUse()
Geo::OSR::SpatialReference::IsGeocentric
public scalar IsGeocentric()
Geo::OSR::AngularUnits
public list AngularUnits()
Geo::OSR::SpatialReference::GetAxisMappingStrategy
public method GetAxisMappingStrategy()
Geo::OSR::SpatialReference::GetAxisName
public method GetAxisName()
Geo::OSR::SpatialReference::IsDerivedGeographic
public method IsDerivedGeographic()
Geo::OSR::SpatialReference::IsSame
public scalar IsSame(scalar rs)
Geo::OSR::SpatialReference::GetSemiMajor
public method GetSemiMajor()
Geo::OSR::SpatialReference::As
public method As()
Geo::OSR::SpatialReference::GetTargetLinearUnits
public method GetTargetLinearUnits()
Geo::OSR::SpatialReference::GetInvFlattening
public method GetInvFlattening()
Geo::OSR::SpatialReference::IsProjected
public scalar IsProjected()
Geo::OSR::SpatialReference::Clone
public Geo::OSR::SpatialReference Clone()
Geo::OSR::SpatialReference::MorphToESRI
public method MorphToESRI()
Geo::OSR::SpatialReference::Validate
public method Validate()
Geo::OSR::SpatialReference::Set
public method Set(hash params)
Geo::OSR::SpatialReference::GetAxesCount
public method GetAxesCount()
Geo::OSR::SpatialReference::GetAngularUnitsName
public method GetAngularUnitsName()
Geo::OSR::SpatialReference::IsCompound
public scalar IsCompound()
Geo::OSR::SpatialReference::HasTOWGS84
public method HasTOWGS84()
Geo::OSR::SpatialReference::MorphFromESRI
public method MorphFromESRI()
Geo::OSR::SpatialReference::IsSameGeogCS
public scalar IsSameGeogCS(scalar rs)
Geo::OSR::SpatialReference::GetAttrValue
public scalar GetAttrValue(scalar name, scalar child=0)
Geo::OSR::SpatialReference::GetNormProjParm
public scalar GetNormProjParm(scalar name, scalar default_val=0.0)
Geo::OSR::SpatialReference
A spatial reference system.
Definition: all.pm:18374
Geo::OSR::SpatialReference::CloneGeogCS
public Geo::OSR::SpatialReference CloneGeogCS()
Geo::OSR::SpatialReference::GetAngularUnits
public scalar GetAngularUnits()
Geo::OSR::SpatialReference::SetAxisMappingStrategy
public method SetAxisMappingStrategy()
Geo::OSR::LinearUnits
public list LinearUnits()
Geo::OSR::SpatialReference::IsSameVertCS
public scalar IsSameVertCS(scalar rs)
Geo::OSR::SpatialReference::SetMercator2SP
public method SetMercator2SP()
Geo::OSR::SpatialReference::IsVertical
public scalar IsVertical()
Geo::OSR::SpatialReference::GetSemiMinor
public method GetSemiMinor()
Geo::OSR::SpatialReference::GetUTMZone
public method GetUTMZone()
Geo::OSR::SpatialReference::GetLinearUnits
public scalar GetLinearUnits()
Geo::OSR::SpatialReference::EPSGTreatsAsLatLong
public method EPSGTreatsAsLatLong()
Geo::OSR::SpatialReference::SetDataAxisToSRSAxisMapping
public method SetDataAxisToSRSAxisMapping()
Geo::OSR::SpatialReference::IsLocal
public scalar IsLocal()
Geo::OSR::SpatialReference::GetName
public method GetName()
Geo::OSR::SpatialReference::Export
public method Export(scalar format)
Geo::OSR::SpatialReference::GetTOWGS84
public method GetTOWGS84()
Geo::OSR::SpatialReference::GetLinearUnitsName
public scalar GetLinearUnitsName()
Geo::OSR::SpatialReference::IsGeographic
public scalar IsGeographic()
Geo::OSR::SpatialReference::GetDataAxisToSRSAxisMapping
public method GetDataAxisToSRSAxisMapping()
Geo::OSR::SpatialReference::DemoteTo2D
public method DemoteTo2D()
Geo::OSR::SpatialReference::GetAxisOrientation
public method GetAxisOrientation()
Geo::OSR::SpatialReference::ImportFromOzi
public method ImportFromOzi()
Geo::OSR::SpatialReference::AddGuessedTOWGS84
public method AddGuessedTOWGS84()
Geo::OSR::SpatialReference::GetAuthorityCode
public scalar GetAuthorityCode(scalar target_key)
Geo::OSR::SpatialReference::CopyGeogCSFrom
public method CopyGeogCSFrom(scalar rhs)
Geo::OSR::SpatialReference::SetVerticalPerspective
public method SetVerticalPerspective()
Geo::OSR::SpatialReference::PromoteTo3D
public method PromoteTo3D()
Geo::OSR::SpatialReference::ConvertToOtherProjection
public method ConvertToOtherProjection()
Geo::OSR::SpatialReference::new
public Geo::OSR::SpatialReference new(hash params)