Hi there,
I am planning on making a geo-location collection, so that would be an array with arrays, kind a like
[[5.124, 50.132], [6.324, 49.123], [7.132, 52.1234]]
So, I obviously want to be able to check if an adress is new or already in the array. Since written adresses sometimes vary little or much but end up the same (so even levenstein isn't really a solution), I'd also like to (double) check with the geo codes. But unfortunately in this scenario neither IndexOf nor contains work, at least as I tried, namely
indexOf(geocodesarray, [long, lat])
contains(geocodesarray, [long, lat])
long and lat being variables assigned from the geo location block
Is that supposed to work, but I'm doing something wrong?
I've also just tried saving those two variables as an array, and using that new variable in the indexOf/contains, but same result. Obvioulsy I'm using one that's already present in my data set, so it should be found. What surprised me more is, when I compare (=) those two arrays, the "found" one, with the one present in the dataset, it returns false. Now I remember someone posting an array (deep) comparison flow that talked about that...
So my guess is, the only way to do this would be:
1) loop through the whole data set with a for each until it matches, having to compare the two values inside, not the whole arrays against each other...
2) using findAll, joining the dataset array to a string, and as a regex "{long}, {lat}"
The second option obviously works... I just hoped there would be a more "direct" option.
Like I said, perhaps I'm missing something, and there is another (better) solution - please let me know!
Many thanks in advance