:py:mod:`geovista.gridlines`
============================

.. py:module:: geovista.gridlines

.. autoapi-nested-parse::

   Provides graticule support and other geographical lines of interest for geolocation.

   Notes
   -----
   .. versionadded:: 0.3.0

   ..
       !! processed by numpydoc !!


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   geovista.gridlines.GraticuleGrid



Functions
~~~~~~~~~

.. autoapisummary::

   geovista.gridlines.create_meridian_labels
   geovista.gridlines.create_meridians
   geovista.gridlines.create_parallel_labels
   geovista.gridlines.create_parallels



Attributes
~~~~~~~~~~

.. autoapisummary::

   geovista.gridlines.GRATICULE_CLOSED_INTERVAL
   geovista.gridlines.GRATICULE_ZLEVEL
   geovista.gridlines.LABEL_DEGREE
   geovista.gridlines.LABEL_EAST
   geovista.gridlines.LABEL_NORTH
   geovista.gridlines.LABEL_SOUTH
   geovista.gridlines.LABEL_WEST
   geovista.gridlines.LATITUDE_N_SAMPLES
   geovista.gridlines.LATITUDE_POLES_LABEL
   geovista.gridlines.LATITUDE_POLES_PARALLEL
   geovista.gridlines.LATITUDE_START
   geovista.gridlines.LATITUDE_STEP
   geovista.gridlines.LATITUDE_STEP_PERIOD
   geovista.gridlines.LATITUDE_STOP
   geovista.gridlines.LONGITUDE_N_SAMPLES
   geovista.gridlines.LONGITUDE_START
   geovista.gridlines.LONGITUDE_STEP
   geovista.gridlines.LONGITUDE_STEP_PERIOD
   geovista.gridlines.LONGITUDE_STOP


.. py:class:: GraticuleGrid

   
   Graticule composed of a block of meshes, labels and their points.













   .. rubric:: Notes

   .. versionadded:: 0.3.0



   ..
       !! processed by numpydoc !!

   .. py:attribute:: blocks
      :type:  pv


   .. py:attribute:: labels
      :type:  list[str]


   .. py:attribute:: lonlat
      :type:  numpy.typing.ArrayLike


   .. py:attribute:: mask
      :type:  numpy.typing.ArrayLike
      :value: None



.. py:function:: create_meridian_labels(lons)

   
   Generate labels for the meridians.


   :Parameters:

       **lons** : :class:`python:list` of :class:`python:float`
           The meridian lines that require a label of their location east or west relative
           to the prime meridian.



   :Returns:

       :class:`python:list` of :class:`python:str`
           The sequence of string labels for each meridian line.








   .. rubric:: Notes

   .. versionadded:: 0.3.0



   ..
       !! processed by numpydoc !!

