geovista.gridlines
#
Provides graticule support and other geographical lines of interest for geolocation.
Notes#
Added in version 0.3.0.
Module Contents#
Classes#
Graticule composed of a block of meshes, labels and their points. |
Functions#
|
Generate labels for the meridians. |
|
Generate graticule lines of constant longitude (meridians) with labels. |
|
Generate labels for the parallels. |
|
Generate graticule lines of constant latitude (parallels) with labels. |
Attributes#
Whether longitudes within half-closed [-180, 180) or closed [-180, 180] interval. |
|
The default zlevel for graticule meridians and parallels. |
|
The degree symbol label. |
|
The east of the prime meridian label. |
|
The north of the equatorial parallel label. |
|
The south of the equatorial parallel label. |
|
The west of the prime meridian label. |
|
The default number of points in a line of latitude. |
|
Whether to generate a north/south pole label. |
|
Whether to generate parallels at the north/south poles. |
|
The first graticule line of latitude (degrees). |
|
The default step size between graticule parallels (degrees). |
|
The period or upper bound (degrees) for parallel step size. |
|
The last graticule line of latitude (degrees). |
|
The default number of points in a meridian line. |
|
The first meridian line in the graticule (degrees). |
|
The default step size between graticule meridians (degrees). |
|
The period or upper bound (degrees) for meridian step size. |
|
The last graticule meridian (degrees). |
- class geovista.gridlines.GraticuleGrid[source]#
Graticule composed of a block of meshes, labels and their points.
Notes
Added in version 0.3.0.
- blocks: pv#
- lonlat: numpy.typing.ArrayLike#
- mask: numpy.typing.ArrayLike = None#
- geovista.gridlines.create_meridian_labels(lons)[source]#
Generate labels for the meridians.
- Parameters:
- Returns:
Notes
Added in version 0.3.0.
- geovista.gridlines.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)[source]#
Generate graticule lines of constant longitude (meridians) with labels.
- Parameters:
- start
float
, optional The first line of longitude (degrees). The graticule will include this meridian. Defaults to
LONGITUDE_START
.- stop
float
, optional The last line of longitude (degrees). The graticule will include this meridian when it is a multiple of
step
. Also seeclosed_interval
. Defaults toLONGITUDE_STOP
.- step
float
, optional The delta (degrees) between neighbouring meridians. Defaults to
LONGITUDE_STEP
.- lat_step
float
, optional The delta (degrees) between neighbouring parallels. Sets the frequency of the labels. Defaults to
LATITUDE_STEP
.- n_samples
int
, optional The number of points in a single line of longitude. Defaults to
LONGITUDE_N_SAMPLES
.- closed_interval
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
GRATICULE_CLOSED_INTERVAL
.- central_meridian
float
, optional The central meridian of the longitude range. Defaults to
geovista.common.CENTRAL_MERIDIAN
.- radius
float
, optional The radius of the sphere. Defaults to
geovista.common.RADIUS
.- zlevel
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 toGRATICULE_ZLEVEL
.- zscale
float
, optional The proportional multiplier for z-axis zlevel. Defaults to
geovista.common.ZLEVEL_SCALE
.
- start
- Returns:
GraticuleGrid
The graticule meridians and points with labels on those meridians.
Notes
Added in version 0.3.0.
- geovista.gridlines.create_parallel_labels(lats, poles_parallel=None)[source]#
Generate labels for the parallels.
- Parameters:
- lats
list
offloat
The lines of latitude that require a label of their location north or south relative to the equator.
- poles_parallel
bool
, optional Whether to generate a label for the north/south poles. Defaults to
LATITUDE_POLES_PARALLEL
.
- lats
- Returns:
Notes
Added in version 0.3.0.
- geovista.gridlines.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)[source]#
Generate graticule lines of constant latitude (parallels) with labels.
- Parameters:
- start
float
, optional The first line of latitude (degrees). The graticule will include this parallel. Also see
poles_parallel
. Defaults toLATITUDE_START
.- stop
float
, optional The last line of latitude (degrees). The graticule will include this parallel when it is a multiple of
step
. Also seepoles_parallel
. Defaults toLATITUDE_STOP
.- step
float
, optional The delta (degrees) between neighbouring parallels. Defaults to
LATITUDE_STEP
.- lon_step
float
, optional The delta (degrees) between neighbouring meridians. Sets the frequency of the labels. Defaults to
LONGITUDE_STEP
.- n_samples
int
, optional The number of points in a single line of latitude. Defaults to
LATITUDE_N_SAMPLES
.- poles_parallel
bool
, optional Whether to create a line of latitude at the north/south poles. Also see
poles_label
. Defaults toLATITUDE_POLES_PARALLEL
.- poles_label
bool
, optional Whether to create a single north/south pole label. Only applies when
poles_parallel=False
. Defaults toLATITUDE_POLES_LABEL
.- radius
float
, optional The radius of the sphere. Defaults to
geovista.common.RADIUS
.- zlevel
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 toGRATICULE_ZLEVEL
.- zscale
float
, optional The proportional multiplier for z-axis zlevel. Defaults to
geovista.common.ZLEVEL_SCALE
.
- start
- Returns:
GraticuleGrid
The graticule parallels and points with labels on the parallels.
Notes
Added in version 0.3.0.
- geovista.gridlines.GRATICULE_CLOSED_INTERVAL: bool = False#
Whether longitudes within half-closed [-180, 180) or closed [-180, 180] interval.
- geovista.gridlines.GRATICULE_ZLEVEL: int = 1#
The default zlevel for graticule meridians and parallels.
- geovista.gridlines.LATITUDE_N_SAMPLES: int = 360#
The default number of points in a line of latitude.
- geovista.gridlines.LATITUDE_POLES_PARALLEL: bool = False#
Whether to generate parallels at the north/south poles.
- geovista.gridlines.LATITUDE_STEP: float = 30.0#
The default step size between graticule parallels (degrees).
- geovista.gridlines.LATITUDE_STEP_PERIOD: float = 90.0#
The period or upper bound (degrees) for parallel step size.
- geovista.gridlines.LONGITUDE_STEP: float = 45.0#
The default step size between graticule meridians (degrees).