Select to view content in your preferred language

Tracking amount of positions in an area, based on sorted data

3411
1
08-13-2012 11:59 AM
by Anonymous User
Not applicable
Original User: Xerial

Hello

I am currently working on a project on where players are tracked in a game we have created, but we have encountered some problems and hope that one of you knows the answer.

One of the things we are interested in; are tracking how long the players spend in certain areas. To perform this action, the data containing the players�?? positions have been loaded into the ArcMap from a single Microsoft Excel file.
We are then sorting the data and creating new layers for each player. Shapefiles are then created for each of the areas, in where we want to track the players.

The problem occurs when we try to make ArcMap calculate how long the players�?? have been in an area, no matter which of the sorted player data we join the shapefiles with, it gives the same count number.

I have tried to explain the way we are sorting the data, creating the shapefiles and joining them with the player data, in the hope that one of you can see what we are doing wrong.

To sort data the following steps have been performed:
1. Right Click the Layer containing the data and select �??Open Attribute Table�?�
2. From the menu bar select �??Select by Attributes�?�
3. Write the conditions for the selection, e.g.  click on �??Participant�?� and add �?� = 14�?� ("Participant" = 14)
4. Click Apply
5. Close the table window
6. Right click the layer containing the data and press �??selection�?� -> �??Create Layer from Selected Features�?�.
7. A new layer will be in the table of contents containing the data you selected

To count the time the player has spent in the area we need to count the dots within the boundaries of the drawn areas. (Each dot represent one fifth of a second)
1. Within ArcCatelog, create a new shapefile (Feature class) which will contain the different sub areas the player can enter.
2. When creating the shapefiles it is important to choose that it should be a polygon shape, else it cannot cover an area. (only a line or point)
2.1. Might be needed to specify the coordinate system, select one of the existing layers to give it the same coordinate system as that layer.
3. These shapefiles can then be added into ArcMap, but currently do not hold any data
4. Right click on the shapefiles -> Edit Features -> start editing (make sure the layer is ticked)
5. On the right side of the screen the window �??create features�?� is shown, select the shapefile and in the bottom of the window see the �??construction tools�?� window. Select �??Polygon�?�
6. Then it is possible to draw the different areas on the map which should be measured.
7. Right click the shapefile -> join and relate -> join
8. Select �??join data from another layer based on spatial location�?� and chose the layer containing the position data that should be measured.
9. Change the name of the new layer into a suitable name (e.g. Sheriff_Jail) and press �??OK�?�
10. To view the data, right click the new layer and chose �??Open Attribute Table�?�. It will have created a new column �??Count�?� with how many points are within the area.

Hope that it is explained well enough and that one of you is able to help us!

Regards
Martin �?rbæk
0 Kudos
1 Reply
by Anonymous User
Not applicable
Original User: ThomM

Hi Martin,

A very clear post. However I'm not exactly sure why it's not working; it sounds like it should be. Here are a few random suggestions which probably won't work 😉

One thing to check; are you stopping your edit session and saving your edits before performing your spatial join? If not, the geometry won't exist, so nothing can be joined to it. However, it sounds like you are getting results, so this probably isn't the problem.

What happens if you use the Intersect tool to intersect the polygon feature class with the points? Do you get a result then?

What is the number that you get each time? Is it related to anything sensible - the total number of features, or the total number of features for that player, or...? That might give you a hint about where to look.

Does the same thing happen if, rather than creating a layer from the selection, you actually export the selection as a new dataset? (After using Select by Attributes, right-click on the layer -> Data -> Export Data, make sure "Export selected features" is checked)

Are your polygon areas just a rectangular grid? If so, you can create them automatically with the Fishnet tool. This would be more reliable than your hand-drawn squares. You could also try using Point Statistics in Spatial Analyst, which would give you a raster output, which might not be what you want. If you have arbitrary polygons then this won't help 😛

I'd suggest reposting your question in the General ArcMap forum, that gets more traffic than this one here.

Let us know how you go!

Edit: Also, try running the "Repair geometry" tool on both of your feature classes. It's a bit of a black magic approach, and probably won't do anything, but it seems to fix a lot of these mysterious issues.
0 Kudos