使用 PHP 的 picasa API 从 picasa 图像中获取纬度/经度(地理标记)

发布于 2024-12-12 06:34:23 字数 444 浏览 0 评论 0原文

我到处寻找这个简单任务的答案,但没有成功。

我只需要从图像中获取纬度/经度(地理标记)。该文档给出了如何更新 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;

有人可以帮忙吗?

I have looked everywhere to try and get the answer to this simple task to no avail.

I just need to get the lat/long (geotag) from an image. The docs give an example of how to update the GmlPos in the GeoRssWhere. ( http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_php.html ) But how do you just retrieve that info?

I'v tried the below, but I think i'v got something wrong.

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

can someone help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

后来的我们 2024-12-19 06:34:24

我发现了一个很好的例子,让地理标记在地图上显示照片,就像我想做的那样。 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";    

I found a great example getting geotag to display photos on a map like I wanted to do. http://picasaphpworkshop.googlecode.com/svn-history/r11/trunk/workshop.php

The part I couldn't figure out was the $where->getPoint()->getPos(); after getting the 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";    
时光倒影 2024-12-19 06:34:23

Picasa API 将实体返回为 Zend_Gdata_Photos_PhotoEntry

您可以使用 getGeoRssWhere() 获取地理数据:

$geo = $photo->getGeoRssWhere();

The Picasa API returns entities as Zend_Gdata_Photos_PhotoEntry

You can use getGeoRssWhere() to get the geo data:

$geo = $photo->getGeoRssWhere();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文