Top

pycrs.elements.cs module

Coordinate system (CS) classes of different types.

Classes

class CS

Base class for all CS classes. Mostly just for basic type checking.

Ancestors (in MRO)

Methods

def to_epsg_code(

self)

Looks up the EPSG code for this CS.

If an exact match is found, returns the code. If there are multiple ambiguous matches, raise warning and return only the top result. If there are no matches, returns None.

class GeogCS

A geographic coordinate system where the coordinates are in the latitude-longitude space.

Attributes:

- **cs_type**: Type of CRS, always "Geographic".
- **name**: An arbitrary name given to this geographic coordinate system, to represent its unique
            configuration of datum, prime meridian, angular unit, and twin axes. The actual name
            is just for human readability, and does not actually have any implication. 
- **datum**: A pycrs.elements.datums.Datum instance, representing the shape of the earth.
- **prime_mer**: A pycrs.elements.parameters.PrimeMeridian instance, representing the prime meridian
            coordinate where the longitude is considered to be 0.
- **angunit**: A pycrs.elements.parameters.AngularUnit instance, representing the angular unit in which
            coordinates are measured.
- **twin_ax**: A pair of pycrs.elements.directions.North/South/East/West instances, one for each axis,
            representing the compass direction in which each axis increases. Defaults to East and North.

Ancestors (in MRO)

Methods

def __init__(

self, name, datum, prime_mer, angunit, twin_ax=None)

Arguments:

  • name: An arbitrary name given to this geographic coordinate system, to represent its unique configuration of datum, prime meridian, angular unit, and twin axes. The actual name is just for human readability, and does not actually have any implication.
  • datum: A pycrs.elements.datums.Datum instance, representing the shape of the earth.
  • prime_mer: A pycrs.elements.parameters.PrimeMeridian instance, representing the prime meridian coordinate where the longitude is considered to be 0.
  • angunit: A pycrs.elements.parameters.AngularUnit instance, representing the angular unit in which coordinates are measured.
  • twin_ax: A pair of pycrs.elements.directions.North/South/East/West instances, one for each axis, representing the compass direction in which each axis increases. Defaults to East and North.

def to_epsg_code(

self)

Inheritance: CS.to_epsg_code

Looks up the EPSG code for this CS.

If an exact match is found, returns the code. If there are multiple ambiguous matches, raise warning and return only the top result. If there are no matches, returns None.

def to_esri_wkt(

self)

Returns the CS as a ESRI WKT formatted string.

def to_ogc_wkt(

self)

Returns the CS as a OGC WKT formatted string.

def to_proj4(

self, as_dict=False, toplevel=True)

Returns the CS as a proj4 formatted string or dict.

Arguments:

  • as_dict (optional): If True, returns the proj4 string as a dict (defaults to False).
  • toplevel (optional): If True, treats this CS as the final toplevel CS and adds the necessary proj4 elements (defaults to True).

class ProjCS

A projected coordinate system where the coordinates are projected to euclidean x,y space.

Attributes:

  • cs_type: Type of CRS, always "Projected".
  • name: Arbitrary name of the projected coordinate system.
  • geogcs: A pycrs.elements.cs.GeogCS instance.
  • proj: A pycrs.elements.projections.Projection instance.
  • params: A list of custom parameters from the pycrs.elements.parameters module.
  • unit: A pycrs.elements.parameters.Unit instance, representing the angular unit in which coordinates are measured.
  • twin_ax: A pair of pycrs.elements.directions.North/South/East/West instances, one for each axis, representing the compass direction in which each axis increases. Defaults to East and North.

Ancestors (in MRO)

Methods

def __init__(

self, name, geogcs, proj, params, unit, twin_ax=None)

Arguments:

  • name: Arbitrary name of the projected coordinate system.
  • geogcs: A pycrs.elements.cs.GeogCS instance.
  • proj: A pycrs.elements.projections.Projection instance.
  • params: A list of custom parameters from the pycrs.elements.parameters module.
  • unit: A pycrs.elements.parameters.Unit instance, representing the angular unit in which coordinates are measured.
  • twin_ax: A pair of pycrs.elements.directions.North/South/East/West instances, one for each axis, representing the compass direction in which each axis increases. Defaults to East and North.

def to_epsg_code(

self)

Inheritance: CS.to_epsg_code

Looks up the EPSG code for this CS.

If an exact match is found, returns the code. If there are multiple ambiguous matches, raise warning and return only the top result. If there are no matches, returns None.

def to_esri_wkt(

self)

Returns the CS as a ESRI WKT formatted string.

def to_ogc_wkt(

self)

Returns the CS as a OGC WKT formatted string.

def to_proj4(

self, as_dict=False)

Returns the CS as a proj4 formatted string or dict.

Arguments:

  • as_dict (optional): If True, returns the proj4 string as a dict (defaults to False).