Assign data points to polygonal area

01-26-2022 12:00 PM
Labels (3)
New Contributor

I've got a bunch of data points from a wifi speedtest 123 survey. I've placed those points into a map and want to organize their location. Each data points contains a question that asks what room number the test has taken place, so I want to assign/move those points to their respective rooms without manually placing all 200+ points.

0 Kudos
2 Replies
MVP Honored Contributor

It sounds like a Join would work here. If your polygons have a room number and if your data points have the same exact number, those should join up will. 

Though, the join is just tabular, however, you could make new data points from the centroid of each polygon after the join is completed.

0 Kudos
Occasional Contributor III

Sounds like a job for Arcade and Batch Calculation Rules to me.  

I wrote this in a text editor so its not code ready to run, but it should look something like this I think:

var intRoomNum = $feature.RoomNumber
var pntGeom = Geometry($feature)
var fcRooms = FeatureSetByName($datastore, 'PolygonFloorPlanCall', ["globalId", "RoomNumber"],true)
var ftJustOneRoom = filter(fcRooms, "RoomNumber = @intRoomNum")
if (ftJustOneRoom == null){
return pntGeom
} else {
return Centroid(ftJustOneRoom)

Here is a great link to something very similar:

Hope this helps.



0 Kudos