SpatialPointSelect[spdata,crit]
SpatialPointData spdata の部分集合を crit に従って選択する.
SpatialPointSelect
SpatialPointSelect[spdata,crit]
SpatialPointData spdata の部分集合を crit に従って選択する.
詳細
- SpatialPointSelectは,一般に,ある部分を選んでより小さいSpatialPointDataを得るために使われる.
- SpatialPointSelectは,概念的には点集合と{{point1,ann1},{point2,ann2},…}の形の注釈に対してSelectとして動作してその一部を選択する.
-
- 基準関数 crit は,通常は点と注釈に条件がある,もし species が注釈キーの一つなら,(Norm[#Point]<1&& #species"Birch")&のようなブール式である.
-
- crit で次の引数を使うことができる.
-
#Point 点についての条件 #key 注釈の"key"に関連付けられた値についての条件
例題
すべて開く すべて閉じる例 (2)
spd = SpatialPointData[RandomReal[1, {100, 2}], Rectangle[{0, 0}, {1, 1}]]Show[RegionPlot[spd["ObservationRegion"]], ListPlot[spd["Points"]]]sub = SpatialPointSelect[spd, Element[#Point, Rectangle[{0, 0}, {1 / 2, 1}]]&]Show[RegionPlot[spd["ObservationRegion"]], ListPlot[sub["Points"]]]spd = SpatialPointData[RandomGeoPosition[GeoBoundsRegion[{{-23.43, 23.43}, {-180, 180}}], 100]]sub = SpatialPointSelect[spd, #Point["Latitude"] ≥ 0&]GeoListPlot /@ {spd["Points"], sub["Points"]}スコープ (7)
点の条件で (5)
spd = SpatialPointData[RandomReal[1, {100, 2}], Rectangle[]];Show[RegionPlot[{spd["ObservationRegion"]}], ListPlot[spd["Points"]]]reg = Disk[{0, 0}, .5];
sub = SpatialPointSelect[spd, Element[#Point, reg]&]Show[RegionPlot[{sub["ObservationRegion"], reg}], ListPlot[sub["Points"]]]spd = SpatialPointData[RandomReal[1, {5000, 2}]]pts1 = ListPlot[spd["Points"], AspectRatio -> 1]crit = Norm[#Point] < 1 / 2&;sub = SpatialPointSelect[spd, crit]Show[pts1, ListPlot[sub["Points"], PlotStyle -> Orange]]spd = SpatialPointData[RandomReal[1, {100, 2}]]cond = First[#Point] > 1 / 3&;sub = SpatialPointSelect[spd, cond]Show[ListPlot[spd["Points"], PlotStyle -> PointSize[0.03]], ListPlot[sub["Points"], PlotStyle -> {Orange, PointSize[0.015]}], AspectRatio -> 1]spd = SpatialPointData[RandomGeoPosition[GeoBoundsRegion[{{0, 90}, {-180, 0}}], 100]];GeoListPlot[spd["Points"]]sub = SpatialPointSelect[spd, GeoDistance[#Point, Entity["City", {"Chicago", "Illinois", "UnitedStates"}]["Position"]] < Quantity[2000, "km"]&]GeoListPlot[sub["Points"]]data = RandomReal[1, {500, 2}];
reg = Rectangle[];spd = SpatialPointData[data, reg]areaOfInterest = Rectangle[{1, .3}, {1.5, .5}];sub = SpatialPointSelect[spd, (0 < RegionDistance[areaOfInterest, #Point] < .2)&]Graphics[{{Opacity[.1], spd["ObservationRegion"]}, {Opacity[.3], areaOfInterest}, {ColorData[97, 1], Point[spd["Points"]]}, {ColorData[97, 2], Point[sub["Points"]]}, Inset[Style["reg", Bold], {0.05, 0.05}], Inset[Style["Area of Interest", Bold], {1.25, 0.4}]}]注釈で (2)
pts = RandomReal[1, {10, 2}];
reg = Rectangle[{0, 0}, {1, 1}];colors = RandomChoice[ColorData[97, "ColorList"], 10];
diameters = RandomReal[{0, 1 / 3}, 10];spd = SpatialPointData[pts -> {"color" -> colors, "diameter" -> diameters}, reg]spd["Annotations"]「色」の注釈値がRedに近い点を選択する:
sub = SpatialPointSelect[spd, (ColorDistance[#color, Red] < .7)&]sub["Annotations"]pts = RandomReal[1, {10, 2}];
reg = Rectangle[{0, 0}, {1, 1}];colors = RandomChoice[ColorData[97, "ColorList"], 10];
diameters = RandomReal[{0, 1 / 3}, 10];spd = SpatialPointData[pts -> {"color" -> colors, "diameter" -> diameters}, reg]spd["Annotations"]sub = SpatialPointSelect[spd, #diameter ≥ .1&]sub["Annotations"]アプリケーション (1)
data = SpatialPointData[«2»];GeoGraphics[data["ObservationRegion"]]reg = EntityValue[GeoVariant[Entity["Country", "UnitedStates"], "DefaultMapArea"], "Polygon"];{{minLat, maxLat}, {minLon, maxLon}} = GeoBounds[reg]selected = SpatialPointSelect[data, And[minLat <= (#Point["Latitude"]) <= maxLat&, minLon <= (#Point["Longitude"]) <= maxLon&]]SpatialPointSelectは,もとの観測領域を保持する:
selected["ObservationRegion"] == data["ObservationRegion"]選択した点と前より小さい観測領域で新たな空間点データを作成する:
breweries = SpatialPointData[selected["Points"], reg]GeoGraphics[{Point[breweries["Points"]], Red, breweries["ObservationRegion"]}]関連項目
関連するガイド
-
▪
- 空間点集合
テキスト
Wolfram Research (2020), SpatialPointSelect, Wolfram言語関数, https://reference.wolfram.com/language/ref/SpatialPointSelect.html.
CMS
Wolfram Language. 2020. "SpatialPointSelect." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SpatialPointSelect.html.
APA
Wolfram Language. (2020). SpatialPointSelect. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SpatialPointSelect.html
BibTeX
@misc{reference.wolfram_2026_spatialpointselect, author="Wolfram Research", title="{SpatialPointSelect}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/SpatialPointSelect.html}", note=[Accessed: 10-July-2026]}
BibLaTeX
@online{reference.wolfram_2026_spatialpointselect, organization={Wolfram Research}, title={SpatialPointSelect}, year={2020}, url={https://reference.wolfram.com/language/ref/SpatialPointSelect.html}, note=[Accessed: 10-July-2026]}