Hello all,
I am having trouble with reassigning GroupIDs.
For my project, I have two feature classes: a basic points layer and a collection of geolocated images.
As you can tell, there are 4 images for every point. I am trying to create a field in the images that matches the objectID of the points. I have already done this through buffers and have confirmed that it would work. However, I also need to test if I can group the images temporally.
From what I can tell, the only way to do this is through the Group by Proximity tool (if there is a better way to do this please let me know!). With a little bit of tinkering the tool can group the images into three groups. However, how they are aggregated into those groups is out of my control. For instance, while I only need three groups, the tool creates many more and (I believe) assigns them to the most reasonable one.
Luckily, these IDs are still in chronological order so if the point feature is collected in the same order as the images, the subsequent "adding attachments" will be a walk in the park. I need to find a way to rank these values and calculate the field as that rank.
Ex.
I'd appreciate any advice and insight!
Solved! Go to Solution.
Never mind guys, I realized I was the GIGuy.
rank = 0
rank_value = 0
def ranked(x):
global rank
global rank_value
newValue = x
if newValue == rank_value:
return(rank)
else:
rank_value = newValue
rank = rank + 1
return(rank)
Never mind guys, I realized I was the GIGuy.
rank = 0
rank_value = 0
def ranked(x):
global rank
global rank_value
newValue = x
if newValue == rank_value:
return(rank)
else:
rank_value = newValue
rank = rank + 1
return(rank)
In all seriousness though, this only works when it's in order