xproj.get_common_crs

Contents

xproj.get_common_crs#

xproj.get_common_crs(crs_objs, on_undefined_crs='warn', stacklevel=3)#

Try getting a common, unique CRS from an input sequence of (possibly undefined) CRS objects.

Parameters:
  • crs_objs (sequence or set) – Sequence of either pyproj.CRS objects or None (undefined CRS).

  • on_undefined_crs ({"raise", "warn", "ignore"}, optional) – If “raise”, raises a ValueError if a non-null CRS is found but one or more inputs have undefined CRS. If “warn” (default), emits a UserWarning instead. If “ignore”, do nothing.

  • stacklevel (int, optional) – Stack level value used for the emitted warning (default: 3).

Returns:

pyproj.crs.CRS or None – The common (possibly undefined) CRS.

Raises:

ValueError – If multiple conflicting CRS objects are found.

Warns:

UserWarning – If a common, unique CRS is found but one or more of the inputs have undefined CRS.