altair.Projection#

class altair.Projection(center=Undefined, clipAngle=Undefined, clipExtent=Undefined, coefficient=Undefined, distance=Undefined, extent=Undefined, fit=Undefined, fraction=Undefined, lobes=Undefined, parallel=Undefined, parallels=Undefined, pointRadius=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, reflectX=Undefined, reflectY=Undefined, rotate=Undefined, scale=Undefined, size=Undefined, spacing=Undefined, tilt=Undefined, translate=Undefined, type=Undefined, **kwds)#

Projection 模式包装器。

参数:
centerdict, Sequence[float], ExprRef, Vector2number

投影的中心,一个包含经度和纬度(以度为单位)的双元素数组。

默认值: [0, 0]

clipAngledict, float, ExprRef

投影的剪裁圆半径(以度为单位)设置为指定的角度。如果为 null,则切换到 反子午线 剪裁,而不是小圆剪裁。

clipExtentdict, ExprRef, Vector2Vector2number, Sequence[Sequence[float], Vector2number]

投影的视口剪裁范围,以像素为单位,设置为指定的边界。范围边界指定为一个数组 [[x0, y0], [x1, y1]],其中 x0 是视口的左侧,y0 是顶部,x1 是右侧,y1 是底部。如果为 null,则不执行视口剪裁。

coefficientdict, float, ExprRef

hammer 投影的系数参数。

默认值: 2

distancedict, float, ExprRef

对于 satellite 投影,从球心到视点的距离,作为球半径的比例。给定 distance 推荐的最大剪裁角度是 acos(1 / distance) 转换为度。如果同时应用了倾斜,可能需要更保守的剪裁。

默认值: 2.0

extentdict, ExprRef, Vector2Vector2number, Sequence[Sequence[float], Vector2number]
fitdict, Fit, ExprRef, GeoJsonFeature, GeoJsonFeatureCollection, Sequence[dict, GeoJsonFeature], Sequence[dict, Fit, GeoJsonFeature, GeoJsonFeatureCollection, Sequence[dict, GeoJsonFeature]]
fractiondict, float, ExprRef

bottomley 投影的分数参数。

默认值: 0.5,对应于 ψ = π/6 时的 sin(ψ)。

lobesdict, float, ExprRef

支持多叶视图的投影中的叶数:berghausgingeryhealpix。默认值根据投影类型而异。

paralleldict, float, ExprRef

支持该参数的投影的平行线参数:armadillo, bonne, craig, cylindricalEqualArea, cylindricalStereographic, hammerRetroazimuthal, loximuthal, 或 rectangularPolyconic。默认值根据投影类型而异。

parallelsdict, Sequence[float], ExprRef

对于圆锥投影,定义地图布局的两条标准平行线。默认值取决于使用的具体圆锥投影。

pointRadiusdict, float, ExprRef

绘制 GeoJSON PointMultiPoint 几何体时使用的默认半径(以像素为单位)。此参数设置一个恒定的默认值。要根据数据修改点半径,请参阅 GeoPath 和 GeoShape 变换的相应参数。

默认值: 4.5

precisiondict, float, ExprRef

投影的 自适应重采样 的阈值,以像素为单位设置为指定的值。此值对应于 Douglas-Peucker 距离。如果未指定精度,则返回投影当前的重采样精度,其默认值为 √0.5 0.70710…

radiusdict, float, ExprRef

airygingery 投影的半径参数。默认值根据投影类型而异。

ratiodict, float, ExprRef

hillhufnagelwagner 投影的比例参数。默认值根据投影类型而异。

reflectXbool, dict, ExprRef

设置输出中 x 维度是否反射(取反)。

reflectYbool, dict, ExprRef

设置输出中 y 维度是否反射(取反)。

rotatedict, Sequence[float], ExprRef, Vector2number, Vector3number

投影的三轴旋转,设置为指定的角度,该角度必须是一个包含两个或三个数字元素的数组 [lambda, phi, gamma],指定绕每个球体轴的旋转角度,单位为度。(这些对应于偏航、俯仰和滚转。)

默认值: [0, 0, 0]

scaledict, float, ExprRef

投影的比例(缩放)因子,覆盖自动适配。默认比例是特定于投影的。比例因子与投影点之间的距离呈线性关系;然而,比例因子值在不同投影之间不相等。

sizedict, Sequence[float], ExprRef, Vector2number

与 fit 一起使用,提供投影应该自动适配的区域的宽度和高度,以像素为单位。

spacingdict, float, ExprRef

lagrange 投影的间距参数。

默认值: 0.5

tiltdict, float, ExprRef

satellite 投影的倾斜角度(以度为单位)。

默认值: 0

translatedict, Sequence[float], ExprRef, Vector2number

投影的平移偏移量,作为一个包含两个元素的数组 [tx, ty]

typedict, ExprRef, ProjectionType, Literal[‘albers’, ‘albersUsa’, ‘azimuthalEqualArea’, ‘azimuthalEquidistant’, ‘conicConformal’, ‘conicEqualArea’, ‘conicEquidistant’, ‘equalEarth’, ‘equirectangular’, ‘gnomonic’, ‘identity’, ‘mercator’, ‘naturalEarth1’, ‘orthographic’, ‘stereographic’, ‘transverseMercator’]

要使用的制图投影。此值不区分大小写,例如 "albers""Albers" 表示相同的投影类型。你可以在文档中找到所有有效的投影类型。

默认值: equalEarth

__init__(center=Undefined, clipAngle=Undefined, clipExtent=Undefined, coefficient=Undefined, distance=Undefined, extent=Undefined, fit=Undefined, fraction=Undefined, lobes=Undefined, parallel=Undefined, parallels=Undefined, pointRadius=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, reflectX=Undefined, reflectY=Undefined, rotate=Undefined, scale=Undefined, size=Undefined, spacing=Undefined, tilt=Undefined, translate=Undefined, type=Undefined, **kwds)#

方法

__init__([center, clipAngle, clipExtent, ...])

copy([deep, ignore])

返回对象的副本。

from_dict(dct[, validate])

从字典表示构造类。

from_json(json_string[, validate])

从有效的 JSON 字符串实例化对象。

resolve_references([schema])

在此对象的模式或根模式的上下文中解析引用。

to_dict([validate, ignore, context])

返回对象的字典表示。

to_json([validate, indent, sort_keys, ...])

将此对象的 JSON 表示作为字符串输出。

validate(instance[, schema])

在根模式的上下文中,根据类模式验证实例。

validate_property(name, value[, schema])

在根模式的上下文中,根据属性模式验证属性。