class_docstr: performs forward and inverse geodetic, or Great Circle,
  computations.  The forward computation (using the 'fwd' method)
  involves determining latitude, longitude and back azimuth of a
  terminus point given the latitude and longitude of an initial
  point, plus azimuth and distance. The inverse computation (using
  the 'inv' method) involves determining the forward and back
  azimuths and distance given the latitudes and longitudes of an
  initial and terminus point.
  
  Attributes
  ----------
  initstring: str
      The string form of the user input used to create the Geod.
  sphere: bool
      If True, it is a sphere.
  a: float
      The ellipsoid equatorial radius, or semi-major axis.
  b: float
      The ellipsoid polar radius, or semi-minor axis.
  es: float
      The 'eccentricity' of the ellipse, squared (1-b2/a2).
  f: float
      The ellipsoid 'flattening' parameter ( (a-b)/a ).
class_docstr_tok: ["performs","forward","and","inverse","geodetic",",","or","Great","Circle",",","computations",".","The","forward","computation","(","using","the","'fwd","'","method",")","involves","determining","latitude",",","longitude","and","back","azimuth","of","a","terminus","point","given","the","latitude","and","longitude","of","an","initial","point",",","plus","azimuth","and","distance",".","The","inverse","computation","(","using","the","'inv","'","method",")","involves","determining","the","forward","and","back","azimuths","and","distance","given","the","latitudes","and","longitudes","of","an","initial","and","terminus","point",".","Attributes","--","--","--","--","--","initstring",":","str","The","string","form","of","the","user","input","used","to","create","the","Geod",".","sphere",":","bool","If","True",",","it","is","a","sphere",".","a",":","float","The","ellipsoid","equatorial","radius",",","or","semi-major","axis",".","b",":","float","The","ellipsoid","polar","radius",",","or","semi-minor","axis",".","es",":","float","The","'eccentricity","'","of","the","ellipse",",","squared","(","1-b2\/a2",")",".","f",":","float","The","ellipsoid","'flattening","'","parameter","(","(","a-b",")","\/a",")","."]
docstr: initialize a Geod class instance.
  
  Geodetic parameters for specifying the ellipsoid
  can be given in a dictionary 'initparams', as keyword arguments,
  or as as proj geod initialization string.
  
  You can get a dictionary of ellipsoids using :func:`pyproj.get_ellps_map`
  or with the variable `pyproj.pj_ellps`.
  
  The parameters of the ellipsoid may also be set directly using
  the 'a' (semi-major or equatorial axis radius) keyword, and
  any one of the following keywords: 'b' (semi-minor,
  or polar axis radius), 'e' (eccentricity), 'es' (eccentricity
  squared), 'f' (flattening), or 'rf' (reciprocal flattening).
  
  See the proj documentation (https://proj.org) for more
  information about specifying ellipsoid parameters.
  
  Example usage:
  
  >>> from pyproj import Geod
  >>> g = Geod(ellps='clrk66') # Use Clarke 1866 ellipsoid.
  >>> # specify the lat/lons of some cities.
  >>> boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)
  >>> portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)
  >>> newyork_lat = 40.+(47./60.); newyork_lon = -73.-(58./60.)
  >>> london_lat = 51.+(32./60.); london_lon = -(5./60.)
  >>> # compute forward and back azimuths, plus distance
  >>> # between Boston and Portland.
  >>> az12,az21,dist = g.inv(boston_lon,boston_lat,portland_lon,portland_lat)
  >>> f"{az12:.3f} {az21:.3f} {dist:.3f}"
  '-66.531 75.654 4164192.708'
  >>> # compute latitude, longitude and back azimuth of Portland,
  >>> # given Boston lat/lon, forward azimuth and distance to Portland.
  >>> endlon, endlat, backaz = g.fwd(boston_lon, boston_lat, az12, dist)
  >>> f"{endlat:.3f} {endlon:.3f} {backaz:.3f}"
  '45.517 -123.683 75.654'
  >>> # compute the azimuths, distances from New York to several
  >>> # cities (pass a list)
  >>> lons1 = 3*[newyork_lon]; lats1 = 3*[newyork_lat]
  >>> lons2 = [boston_lon, portland_lon, london_lon]
  >>> lats2 = [boston_lat, portland_lat, london_lat]
  >>> az12,az21,dist = g.inv(lons1,lats1,lons2,lats2)
  >>> for faz, baz, d in list(zip(az12,az21,dist)):
  ...     f"{faz:7.3f} {baz:8.3f} {d:12.3f}"
  ' 54.663 -123.448   288303.720'
  '-65.463   79.342  4013037.318'
  ' 51.254  -71.576  5579916.651'
  >>> g2 = Geod('+ellps=clrk66') # use proj4 style initialization string
  >>> az12,az21,dist = g2.inv(boston_lon,boston_lat,portland_lon,portland_lat)
  >>> f"{az12:.3f} {az21:.3f} {dist:.3f}"
  '-66.531 75.654 4164192.708'
