GeoProjection class Projections
Projections transform spherical polygonal geometry to planar polygonal geometry.
D4 provides implementations of several classes of standard projections:
You can implement custom projections using GeoProjection or GeoProjectionMutator.
- Implemented types
- Implementers
Constructors
- GeoProjection.new(GeoRawProjection project)
-
Constructs a new projection from the specified raw projection,
project
. Theproject
function takes the longitude and latitude of a given point in radians, often referred to as lambda (λ) and phi (φ), and returns a two-element list [x, y] representing its unit projection. Theproject
function does not need to scale or translate the point, as these are applied automatically by scale, translate, and center. Likewise, theproject
function does not need to perform any spherical rotation, as rotate is applied prior to projection.
Properties
- angle ↔ double
-
The projection's post-projection planar rotation angle in degrees.
getter/setter pair
-
center
↔ List<
double> -
The projection's center.
getter/setter pair
- clipAngle ↔ double?
-
The projection's small-circle clipping radius angle in degrees.
getter/setter pair
-
clipExtent
↔ List<
List< ?double> > -
The projection's viewport clipping extent bounds in pixels.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- postclip ↔ GeoStream Function(GeoStream)
-
The projection's cartesian clipping.
getter/setter pair
- precision ↔ double
-
The projection’s
adaptive resampling
threshold in pixels.
getter/setter pair
- preclip ↔ GeoStream Function(GeoStream)
-
The projection's spherical clipping.
getter/setter pair
- reflectX ↔ bool
-
The projection's x-reflection state.
getter/setter pair
- reflectY ↔ bool
-
The projection's x-reflection state.
getter/setter pair
-
rotate
↔ List<
double> -
The projection's
three-axis spherical rotation
angles.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale ↔ double
-
The projection's scale factor.
getter/setter pair
-
translate
↔ List<
double> -
The projection's translation offset.
getter/setter pair
Methods
-
call(
List< num> point) → List<num> ? -
Returns a new list [x, y] (typically in pixels) representing the
projected point of the given
point
. -
fitExtent(
List< List< extent, Map object) → voiddouble> > -
Sets the projection’s scale and translate to fit the specified GeoJSON
object
in the center of the givenextent
. -
fitHeight(
double height, Map object) → void - A convenience method for fitSize where the width is automatically chosen from the aspect ratio of object and the given constraint on height.
-
fitSize(
List< double> size, Map object) → void - A convenience method for fitExtent where the top-left corner of the extent is [0, 0].
-
fitWidth(
double width, Map object) → void - A convenience method for fitSize where the height is automatically chosen from the aspect ratio of object and the given constraint on width.
-
invert(
List< num> point) → List<num> ? -
Returns a new list [longitude, latitude] in degrees representing
the unprojected point of the given projected
point
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
stream(
GeoStream stream) → GeoStream -
Returns a projection stream for the specified
stream
.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited