new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

D3 · all subjects

d3-geo/stream

9 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

d3-geo stream interface

Geometry stream methods: stream.point (indicate point with coordinates), stream.lineStart (indicate line/ring start), stream.lineEnd (indicate line/ring end), stream.polygonStart (indicate polygon start), stream.polygonEnd (indicate polygon end), stream.sphere (indicate the sphere).

geoStream function signature

geoStream(*object*, *stream*) streams the specified GeoJSON object to the specified projection stream. Both features and geometry objects are supported as input, but the stream interface only describes the geometry; additional feature properties are not visible to streams.

stream.point method signature and behavior

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

stream.lineEnd method

stream.lineEnd() indicates the end of a line or ring. Within a polygon, it indicates the end of a ring. Unlike GeoJSON, the redundant closing coordinate of a ring is not indicated via point; instead it is implied via lineEnd within a polygon.

stream.polygonStart method

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

stream.polygonEnd method

stream.polygonEnd() indicates the end of a polygon.

stream.sphere method

stream.sphere() indicates the sphere (the globe; the unit sphere centered at ⟨0,0,0⟩).

Polygon stream method call sequence example

A GeoJSON polygon with coordinates [[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]] produces the following stream method calls: stream.polygonStart(); stream.lineStart(); stream.point(0, 0); stream.point(0, 1); stream.point(1, 1); stream.point(1, 0); stream.lineEnd(); stream.polygonEnd();

Streams are stateful

Streams are inherently stateful; the meaning of a point depends on whether the point is inside of a line, and likewise a line is distinguished from a ring by a polygon. Despite the name 'stream', these method calls are currently synchronous.

Give your agent this brain