docstr_tok: ["initialize","a","Geod","class","instance",".","Geodetic","parameters","for","specifying","the","ellipsoid","can","be","given","in","a","dictionary","'initparams","'",",","as","keyword","arguments",",","or","as","as","proj","geod","initialization","string",".","You","can","get","a","dictionary","of","ellipsoids","using",":","func",":","`","pyproj.get_ellps_map","`","or","with","the","variable","`","pyproj.pj_ellps","`",".","The","parameters","of","the","ellipsoid","may","also","be","set","directly","using","the","'","a","'","(","semi-major","or","equatorial","axis","radius",")","keyword",",","and","any","one","of","the","following","keywords",":","'","b","'","(","semi-minor",",","or","polar","axis","radius",")",",","'","e","'","(","eccentricity",")",",","'es","'","(","eccentricity","squared",")",",","'","f","'","(","flattening",")",",","or","'rf","'","(","reciprocal","flattening",")",".","See","the","proj","documentation","(","https",":","\/\/proj.org",")","for","more","information","about","specifying","ellipsoid","parameters",".","Example","usage",":",">",">",">","from","pyproj","import","Geod",">",">",">","g","=","Geod","(","ellps='clrk66","'",")","#","Use","Clarke","1866","ellipsoid",".",">",">",">","#","specify","the","lat\/lons","of","some","cities",".",">",">",">","boston_lat","=","42.+","(","15.\/60",".",")",";","boston_lon","=","-71.-","(","7.\/60",".",")",">",">",">","portland_lat","=","45.+","(","31.\/60",".",")",";","portland_lon","=","-123.-","(","41.\/60",".",")",">",">",">","newyork_lat","=","40.+","(","47.\/60",".",")",";","newyork_lon","=","-73.-","(","58.\/60",".",")",">",">",">","london_lat","=","51.+","(","32.\/60",".",")",";","london_lon","=","-","(","5.\/60",".",")",">",">",">","#","compute","forward","and","back","azimuths",",","plus","distance",">",">",">","#","between","Boston","and","Portland",".",">",">",">","az12",",","az21",",","dist","=","g.inv","(","boston_lon",",","boston_lat",",","portland_lon",",","portland_lat",")",">",">",">","f","''","{","az12",":",".3f","}","{","az21",":",".3f","}","{","dist",":",".3f","}","''","'-66.531","75.654","4164192.708'",">",">",">","#","compute","latitude",",","longitude","and","back","azimuth","of","Portland",",",">",">",">","#","given","Boston","lat\/lon",",","forward","azimuth","and","distance","to","Portland",".",">",">",">","endlon",",","endlat",",","backaz","=","g.fwd","(","boston_lon",",","boston_lat",",","az12",",","dist",")",">",">",">","f","''","{","endlat",":",".3f","}","{","endlon",":",".3f","}","{","backaz",":",".3f","}","''","'45.517","-123.683","75.654'",">",">",">","#","compute","the","azimuths",",","distances","from","New","York","to","several",">",">",">","#","cities","(","pass","a","list",")",">",">",">","lons1","=","3","*","[","newyork_lon","]",";","lats1","=","3","*","[","newyork_lat","]",">",">",">","lons2","=","[","boston_lon",",","portland_lon",",","london_lon","]",">",">",">","lats2","=","[","boston_lat",",","portland_lat",",","london_lat","]",">",">",">","az12",",","az21",",","dist","=","g.inv","(","lons1",",","lats1",",","lons2",",","lats2",")",">",">",">","for","faz",",","baz",",","d","in","list","(","zip","(","az12",",","az21",",","dist",")",")",":","...","f","''","{","faz:7.3f","}","{","baz:8.3f","}","{","d:12.3f","}","''","'","54.663","-123.448","288303.720'","'-65.463","79.342","4013037.318'","'","51.254","-71.576","5579916.651'",">",">",">","g2","=","Geod","(","'+ellps=clrk66","'",")","#","use","proj4","style","initialization","string",">",">",">","az12",",","az21",",","dist","=","g2.inv","(","boston_lon",",","boston_lat",",","portland_lon",",","portland_lat",")",">",">",">","f","''","{","az12",":",".3f","}","{","az21",":",".3f","}","{","dist",":",".3f","}","''","'-66.531","75.654","4164192.708","'"]
code: def __init__(self, initstring: str | None = None, **kwargs) -> None:
      """
      initialize a Geod class instance.
  
      Geodetic parameters for specifying the ellipsoid
      can be given in a dictionary 'initparams', as keyword arguments,
      or as as proj geod initialization string.
  
      You can get a dictionary of ellipsoids using :func:`pyproj.get_ellps_map`
      or with the variable `pyproj.pj_ellps`.
  
      The parameters of the ellipsoid may also be set directly using
      the 'a' (semi-major or equatorial axis radius) keyword, and
      any one of the following keywords: 'b' (semi-minor,
      or polar axis radius), 'e' (eccentricity), 'es' (eccentricity
      squared), 'f' (flattening), or 'rf' (reciprocal flattening).
  
      See the proj documentation (https://proj.org) for more
      information about specifying ellipsoid parameters.
  
      Example usage:
  
      >>> from pyproj import Geod
      >>> g = Geod(ellps='clrk66') # Use Clarke 1866 ellipsoid.
      >>> # specify the lat/lons of some cities.
      >>> boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)
      >>> portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)
      >>> newyork_lat = 40.+(47./60.); newyork_lon = -73.-(58./60.)
      >>> london_lat = 51.+(32./60.); london_lon = -(5./60.)
      >>> # compute forward and back azimuths, plus distance
      >>> # between Boston and Portland.
      >>> az12,az21,dist = g.inv(boston_lon,boston_lat,portland_lon,portland_lat)
      >>> f"{az12:.3f} {az21:.3f} {dist:.3f}"
      '-66.531 75.654 4164192.708'
      >>> # compute latitude, longitude and back azimuth of Portland,
      >>> # given Boston lat/lon, forward azimuth and distance to Portland.
      >>> endlon, endlat, backaz = g.fwd(boston_lon, boston_lat, az12, dist)
      >>> f"{endlat:.3f} {endlon:.3f} {backaz:.3f}"
      '45.517 -123.683 75.654'
      >>> # compute the azimuths, distances from New York to several
      >>> # cities (pass a list)
      >>> lons1 = 3*[newyork_lon]; lats1 = 3*[newyork_lat]
      >>> lons2 = [boston_lon, portland_lon, london_lon]
      >>> lats2 = [boston_lat, portland_lat, london_lat]
      >>> az12,az21,dist = g.inv(lons1,lats1,lons2,lats2)
      >>> for faz, baz, d in list(zip(az12,az21,dist)):
      ...     f"{faz:7.3f} {baz:8.3f} {d:12.3f}"
      ' 54.663 -123.448   288303.720'
      '-65.463   79.342  4013037.318'
      ' 51.254  -71.576  5579916.651'
      >>> g2 = Geod('+ellps=clrk66') # use proj4 style initialization string
      >>> az12,az21,dist = g2.inv(boston_lon,boston_lat,portland_lon,portland_lat)
      >>> f"{az12:.3f} {az21:.3f} {dist:.3f}"
      '-66.531 75.654 4164192.708'
      """
      # if initparams is a proj-type init string,
      # convert to dict.
      ellpsd: dict[str, str | float] = {}
      if initstring is not None:
          for kvpair in initstring.split():
              # Actually only +a and +b are needed
              # We can ignore safely any parameter that doesn't have a value
              if kvpair.find("=") == -1:
                  continue
              key, val = kvpair.split("=")
              key = key.lstrip("+")
              if key in ["a", "b", "rf", "f", "es", "e"]:
                  ellpsd[key] = float(val)
              else:
                  ellpsd[key] = val
      # merge this dict with kwargs dict.
      kwargs = dict(list(kwargs.items()) + list(ellpsd.items()))
      sphere = False
      if "ellps" in kwargs:
          (
              semi_major_axis,
              semi_minor_axis,
              flattening,
              eccentricity_squared,
              sphere,
          ) = _params_from_ellps_map(kwargs["ellps"])
      else:
          (
              semi_major_axis,
              semi_minor_axis,
              flattening,
              eccentricity_squared,
          ) = _params_from_kwargs(kwargs)
  
      if math.fabs(flattening) < 1.0e-8:
          sphere = True
  
      super().__init__(
          semi_major_axis,
          flattening,
          sphere,
          semi_minor_axis,
          eccentricity_squared,
      )
  
imports: import math
  import warnings
  from typing import Any
  from pyproj._geod import Geod
  from pyproj._geod import GeodIntermediateReturn, geodesic_version_str
  from pyproj._geod import reverse_azimuth
  from pyproj.enums import GeodIntermediateFlag
  from pyproj.exceptions import GeodError
  from pyproj.list import get_ellps_map
  from pyproj.utils import DataType, _convertback, _copytobuffer
label_desc: Use image node_id 1 to create a new Geod object from inherited base classes: _Geod with example: obj = Geod(initstring)