Top

pycrs.parser module

The main module containing functions for parsing text strings into crs objects.

Functions

def from_epsg_code(

code)

Load crs object from epsg code, via spatialreference.org. Parses based on the proj4 representation.

Arguments:

  • code: The EPSG code as an integer.

Returns:

  • CRS object.

def from_esri_code(

code)

Load crs object from esri code, via spatialreference.org. Parses based on the proj4 representation.

Arguments:

  • code: The ESRI code as an integer.

Returns:

  • CRS object.

def from_esri_wkt(

string, strict=False)

Parse crs as esri wkt formatted string and return the resulting crs object.

Arguments:

  • string: The ESRI WKT representation as a string.
  • strict (optional): When True, the parser is strict about names having to match exactly with upper and lowercases. Default is not strict (False).

Returns:

  • CRS object.

def from_ogc_wkt(

string, strict=False)

Parse crs as ogc wkt formatted string and return the resulting crs object.

Arguments:

  • string: The OGC WKT representation as a string.
  • strict (optional): When True, the parser is strict about names having to match exactly with upper and lowercases. Default is not strict (False).

Returns:

  • CRS object.

def from_proj4(

string, strict=False)

Parse crs as proj4 formatted string and return the resulting crs object.

Arguments:

  • string: The proj4 representation as a string.
  • strict (optional): When True, the parser is strict about names having to match exactly with upper and lowercases. Default is not strict (False).

Returns:

  • CRS object.

def from_sr_code(

code)

Load crs object from sr-org code, via spatialreference.org. Parses based on the proj4 representation.

Arguments:

  • code: The SR-ORG code as an integer.

Returns:

  • CRS object.

def from_unknown_text(

text, strict=False)

Detect crs string format and parse into crs object with appropriate function.

Arguments:

  • text: The crs text representation of unknown type.
  • strict (optional): When True, the parser is strict about names having to match exactly with upper and lowercases. Default is not strict (False).

Returns:

  • CRS object.

def from_unknown_wkt(

string, strict=False)

Given an unknown wkt string, detect if uses ogc or esri flavor, and parse the crs accordingly.

Arguments:

  • string: The unknown WKT representation as a string.
  • strict (optional): When True, the parser is strict about names having to match exactly with upper and lowercases. Default is not strict (False).

Returns: - CRS object.