.. py:function:: create_meridians(start = None, stop = None, step = None, lat_step = None, n_samples = None, closed_interval = None, central_meridian = None, radius = None, zlevel = None, zscale = None)

   
   Generate graticule lines of constant longitude (meridians) with labels.


   :Parameters:

       **start** : :class:`python:float`, optional
           The first line of longitude (degrees). The graticule will include this
           meridian. Defaults to :data:`LONGITUDE_START`.

       **stop** : :class:`python:float`, optional
           The last line of longitude (degrees). The graticule will include this meridian
           when it is a multiple of ``step``. Also see ``closed_interval``. Defaults to
           :data:`LONGITUDE_STOP`.

       **step** : :class:`python:float`, optional
           The delta (degrees) between neighbouring meridians. Defaults to
           :data:`LONGITUDE_STEP`.

       **lat_step** : :class:`python:float`, optional
           The delta (degrees) between neighbouring parallels. Sets the
           frequency of the labels. Defaults to :data:`LATITUDE_STEP`.

       **n_samples** : :class:`python:int`, optional
           The number of points in a single line of longitude. Defaults to
           :data:`LONGITUDE_N_SAMPLES`.

       **closed_interval** : :class:`python:bool`, default=False
           Longitude values will be in the half-closed interval [-180, 180). Otherwise,
           longitudes will be in the closed interval [-180, 180]. Defaults to
           :data:`GRATICULE_CLOSED_INTERVAL`.

       **central_meridian** : :class:`python:float`, optional
           The central meridian of the longitude range. Defaults to
           :data:`geovista.common.CENTRAL_MERIDIAN`.

       **radius** : :class:`python:float`, optional
           The radius of the sphere. Defaults to :data:`geovista.common.RADIUS`.

       **zlevel** : :class:`python:int`, optional
           The z-axis level. Used in combination with the `zscale` to offset the
           `radius` by a proportional amount i.e., ``radius * zlevel * zscale``. Defaults
           to :data:`GRATICULE_ZLEVEL`.

       **zscale** : :class:`python:float`, optional
           The proportional multiplier for z-axis `zlevel`. Defaults to
           :data:`geovista.common.ZLEVEL_SCALE`.



   :Returns:

       :obj:`GraticuleGrid`
           The graticule meridians and points with labels on those meridians.








   .. rubric:: Notes

   .. versionadded:: 0.3.0



   ..
       !! processed by numpydoc !!

.. py:function:: create_parallel_labels(lats, poles_parallel = None)

   
   Generate labels for the parallels.


   :Parameters:

       **lats** : :class:`python:list` of :class:`python:float`
           The lines of latitude that require a label of their location north or
           south relative to the equator.

       **poles_parallel** : :class:`python:bool`, optional
           Whether to generate a label for the north/south poles. Defaults to
           :data:`LATITUDE_POLES_PARALLEL`.



   :Returns:

       :class:`python:list` of :class:`python:str`
           The sequence of string labels for each line of latitude.








   .. rubric:: Notes

   .. versionadded:: 0.3.0



   ..
       !! processed by numpydoc !!

.. py:function:: create_parallels(start = None, stop = None, step = None, lon_step = None, n_samples = None, poles_parallel = None, poles_label = None, radius = None, zlevel = None, zscale = None)

   
   Generate graticule lines of constant latitude (parallels) with labels.


   :Parameters:

       **start** : :class:`python:float`, optional
           The first line of latitude (degrees). The graticule will include this
           parallel. Also see ``poles_parallel``. Defaults to :data:`LATITUDE_START`.

       **stop** : :class:`python:float`, optional
           The last line of latitude (degrees). The graticule will include this parallel
           when it is a multiple of ``step``. Also see ``poles_parallel``. Defaults to
           :data:`LATITUDE_STOP`.

       **step** : :class:`python:float`, optional
           The delta (degrees) between neighbouring parallels. Defaults to
           :data:`LATITUDE_STEP`.

       **lon_step** : :class:`python:float`, optional
           The delta (degrees) between neighbouring meridians. Sets the
           frequency of the labels. Defaults to
           :data:`LONGITUDE_STEP`.

       **n_samples** : :class:`python:int`, optional
           The number of points in a single line of latitude. Defaults to
           :data:`LATITUDE_N_SAMPLES`.

       **poles_parallel** : :class:`python:bool`, optional
           Whether to create a line of latitude at the north/south poles. Also see
           ``poles_label``. Defaults to :data:`LATITUDE_POLES_PARALLEL`.

       **poles_label** : :class:`python:bool`, optional
           Whether to create a single north/south pole label. Only applies when
           ``poles_parallel=False``. Defaults to :data:`LATITUDE_POLES_LABEL`.

       **radius** : :class:`python:float`, optional
           The radius of the sphere. Defaults to :data:`geovista.common.RADIUS`.

       **zlevel** : :class:`python:int`, optional
           The z-axis level. Used in combination with the `zscale` to offset the
           `radius` by a proportional amount i.e., ``radius * zlevel * zscale``. Defaults
           to :data:`GRATICULE_ZLEVEL`.

       **zscale** : :class:`python:float`, optional
           The proportional multiplier for z-axis `zlevel`. Defaults to
           :data:`geovista.common.ZLEVEL_SCALE`.



   :Returns:

       :obj:`GraticuleGrid`
           The graticule parallels and points with labels on the parallels.








   .. rubric:: Notes

   .. versionadded:: 0.3.0



   ..
       !! processed by numpydoc !!

