Flickr Web サイトからクロールされた画像 ID のリストがあります。
その場所(緯度と経度)を取得する必要があります
これは私のコードです
File source = //images id
File target = // images location
Scanner scanner = null;
PrintStream pStream =null;
String apiKey = //;
Flickr flick = new Flickr(apiKey);
PhotosInterface photosInterface= flick.getPhotosInterface();
try {
scanner= new Scanner(source);
pStream= new PrintStream(target);
while (scanner.hasNext())
{
String line = scanner.nextLine();
if (photosInterface.getPhoto(line).getGeoData()!=null)
{
pStream.println(Float.toString(photosInterface.getPhoto(line).getGeoData().getLatitude())+"\t"+Float.toString(photosInterface.getPhoto(line).getGeoData().getLongitude()));
}
else pStream.println("null");
}
System.out.println(lineNumber);
}
catch (Exception e) {
}
}
この場合、この命令を実行したい
pStream.println("null");
の場合には:
画像が利用できない ( FlickrException)
または、画像が GeoData に関連付けられていません
これを行う方法?