SpatialPointData[points]
表示空间位置 points 的集合.
SpatialPointData[points,reg]
表示区域 reg 内的点集合.
SpatialPointData[pointsvals,…]
将值 vals 与位置 points 进行关联.
SpatialPointData[points<|key1vals1,…|>,…]
与键值注解 keyivalsi 关联.
SpatialPointData[{p1data1,p2data2,…},…]
表示有关联值 {data1,data2,…} 的空间点集合 {p1,p2,…}.
SpatialPointData[{points1,points2,…},…]
表示空间点的多个集合.
SpatialPointData[{points1anns1,points2anns2,…},…]
表示多个有注解的空间点集合.
SpatialPointData
SpatialPointData[points]
表示空间位置 points 的集合.
SpatialPointData[points,reg]
表示区域 reg 内的点集合.
SpatialPointData[pointsvals,…]
将值 vals 与位置 points 进行关联.
SpatialPointData[points<|key1vals1,…|>,…]
与键值注解 keyivalsi 关联.
SpatialPointData[{p1data1,p2data2,…},…]
表示有关联值 {data1,data2,…} 的空间点集合 {p1,p2,…}.
SpatialPointData[{points1,points2,…},…]
表示空间点的多个集合.
SpatialPointData[{points1anns1,points2anns2,…},…]
表示多个有注解的空间点集合.
更多信息和选项
- 空间点集合也可叫做空间点样式.
- 空间点布局是一个点集合,还有观察区域 reg 和每个点的可选注解.
- 点布局可以在任何维度. 通常,一维的点是一些时间上的事件,如客户到达或服务器工作到达等. 一般二维点是样本中单元的位置,如树的位置、犯罪或疾病发生的位置等. 而通常三维点是恒星和星系团的位置,或混凝土中粒料的位置,或材料中缺陷的位置等.
-

- 点 points 可有如下形式:
-
{p1,p2,…} 几何点 pi∈d GeoPosition[…],GeoPositionXYZ[…],… 几何点 - 若想要生成关于点布局的正确统计数据,观察区域 reg 很重要.
-


