【问题标题】:Get Lat/Long (geotag) from picasa images with picasa API with PHP使用 picasa API 和 PHP 从 picasa 图像中获取 Lat/Long(地理标记)
【发布时间】:2011-12-17 17:57:33
【问题描述】:
【问题讨论】:
标签:
php
zend-framework
picasa
【解决方案1】:
Picasa API 将实体返回为Zend_Gdata_Photos_PhotoEntry
您可以使用getGeoRssWhere() 获取地理数据:
$geo = $photo->getGeoRssWhere();
【解决方案2】:
我找到了一个很好的例子,让地理标签像我想做的那样在地图上显示照片。 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('user@gmail.com');
$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";