Streams

detroit.geo_stream(obj: dict[str, Any], stream: PolygonStream)

Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input, the stream interface only describes the geometry, and thus additional feature properties are not visible to streams.

Parameters:
  • obj (GeoJSON) – GeoJSON object

  • stream (PolygonStream) – Stream object

class detroit.geo.common.LineStream
abstractmethod line_start()

Indicates the start of a line or ring. Within a polygon, indicates the start of a ring. The first ring of a polygon is the exterior ring, and is typically clockwise. Any subsequent rings indicate holes in the polygon, and are typically counterclockwise.

abstractmethod line_end()

Indicates the end of a line or ring. Within a polygon, indicates the end of a ring. Unlike GeoJSON, the redundant closing coordinate of a ring is not indicated via point, and instead is implied via lineEnd within a polygon.

abstractmethod point(x: float, y: float)

Indicates a point with the specified coordinates x and y (and optionally z). The coordinate system is unspecified and implementation-dependent; for example, projection streams require spherical coordinates in degrees as input. Outside the context of a polygon or line, a point indicates a point geometry object (Point or MultiPoint). Within a line or polygon ring, the point indicates a control point.

Parameters:
  • x (float) – x value

  • y (float) – y value

class detroit.geo.common.PolygonStream
abstractmethod line_end()

Indicates the end of a line or ring. Within a polygon, indicates the end of a ring. Unlike GeoJSON, the redundant closing coordinate of a ring is not indicated via point, and instead is implied via lineEnd within a polygon.

abstractmethod line_start()

Indicates the start of a line or ring. Within a polygon, indicates the start of a ring. The first ring of a polygon is the exterior ring, and is typically clockwise. Any subsequent rings indicate holes in the polygon, and are typically counterclockwise.

abstractmethod point(x: float, y: float)

Indicates a point with the specified coordinates x and y (and optionally z). The coordinate system is unspecified and implementation-dependent; for example, projection streams require spherical coordinates in degrees as input. Outside the context of a polygon or line, a point indicates a point geometry object (Point or MultiPoint). Within a line or polygon ring, the point indicates a control point.

Parameters:
  • x (float) – x value

  • y (float) – y value

abstractmethod polygon_end()

Indicates the end of a polygon.

abstractmethod polygon_start()

Indicates the start of a polygon. The first line of a polygon indicates the exterior ring, and any subsequent lines indicate interior holes.

sphere()

Indicates the sphere (the globe; the unit sphere centered at (0,0,0)).