- 若没给定观察区域 reg,则使用 RipleyRassonRegion 可自动计算出一个区域.
- 观察区域 reg 应为一个可由 SpatialObservationRegionQ 检验出的无参数、全维度的有边界的区域.
- 空间点可带有注解,提供与每个点有关的额外信息. 这些通常称作标记和协变量.
- 通常记号包括树的胸高直径和树的种类,而一般的协变量会是关于树的海拔.
- 注解属性包括:
-
"Annotations" 第一个点布局的注解 {"Annotations",n} 第 n 个点布局的注解 "AnnotationsList" 所有点布局的注解列表 {…,"key"} 返回有给定键 "key" 的注解 - 可使用像 AnnotationKeys,Annotate,AnnotationValue 等的函数对注解进行撤回和添加.
- 基本属性包括:
-
"Summary" 数据信息表 "Dimensions" 点坐标的维数 "ObservationRegion" 观察区域 "RegionMeasure" 观察区域的度量 "ConfigurationCount" 点布局的数量 "Points" 第一个布局的点坐标 "PointsList" 所有布局的点坐标 "PointCount" 第一个点布局中点的数量 "PointCountList" 所有点布局中点的数量 "MeanPointCount" 所有点布局的平均点数量 "MeanPointDensity" 所有点布局的平均点密度 "FryPlot" 有向散点图 - SpatialPointData[sdata,newreg] 创建了原始空间点数据的子集,其中新的观察区域是 newreg 和原始观察区域的交集.
- SpatialPointData 可与诸如 HistogramPointDensity,RipleyK 和 SpatialRandomnessTest 这样的函数一起使用.
范例
打开所有单元 关闭所有单元基本范例 (2)
创建一个单变量 SpatialPointData:
SpatialPointData[RandomReal[1, {10, 1}]]NumberLinePlot[%]多变量 SpatialPointData:
SpatialPointData[RandomReal[1, {20, 2}]]ListPlot[%]为 GeoPosition 列表创建一个 SpatialPointData:
data = {Entity["City", {"Houston", "Texas", "UnitedStates"}], Entity["City", {"Austin", "Texas", "UnitedStates"}], Entity["City", {"Dallas", "Texas", "UnitedStates"}], Entity["City", {"SanAntonio", "Texas", "UnitedStates"}]};tx = Entity["AdministrativeDivision", {"Texas", "UnitedStates"}];spd = SpatialPointData[data, tx]GeoListPlot[spd, GeoRange -> tx]范围 (22)
基本用法 (8)
reg = Interval[{0, 1}];sample = RandomVariate[BetaDistribution[2, 1 / 3], 10 ^ 3];spd = SpatialPointData[Partition[sample, 1], reg]NumberLinePlot[spd, PlotStyle -> PointSize[Tiny]]res = Disk[{0, 1}, 4];sample = RandomPoint[res, 10 ^ 3];spd = SpatialPointData[sample, res]ListPlot[spd, AspectRatio -> 1]points = N@PolyhedronData["Dodecahedron", "Vertices"];spd = SpatialPointData[points, PolyhedronData["Dodecahedron", "MeshRegion"]]Show[spd["ObservationRegion"], Graphics3D[{Black, PointSize[.035], Point[points]}]]sample = RandomPointConfiguration[HardcorePointProcess[10 ^ 4, .1, 2], Rectangle[]]这个向量的图被称作 Fry Plot,可直接从空间点数据中抓取:
sample["FryPlot"]用随机测地点构建 SpatialPointData:
geodata = RandomGeoPosition["World", 100]data = SpatialPointData[geodata, GeoBoundsRegion[{{-90, 90}, {-180, 180}}]]GeoListPlot[data]cities = Entity["Country", "UnitedStates"]["LargestCities"];创建 SpatialPointData,其中由国家边界指定区域:
data = SpatialPointData[cities, Entity["Country", "UnitedStates"]]GeoListPlot[data]使用 GeoElevationData 获取墨西哥地图上方的规则网格:
data = GeoElevationData[Entity["Country", "Mexico"], Automatic, "GeoPosition", GeoZoomLevel -> 1]First[data]//Dimensionspoints = MapAt[Flatten[#, 1]&, data, 1]spd = SpatialPointData[points -> <|"Elevation" -> points["Elevation"]|>, Entity["Country", "Mexico"]]GeoListPlot[spd]从 ResourceObject 获取数据:
obj = ResourceObject["Sample Data: Lansing Woods"]data = ResourceData[obj]ListPlot[data]区域 (3)
定义关于点发生的观察区域的 SpatialPointData:
points = RandomReal[1, {3, 10, 2}];spd = SpatialPointData[points, Rectangle[]]spd["Properties"]spd["ObservationRegion"]new = SpatialPointData[points, Rectangle[{0, 0}, {.5, .5}]]new["ObservationRegion"]若未指定观察区域,则使用 Ripley–Rasson 估计量进行估算(凸包的扩张):
spd = SpatialPointData[RandomReal[1, {100, 2}]]Show[RegionPlot[spd["ObservationRegion"]], ListPlot[spd]]pts = RandomReal[1, {10, 2}];
spd = SpatialPointData[pts, Rectangle[{0, 0}, {1, 1}]];newreg1 = Rectangle[{0, 0}, {2, .5}];spd1 = SpatialPointData[spd, newreg1];spd1["ObservationRegion"]RegionPlot[{spd["ObservationRegion"], newreg1, spd1["ObservationRegion"]}, PlotLegends -> {"original observation region", "newreg1", "new observation region"}]newreg2 = Rectangle[{0, 0}, {1, 2}];spd2 = SpatialPointData[spd["Points"], newreg2]spd2["ObservationRegion"]spd2["ObservationRegion"] === newreg2RegionPlot[{spd["ObservationRegion"], newreg2}, PlotLegends -> {"original observation region", "new observation region"}]变换 (3)
平移 SpatialPointData:
spd = SpatialPointData[RandomReal[{-1, 1}, {100, 2}], Disk[]]fn = TranslationTransform[{2, .5}];
spd1 = fn[spd];Show[RegionPlot[{spd["ObservationRegion"], spd1["ObservationRegion"]}, PlotLegends -> {"Original Region", "Transformed Region"}], ListPlot[{spd["Points"], spd1["Points"]}], AspectRatio -> Automatic]旋转 SpatialPointData:
spd = SpatialPointData[RandomReal[2, {100, 2}], Rectangle[{0, 0}, {2, 1}]]fn = RotationTransform[π / 2];
spd1 = fn[spd]Show[RegionPlot[{spd["ObservationRegion"], spd1["ObservationRegion"]}, PlotLegends -> {"Original Region", "Transformed Region"}], ListPlot[{spd["Points"], spd1["Points"]}], AspectRatio -> Automatic]重新缩放 SpatialPointData:
spd = SpatialPointData[RandomReal[1, {100, 2}]]fn = ScalingTransform[{1 / 2, 2 / 3}];
spd1 = fn[spd]Show[RegionPlot[{spd["ObservationRegion"], spd1["ObservationRegion"]}, PlotLegends -> {"Original Region", "Transformed Region"}], ListPlot[{spd["Points"], spd1["Points"]}], AspectRatio -> Automatic]注解 (6)
{names, pos} = Transpose[EntityValue[Entity["Country", "Ireland"]["LargestCities"], {"Name", "Position"}]];data = SpatialPointData[GeoPosition[pos] -> <|"Name" -> names|>]data[{"Annotations", "Name"}]AnnotationKeys[data]AnnotationValue[data, "Name"]loc = MapThread[Tooltip[#1, #2]&, {Thread@pos, names}];
GeoListPlot[loc, GeoRange -> Entity["Country", "Ireland"]["Polygon"]]data = {{41.69, 28.88}, {3.61, 16.75}, {493.6, 158.08}, {172.3, 52.17}, {509.57, 460.5}, {241.47, 82.14}, {299.61, 286.61}, {7.28, 387.6}, {429.98, 92.94}, {142.01, 195.63}};
annotations = { {"on", "off", "on", "on", "off", "off", "on", "on", "off", "off"}, {275.9, 241.2, 256., 442.9, 209.4, 260.4, 348.8, 315.2, 275.3, 317.8}};spd = SpatialPointData[data -> annotations]spd["Annotations"]spd[{"Annotations", "Keys"}]Show[spd["ObservationRegion"], PointValuePlot[spd, PlotLegends -> Automatic]]data = {{41.69, 28.88}, {3.61, 16.75}, {493.6, 158.08}, {172.3, 52.17}, {509.57, 460.5}, {241.47, 82.14}, {299.61, 286.61}, {7.28, 387.6}, {429.98, 92.94}, {142.01, 195.63}};
status = {"on", "off", "on", "on", "off", "off", "on", "on", "off", "off"};areas = {275.9, 241.2, 256., 442.9, 209.4, 260.4, 348.8, 315.2, 275.3, 317.8};spd = SpatialPointData[data -> <|"Cell Status" -> status, "Area" -> areas|>]spd[{"Annotations", "Keys"}]spd["Annotations"]spd[{"Annotations", "Cell Status"}]spd[{"Annotations", "Area"}]data = {{41.69, 28.88}, {3.61, 16.75}, {493.6, 158.08}, {172.3, 52.17}, {509.57, 460.5}, {241.47, 82.14}, {299.61, 286.61}, {7.28, 387.6}, {429.98, 92.94}, {142.01, 195.63}};
status = {"on", "off", "on", "on", "off", "off", "on", "on", "off", "off"};
types = RandomChoice[{"S", "R", "W"}, 10];areas = {275.9, 241.2, 256., 442.9, 209.4, 260.4, 348.8, 315.2, 275.3, 317.8};
thick = {1.2, 4.3, 1.5, 2.3, .9, .13, .98, .34, .7, 1.3};spd = SpatialPointData[data -> <|"Cell Status" -> status, "Area" -> areas, "Type" -> types, "Thicknes" -> thick|>]spd["Summary"]使用 SparseArray 将注释赋到样式的子集:
spd = SpatialPointData[RandomReal[1, {100, 2}] -> SparseArray[Thread[RandomChoice[Range[100], 20] -> 1], 100]]spd["Annotations"]ListPlot[spd["Annotations"][1]]将注解添加到用 GeoPosition 定义的空间数据中:
geodata = GeoPosition@
Transpose[{RandomReal[{-80, 80}, 10], RandomReal[{-180, 180}, 10]}];
annotations = { "status" -> {"on", "off", "on", "on", "off", "off", "on", "on", "off", "off"}, "value" -> {275.9, 241.2, 256., 442.9, 209.4, 260.4, 348.8, 315.2, 275.3, 317.8}};spd = SpatialPointData[geodata -> annotations, GeoBoundsRegion[{{-90, 90}, {-180, 180}}]]spd[{"Annotations"}]PointValuePlot[spd, {1 -> "Shape", 2 -> "Size"}, ColorFunction -> "BlueGreenYellow", PlotLegends -> Automatic]布局 (2)
pts = RandomReal[1, {10, 2}];
reg = Rectangle[{0, 0}, {1, 1}];colors = RandomChoice[ColorData[97, "ColorList"], 10];
diameters = {.1, .1, .1, .2, .2, .2, .3, .3, .3, .3};spd = SpatialPointData[{pts -> {"color" -> colors, "diameter" -> diameters}, pts -> {"index" -> Range[10]}}, reg]spd[{"Configuration", 1}]%["Summary"]spd[{"Configuration", {2, 1}}]%["Summary"]spd[{"Configuration", {1, 2, 1}}]%["Summary"]将所有的点布局提取为单独的 SpatialPointData 对象:
spd = SpatialPointData[{RandomReal[1, {10, 2}], RandomReal[1, {12, 2}], RandomReal[1, {19, 2}]}]spd["ConfigurationList"]应用 (8)
data = GeoPosition[«1»];GeoGraphics[Point[data]]创建 SpatialPointData,仅包含美国本土(contiguous US)的酿酒厂:
spd = SpatialPointData[data, EntityValue[GeoVariant[Entity["Country", "UnitedStates"], "DefaultMapArea"], "Polygon"]]GeoGraphics[Point[spd]]img = [image];ImageMeasurements[img, "Dimensions"]data = SpatialPointData[ImageKeypoints[img]]Show[img, RegionPlot[data["ObservationRegion"]], ListPlot[data, PlotStyle -> Red], AspectRatio -> Divide@@Most[ImageMeasurements[img, "Dimensions"]]]data = SpatialPointData[GeoPosition[EntityClass["NuclearReactor", "Operational"]["Position"]] -> {"Name" -> EntityClass["NuclearReactor", "Operational"]["Name"]}, GeoBoundsRegion[{{-90, 90}, {-180, 180}}]]GeoListPlot[data]parks = {...};parks//Lengthpos = Map[WikipediaData[#, "GeoPosition"]&, parks];lat = MinMax[pos[[All, 1, 1]]]lon = MinMax[pos[[All, 1, 2]]]region = GeoBoundsRegion[{lat, lon}]定义 SpatialPointData:
USparks = SpatialPointData[GeoPosition[pos], region]PointValuePlot[USparks, Axes -> False, PlotStyle -> Yellow, GeoBackground -> GeoStyling["Satellite", Opacity[.8]], AspectRatio -> .75]parks = SpatialPointData[GeoPosition[{{44.35, -68.21666667}, {38.68333, -109.56667}, {43.75, -102.5}, {29.25, -103.25},
{25.46944444, -80.18611111}, {38.56666667, -107.71666667}, {37.6283, -112.16766},
{38.16691, -109.75966}, {38.2, -111.16666667}, {32.17527778, -104 ... 89}, {32.25, -110.5},
{36.56471, -118.77337}, {38.53333333, -78.35}, {46.96666667, -103.45},
{18.33333333, -64.73333333}, {48.5, -92.88333333}, {43.55635, -103.47865}, {61, -142},
{44.6, -110.5}, {37.85, -119.55}, {37.20262, -112.98785}}] -> {"Area" -> StructuredArray[QuantityArray, {58}, StructuredArray`StructuredData[QuantityArray,
{74.04950209409239, 119.31513925749647, 381.2635262915919, 1251.8616004686503,
270.27677625484813, 48.04857964535431, 55.99417403548851, 527.5153243204484, 37 ... 2.88006903320968, 631.3503886270221,
310.97509513103995, 110.07890532864783, 22.95237679384096, 340.72146295896226,
44.212506050904075, 20588.075726757837, 3468.5433678823215, 1189.5203262536681,
229.06750175120817}, "Miles"^2, {{1}}]], "Name" -> {...}}]AnnotationKeys[parks]PointValuePlot[parks, "Size"]data = SpatialPointData[GeoPosition[{{41.393745, -89.566491}, {41.393737, -89.559088}, {40.550486, -88.060516},
{40.561286, -88.061514}, {39.065123, -88.674501}, {41.389193, -87.772914}, {42.48088, -88.99612},
{38.59651, -88.967736}, {39.352261, -89.644688}, {39.189 ... 189, -89.5971},
{39.864834, -89.594745}, {39.422809, -87.661666}, {38.548123, -89.773096}, {38.7849, -89.702307},
{38.095086, -88.913791}, {38.549088, -89.763343}, {38.788362, -89.688869},
{38.030752, -88.923769}, {41.21407, -90.330727}}] -> "Status" -> {...}, Entity["AdministrativeDivision", {"Illinois", "UnitedStates"}]]data["Annotations"]Legended[PointValuePlot[data], PointLegend[...]]locations = GeoPosition[{{41.393745, -89.566491}, {41.393737, -89.559088}, {40.550486, -88.060516},
{40.561286, -88.061514}, {39.065123, -88.674501}, {41.389193, -87.772914}, {42.48088, -88.99612},
{38.59651, -88.967736}, {39.352261, -89.644688}, {39.189 ... 189, -89.5971},
{39.864834, -89.594745}, {39.422809, -87.661666}, {38.548123, -89.773096}, {38.7849, -89.702307},
{38.095086, -88.913791}, {38.549088, -89.763343}, {38.788362, -89.688869},
{38.030752, -88.923769}, {41.21407, -90.330727}}];status = {...};
vending = {...};
accessibility = {...};
names = {...};areas = SpatialPointData[locations -> <|"Status" -> status, "Vending" -> vending, "Accessibility" -> accessibility, "Name" -> names|>]areas[{"Annotations", "Keys"}]loc = MapThread[...];
legend = PointLegend[...];
Legended[GeoGraphics[{PointSize[.025], loc}, GeoProjection -> "Mercator", GeoRange -> Quantity[200, "Miles"]], legend]state = Entity["AdministrativeDivision", {"Oklahoma", "UnitedStates"}];data = EarthquakeData[state["Polygon"], 4, {{2010, 1, 1}, Today}, "Position"]spd = SpatialPointData[GeoPosition[data["Values"]], state["Polygon"]]GeoGraphics[{Polygon[state], Point[spd]}]属性和关系 (2)
查询定义好的 SpatialPointData 的属性:
data = {{41.69, 28.88}, {133.61, 36.75}, {693.6, 38.08}, {172.3, 52.17}, {509.57, 60.5}, {211.47, 82.14}, {299.61, 86.61}, {567.28, 87.6}, {729.98, 92.94}, {42.01, 95.63}};
dmarks = {"on", "off", "on", "on", "off", "off", "on", "on", "off", "off"};cmarks = {275.9, 241.2, 256., 442.9, 209.4, 260.4, 348.8, 315.2, 275.3, 317.8};spd = SpatialPointData[data -> {"Cell Type" -> dmarks, "Area" -> cmarks}]spd["Properties"]spd /@ {"ObservationRegion", "PointCount"}spd["Association"]reg = Rectangle[{-4, -4}, {4, 4}];sample = RandomPointConfiguration[PoissonPointProcess[10, 2], reg]ListPlot[sample, AspectRatio -> 1]reg1 = Disk[{0, 2}, 2];
sample["PointCount", reg1]reg2 = Rectangle[{-4, -3}, {1, -1}];
sample["PointCount", reg2]Show[RegionPlot[{reg1, reg2}, PlotRange -> {{-4, 4}, {-4, 4}}], ListPlot[sample], Axes -> True]文本
Wolfram Research (2020),SpatialPointData,Wolfram 语言函数,https://reference.wolfram.com/language/ref/SpatialPointData.html.
CMS
Wolfram 语言. 2020. "SpatialPointData." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/SpatialPointData.html.
APA
Wolfram 语言. (2020). SpatialPointData. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/SpatialPointData.html 年
BibTeX
@misc{reference.wolfram_2026_spatialpointdata, author="Wolfram Research", title="{SpatialPointData}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/SpatialPointData.html}", note=[Accessed: 04-December-2026]}
BibLaTeX
@online{reference.wolfram_2026_spatialpointdata, organization={Wolfram Research}, title={SpatialPointData}, year={2020}, url={https://reference.wolfram.com/language/ref/SpatialPointData.html}, note=[Accessed: 04-December-2026]}