2011-10-29 1 views
0

私はこの単純なタスクの答えを無駄にしようとしています。picasa APIを使用してpicasaの画像から緯度/経度(ジオタグ)を取得する

私はちょうど画像から緯度/経度(ジオタグ)を取得する必要があります。ドキュメントは、GeoRssWhereのGmlPosを更新する方法の例を示しています。 (http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_php.html)しかし、どうやってその情報を取得するのですか?

私は以下を試しましたが、私は何か間違っていると思います。

$where = new Zend_Gdata_Geo_Extension_GeoRssWhere(); 
    $georeff = $where->point; 

誰かが助けることができますか?

答えて

0

のPicasa APIは、あなたが地理データを取得するためにgetGeoRssWhere()を使用することができますZend_Gdata_Photos_PhotoEntry

としてエンティティを返します。

$geo = $photo->getGeoRssWhere(); 
0

私は私がやってみたかったようにジオタグが地図上の写真を表示するようになって偉大な例を見つけました。 http://picasaphpworkshop.googlecode.com/svn-history/r11/trunk/workshop.php

私が分からなかった部分は$ where-> getPoint() - > getPos()でした。 georsshwereを得た後。

Zend_Loader::loadClass('Zend_Gdata_Media_Extension_MediaKeywords'); 
Zend_Loader::loadClass('Zend_Gdata_Geo_Extension_GeoRssWhere'); 
Zend_Loader::loadClass('Zend_Gdata_Geo_Extension_GmlPos'); 
Zend_Loader::loadClass('Zend_Gdata_Geo_Extension_GmlPoint'); 
Zend_Loader::loadClass('Zend_Gdata_Photos_PhotoEntry'); 


$picasa = new Zend_Gdata_Photos(); 
$query = $picasa->newAlbumQuery(); 
$query->setUser('[email protected]'); 
$query->setAlbumName('MyAlbumNameFromURL'); 
$feed = $picasa->getAlbumFeed($query); 

foreach($feed as $num => $photoEntry){ 

      $where = $photoEntry->getGeoRssWhere(); 
      $lat = $where->getPoint()->getPos(); 
      //$lat = split(" ", $lat); // Split out the space-separated lat 

} 


echo "GeoReff: " . $lat . "<br />\n";  
関連する問題