Because of the lack of response so far, I've reproduced my previous results, and listing them here, along with my methods.
Hope this can set some more focus on the issues.
First thing first, the issues with pinpointing a photo to an index in the returned array of photos from a given geographical area.
Logically you should be able to generate the same result if you take 100 photos at once, and if you take the 100 just one at a time and append them to an array. However as I discovered this isn't the case.
The following is a vardump of the rectangle I'm working with for this sample. Its the same for both of the following code bits.
Code: array(2) {
["sw"] => array(2) {
["lat"] => string(13) "55.6356227551"
["lng"] => string(13) "12.2433150247"
}
["ne"] => array(2) {
["lat"] => string(13) "55.6636420396"
["lng"] => string(13) "12.3482058545"
}
}
The first codebit is suppose to take the first 100 photos from the area, and print them one at a time.
[PHP]
>From that I get the following result. Note: no dublets.
Code: 0: 3883690
1: 6116408
2: 852601
3: 20732571
4: 5907200
5: 11652870
6: 7376918
7: 15543176
8: 24481510
9: 933615
10: 24500327
11: 24499303
12: 24499362
13: 3237553
14: 4031813
15: 7618666
16: 1345296
17: 237124
18: 9310307
19: 5144171
20: 1292113
21: 3048961
22: 6939130
23: 26680629
24: 24499876
25: 14247681
26: 11250236
27: 852573
28: 5590081
29: 11653015
30: 94870
31: 11992966
32: 1291894
33: 5907353
34: 24481597
35: 24500308
36: 23471790
37: 24481480
38: 5884360
39: 24500278
40: 9549175
41: 18711762
42: 427854
43: 5319212
44: 3400135
45: 24481144
46: 24505835
47: 10506390
48: 23361660
49: 5862231
50: 4423302
51: 18711306
52: 24498810
53: 4423701
54: 20046929
55: 18732365
56: 18732023
57: 3048198
58: 1345343
59: 24499770
60: 24500079
61: 24499235
62: 9310384
63: 1370409
64: 24499178
65: 9310419
66: 24500107
67: 2300680
68: 24481167
69: 26680507
70: 18732282
71: 18731510
72: 9310328
73: 18731091
74: 9492294
75: 24499786
76: 24499334
77: 24498857
78: 18731758
79: 3891481
80: 23363070
81: 24499909
82: 18711707
83: 23361639
84: 24499058
85: 9310460
86: 24500158
87: 23362847
88: 24499010
89: 3048273
90: 23361726
91: 24500191
92: 24481103
93: 9310474
94: 22618856
95: 9310369
96: 14247665
97: 9737848
98: 9309792
99: 9310403
The second codebit is suppose to take the first 100 photos from the area one by one, and print them.
[PHP]
>From that I get the following result. Note all the dublets.
Code: 0: 3883690
1: 6116408
2: 6116408
3: 852601
4: 20732571
5: 20732571
6: 5907200
7: 5590081
8: 11653015
9: 94870
10: 11992966
11: 11652870
12: 11652870
13: 7376918
14: 7376918
15: 15543176
16: 933615
17: 24500327
18: 24500308
19: 23471790
20: 24481480
21: 5884360
22: 24500278
23: 18711762
24: 24499362
25: 24499362
26: 24481144
27: 24505835
28: 24499362
29: 3237553
30: 24481144
31: 24505835
32: 4031813
33: 4031813
34: 7618666
35: 4031813
36: 4031813
37: 7618666
38: 7618666
39: 1345296
40: 1345296
41: 4423701
42: 1345296
43: 4423701
44: 237124
45: 237124
46: 9310307
47: 9310307
48: 5144171
49: 5144171
50: 18732023
51: 3048198
52: 1292113
53: 1292113
54: 3048961
55: 6939130
56: 24499770
57: 26680629
58: 24500079
59: 24499235
60: 9310384
61: 1370409
62: 24499178
63: 9310419
64: 9310419
65: 24500107
66: 2300680
67: 24481167
68: 18732282
69: 18731510
70: 18731091
71: 18731091
72: 9492294
73: 24499786
74: 24499334
75: 24498857
76: 18731758
77: 3891481
78: 3891481
79: 23363070
80: 24499909
81: 18711707
82: 23361639
83: 24499058
84: 9310460
85: 24500158
86: 23362847
87: 24498952
88: 24499010
89: 3048273
90: 23361726
91: 24500191
92: 24481103
93: 9310474
94: 22618856
95: 14247681
96: 14247681
97: 14247665
98: 9737848
99: 9309792
If I was just getting all 100 photos at once it wouldn't be an issue, cause they seem to be unique in that case (but the order is not always the same, every time I retrieve the list, but I will come to that later).
The fact of the matter is however, that I'm using the following method to chunk up the thumbsarray for my custom photolist widget, as getting a full list of maybe 700 or so photos, as there are in some areas, can take a while for a user to retrieve.
[JavaScript]
Code: var url = 'http://www.panoramio.com/map/get_panoramas.php';
url += '?set=public';
url += '&from='+(number*chunk_size);
url += '&to='+((number*chunk_size)+chunk_size);
url += '&minx=<?= $rect['sw']['lng'] ?>';
url += '&miny=<?= $rect['sw']['lat'] ?>';
url += '&maxx=<?= $rect['ne']['lng'] ?>';
url += '&maxy=<?= $rect['ne']['lat'] ?>';
url += '&size=square';
url += '&callback=handleChunk';
Calling this dynamicly as the user scrolls through the photolist widget.
Current implementation of this with the area from the samples above:
http://lokus.dk/taastrup/hoeje_taastr./billeder/panoramio
I've used the div-structure from the Panoramio photolist widget, but the method behind to get the photos is custommade with calls to the service with URLs created as shown above. The chunk_size right now is 20 (vertical photolist), but in a soon upcomming version its 32 (horizontal photolist)
Because we are getting the photos in chunks its easy to hit upon the dublets, ofcause, the larger the chunk_size, the smaller the chance for this to happen, but if we turn it up too far the user is going to experience excessive loadtimes.
But ideally the arrays should be dependable, and even better, sortable (which they doesn't seem to be either)
I mentioned that there once in a while appears to be something up with the ordering. It infact looks more like that a single photo pops into the list once in a while, and then out the next time you reload the exact same list.
I can't really reproduce this, as it seems to be rather random, but it has happened in the first chunk of photos on
http://lokus.dk/taastrup/hoeje_taastr./billeder/panoramio .
So just reloading that site some times can produce the phenomenon, but its not garentied to.
Next thing on the issue-list is photos which gets returned from the data api, with a thumbnail, but can't be shown in the photo widget.
It doesn't happen all that often, but it does happen for some photos. Using the folllowing options to create the photowidget.
We use photoId + userId to get the photo. Which is retrieved from the current position in our photolist widget.
[JavaScript]
Code: var photoWidtgetOptions = {
'width': 510,
'height': 340,
'rows': 1,
'columns': 1,
'croppedPhotos': false,
'attributionStyle': panoramio.tos.Style.HIDDEN,
'disableDefaultEvents': true
};
var photodisplay_widget = new panoramio.PhotoWidget('panoramio_displayarea',
{disableDefaultEvents:true,'ids':[{'photoId':photo_id,'userId':user_id}]},
photoWidtgetOptions
);
I've found a case here which has existed for at least some days.
The photoId is 6039564
The userId is 612176
And unless the ordering of the array we are working with changes, a sample can de found at
http://lokus.dk/charlottenlund/sophus_bauditz_vej/billeder/panoramio?pos=3
The photo exist if I go to
http://www.panoramio.com/photo/6039564, so I don't get why its not retrievable via the widget. (Some privacy settings?)
Last thing on my current issue-list
The count field in our result set, when retrieving photos from an area, doesn't match the rowcount in the photos array, when we use the data API.
The following is the method I'm using to get the count from the result set, and how many rows actually gets returned.
[PHP]
Here is 2 samples, first their coord sets followed by the result of the method above.
[Sample 1]
Code:
array(2) {
["sw"] => array(2) {
["lat"] => string(13) "54.7610839535"
["lng"] => string(13) "11.9125184726"
}
["ne"] => array(2) {
["lat"] => float(54.7660839535)
["lng"] => string(13) "11.9925184726"
}
}
count: 10
rowcount: 0
[Sample 2]
Code: array(2) {
["sw"] => array(2) {
["lat"] => string(13) "55.6356227551"
["lng"] => string(13) "12.2433150247"
}
["ne"] => array(2) {
["lat"] => string(13) "55.6636420396"
["lng"] => string(13) "12.3482058545"
}
}
count: 323
rowcount: 247
As you can see in the first sample there should be 10 photos, but we get none returned.
In the second sample there should be 323, but we only get 247.