.. py:data:: GRATICULE_CLOSED_INTERVAL
   :type:  bool
   :value: False


   
   Whether longitudes within half-closed [-180, 180) or closed [-180, 180] interval.
















   ..
       !! processed by numpydoc !!

.. py:data:: GRATICULE_ZLEVEL
   :type:  int
   :value: 1


   
   The default zlevel for graticule meridians and parallels.
















   ..
       !! processed by numpydoc !!

.. py:data:: LABEL_DEGREE
   :type:  str
   :value: '°'


   
   The degree symbol label.
















   ..
       !! processed by numpydoc !!

.. py:data:: LABEL_EAST
   :type:  str

   
   The east of the prime meridian label.
















   ..
       !! processed by numpydoc !!

.. py:data:: LABEL_NORTH
   :type:  str

   
   The north of the equatorial parallel label.
















   ..
       !! processed by numpydoc !!

.. py:data:: LABEL_SOUTH
   :type:  str

   
   The south of the equatorial parallel label.
















   ..
       !! processed by numpydoc !!

.. py:data:: LABEL_WEST
   :type:  str

   
   The west of the prime meridian label.
















   ..
       !! processed by numpydoc !!

.. py:data:: LATITUDE_N_SAMPLES
   :type:  int
   :value: 360


   
   The default number of points in a line of latitude.
















   ..
       !! processed by numpydoc !!

.. py:data:: LATITUDE_POLES_LABEL
   :type:  bool
   :value: True


   
   Whether to generate a north/south pole label.
















   ..
       !! processed by numpydoc !!

.. py:data:: LATITUDE_POLES_PARALLEL
   :type:  bool
   :value: False


   
   Whether to generate parallels at the north/south poles.
















   ..
       !! processed by numpydoc !!

.. py:data:: LATITUDE_START
   :type:  float

   
   The first graticule line of latitude (degrees).
















   ..
       !! processed by numpydoc !!

.. py:data:: LATITUDE_STEP
   :type:  float
   :value: 30.0


   
   The default step size between graticule parallels (degrees).
















   ..
       !! processed by numpydoc !!

.. py:data:: LATITUDE_STEP_PERIOD
   :type:  float
   :value: 90.0


   
   The period or upper bound (degrees) for parallel step size.
















   ..
       !! processed by numpydoc !!

.. py:data:: LATITUDE_STOP
   :type:  float
   :value: 90.0


   
   The last graticule line of latitude (degrees).
















   ..
       !! processed by numpydoc !!

.. py:data:: LONGITUDE_N_SAMPLES
   :type:  int
   :value: 180


   
   The default number of points in a meridian line.
















   ..
       !! processed by numpydoc !!

.. py:data:: LONGITUDE_START
   :type:  float

   
   The first meridian line in the graticule (degrees).
















   ..
       !! processed by numpydoc !!

.. py:data:: LONGITUDE_STEP
   :type:  float
   :value: 45.0


   
   The default step size between graticule meridians (degrees).
















   ..
       !! processed by numpydoc !!

.. py:data:: LONGITUDE_STEP_PERIOD
   :type:  float
   :value: 180.0


   
   The period or upper bound (degrees) for meridian step size.
















   ..
       !! processed by numpydoc !!

.. py:data:: LONGITUDE_STOP
   :type:  float

   
   The last graticule meridian (degrees).
















   ..
       !! processed by numpydoc !!

