Spherical shapes¶
Graticule¶
- detroit.geo_graticule() Graticule¶
Constructs a geometry generator for creating graticules: a uniform grid of meridians and parallels for showing projection distortion. The default graticule has meridians and parallels every \(10°\) between \(\pm 80°\) latitude; for the polar regions, there are meridians every \(90°\).
- Returns:
Graticule object
- Return type:
- detroit.geo_graticule_10() dict[str, Any]¶
A convenience method for directly generating the default \(10°\) global graticule as a GeoJSON MultiLineString geometry object.
- Returns:
GeoJSON object
- Return type:
GeoJSON
- class detroit.geo.graticule.Graticule¶
- __call__() dict[str, Any]¶
Returns a GeoJSON MultiLineString geometry object representing all meridians and parallels for this graticule.
- Returns:
GeoJSON object
- Return type:
GeoJSON
- lines() list[dict[str, Any]]¶
Returns an array of GeoJSON LineString geometry objects, one for each meridian or parallel for this graticule.
- Returns:
List of GeoJSON LineString geometry objects
- Return type:
list[GeoJSON]
- outline() dict[str, Any]¶
Returns a GeoJSON Polygon geometry object representing the outline of this graticule, i.e. along the meridians and parallels defining its extent.
- Returns:
GeoJSON object
- Return type:
GeoJSON
- set_extent(extent: tuple[tuple[float, float], tuple[float, float]]) Graticule¶
Sets the major and minor extents of this graticule.
- Parameters:
extent (tuple[Point2D, Point2D]) – Extent values
- Returns:
Itself
- Return type:
- set_extent_major(extent: tuple[tuple[float, float], tuple[float, float]]) Graticule¶
Sets the major extent of this graticule.
- Parameters:
extent (tuple[Point2D, Point2D]) – Extent values
- Returns:
Itself
- Return type:
- set_extent_minor(extent: tuple[tuple[float, float], tuple[float, float]]) Graticule¶
Sets the minor extent of this graticule.
- Parameters:
extent (tuple[Point2D, Point2D]) – Extent values
- Returns:
Itself
- Return type:
- set_step(step: tuple[float, float]) Graticule¶
Sets the major and minor step for this graticule.
- Parameters:
step (Point2D) – Step values
- Returns:
Itself
- Return type:
- set_step_major(step: tuple[float, float]) Graticule¶
Sets the major step for this graticule.
- Parameters:
step (Point2D) – Step values
- Returns:
Itself
- Return type:
Circle¶
- class detroit.geo.circle.GeoCircle¶
Circle generator
- __call__(*args: Any) dict[str, Any]¶
Returns a new GeoJSON geometry object of type “Polygon” approximating a circle on the surface of a sphere, with the current center, radius and precision. Any arguments are passed to the accessors.
- Parameters:
*args (Any) – Arguments passed to the accessors
- Returns:
GeoJSON object
- Return type:
GeoJSON
- set_center(center: Callable[[...], tuple[float, float]] | tuple[float, float]) GeoCircle¶
If center is specified, sets the circle center to the specified point
[longitude, latitude]in degrees, and returns this circle generator. The center may also be specified as a function.- Parameters:
center (Callable[..., Point2D] | Point2D) – Center function or constant value
- Returns:
Itself
- Return type:
- set_radius(radius: Callable[[...], float] | float) GeoCircle¶
If radius is specified, sets the circle radius to the specified angle in degrees, and returns this circle generator. The radius may also be specified as a function.
- Parameters:
radius (Callable[..., float] | float) – Radius function or constant value
- Returns:
Itself
- Return type:
- set_precision(precision: Callable[[...], float] | float) GeoCircle¶
If precision is specified, sets the circle precision to the specified angle in degrees, and returns this circle generator. The precision may also be specified as a function.
- Parameters:
precision (Callable[..., float] | float) – Precision function or constant value
- Returns:
Itself
- Return type: