class SpatialReference(GDALBase): (source)
A wrapper for the OGRSpatialReference object. According to the GDAL web site, the SpatialReference object "provide[s] services to represent coordinate systems (projections and datums) and to transform between them."
Method | __getitem__ |
Return the value of the given string attribute node, None if the node doesn't exist. Can also take a tuple as a parameter, (target, child), where child is the index of the attribute in the WKT. For example:... |
Method | __init__ |
Create a GDAL OSR Spatial Reference object from the given input. The input may be string of OGC Well Known Text (WKT), an integer EPSG code, a PROJ string, and/or a projection "well known" shorthand string (one of 'WGS84', 'WGS72', 'NAD27', 'NAD83'). |
Method | __str__ |
Use 'pretty' WKT. |
Method | attr |
The attribute value for the given target node (e.g. 'PROJCS'). The index keyword specifies an index of the child node to return. |
Method | auth |
Return the authority code for the given string target node. |
Method | auth |
Return the authority name for the given string target node. |
Method | clone |
Return a clone of this SpatialReference object. |
Method | from |
Morph this SpatialReference from ESRI's format to EPSG. |
Method | identify |
This method inspects the WKT of this SpatialReference, and will add EPSG authority nodes where an EPSG identifier is applicable. |
Method | import |
Import the Spatial Reference from the EPSG code (an integer). |
Method | import |
Import the Spatial Reference from a PROJ string. |
Method | import |
Import the Spatial Reference from the given user input string. |
Method | import |
Import the Spatial Reference from OGC WKT (string) |
Method | import |
Import the Spatial Reference from an XML string. |
Method | to |
Morph this SpatialReference to ESRI's format. |
Method | validate |
Check to see if the given spatial reference is valid. |
Instance Variable | axis |
Undocumented |
Instance Variable | ptr |
Undocumented |
Property | angular |
Return the name of the angular units. |
Property | angular |
Return the value of the angular units. |
Property | ellipsoid |
Return a tuple of the ellipsoid parameters: (semimajor axis, semiminor axis, and inverse flattening) |
Property | geographic |
Return True if this SpatialReference is geographic (root node is GEOGCS). |
Property | inverse |
Return the Inverse Flattening for this Spatial Reference. |
Property | linear |
Return the name of the linear units. |
Property | linear |
Return the value of the linear units. |
Property | local |
Return True if this SpatialReference is local (root node is LOCAL_CS). |
Property | name |
Return the name of this Spatial Reference. |
Property | pretty |
Return the 'pretty' representation of the WKT. |
Property | proj |
Return the PROJ representation for this Spatial Reference. |
Property | proj4 |
Alias for proj(). |
Property | projected |
Return True if this SpatialReference is a projected coordinate system (root node is PROJCS). |
Property | semi |
Return the Semi Major Axis for this Spatial Reference. |
Property | semi |
Return the Semi Minor Axis for this Spatial Reference. |
Property | srid |
Return the SRID of top-level authority, or None if undefined. |
Property | units |
Return a 2-tuple of the units value and the units name. Automatically determine whether to return the linear or angular units. |
Property | wkt |
Return the WKT representation of this Spatial Reference. |
Property | xml |
Return the XML representation of this Spatial Reference. |
Inherited from CPointerBase
(via GDALBase
):
Method | __del__ |
Free the memory used by the C++ object. |
Method | ptr |
Undocumented |
Class Variable | destructor |
Undocumented |
Instance Variable | _ptr |
Undocumented |
Return the value of the given string attribute node, None if the node doesn't exist. Can also take a tuple as a parameter, (target, child), where child is the index of the attribute in the WKT. For example: >>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY["EPSG","4326"]]' >>> srs = SpatialReference(wkt) # could also use 'WGS84', or 4326 >>> print(srs['GEOGCS']) WGS 84 >>> print(srs['DATUM']) WGS_1984 >>> print(srs['AUTHORITY']) EPSG >>> print(srs['AUTHORITY', 1]) # The authority value 4326 >>> print(srs['TOWGS84', 4]) # the fourth value in this wkt 0 >>> # For the units authority, have to use the pipe symbole. >>> print(srs['UNIT|AUTHORITY']) EPSG >>> print(srs['UNIT|AUTHORITY', 1]) # The authority value for the units 9122
Create a GDAL OSR Spatial Reference object from the given input. The input may be string of OGC Well Known Text (WKT), an integer EPSG code, a PROJ string, and/or a projection "well known" shorthand string (one of 'WGS84', 'WGS72', 'NAD27', 'NAD83').
The attribute value for the given target node (e.g. 'PROJCS'). The index keyword specifies an index of the child node to return.
This method inspects the WKT of this SpatialReference, and will add EPSG authority nodes where an EPSG identifier is applicable.
Return a tuple of the ellipsoid parameters: (semimajor axis, semiminor axis, and inverse flattening)