-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.cpp
50 lines (36 loc) · 1.34 KB
/
demo.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <iostream>
#include <string>
#include "src/geolocate.h"
#include "src/exif-gps.h"
#include "src/parse-eyefi-log.h"
#include <string.h>
#include <cstdio>
#include <cstdlib>
int main() {
/* const char *macs[4] = {
"00-21-29-96-31-e7",
"00-25-9c-57-de-a2",
"00-21-91-51-58-6d",
"00-17-9a-02-4e-05"
};
*/
std::string file("../pics/IMG_0024.JPG.log");
std::string imageName("IMG_0024.JPG");
LogFileResult result = parseLogFile(file, imageName);
std::cout << "result found " << result.image_found << " at " << result.image_time << std::endl;
std::cout << result.aps.size() << " aps." << std::endl;
for (int i = 0; i < result.aps.size(); i++) {
AccessPoint point = result.aps[i];
std::cout << "ap " << point.mac_address << " with signal " << point.signal << " at " << point.time << std::endl;
}
GeoLocateResult gresult = geolocate_locate(result.aps);
std::cout << "lat " << gresult.lat << " lon " << gresult.lon << " accuracy " << gresult.accuracy << " succeeded " << gresult.success << std::endl;
std::string imgFile("photo.jpg");
dumpAllExif(imgFile);
ExifGPS gps = readGPS(imgFile);
std::cout << "gps lat " << gps.lat << " gps lon " << gps.lon << std::endl;
std::string tmpFile("test.jpg");
writeGPS(tmpFile, gps);
dumpAllExif(tmpFile);
return 0;
}