利用libcurl 抓取google影像瓦片
来源:互联网 发布:在淘宝订的机票可信吗 编辑:程序博客网 时间:2024/05/21 14:40
libcurl
libcurl主要功能就是用不同的协议连接和沟通不同的服务器~也就是相当封装了的sockPHP 支持libcurl(允许你用不同的协议连接和沟通不同的服务器)。, libcurl当前支持http, https, ftp, gopher, telnet, dict, file, 和ldap 协议。libcurl同样支持HTTPS证书授权,HTTP POST, HTTP PUT, FTP 上传(当然你也可以使用PHP的ftp扩展), HTTP基本表单上传,代理,cookies,和用户认证。 官网
函数讲解可见: http://blog.csdn.net/haihsl123456789/article/details/41147949
Google瓦片抓取
瓦片相关信息可见:http://blog.csdn.net/mengdong_zy/article/details/50517682
实现代码如下:
#include <iostream>#include <unistd.h>#include <curl/curl.h>#include <curl/easy.h>using namespace std;size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream){ int written = fwrite(ptr,size,nmemb, (FILE*)stream); return written;}int main(void){ CURL *curl; curl_global_init(CURL_GLOBAL_ALL); const string url = "http://mt2.google.cn/vt/lyrs=y@258000000&hl=zh-CN&gl=CN&src=app&x=214130&y=114212&z=18"; curl = curl_easy_init(); FILE *fp; curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); if( (fp = fopen("/users/XXX/xxxx/test.jpg","ab")) == NULL ) { curl_easy_cleanup(curl); exit(1); } curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp); curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0");//这个要加不然文件传输不完全,字符串内容可自定义 double downloadFileLenth = 0; if(CURLE_OK == curl_easy_perform(curl)) { curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &downloadFileLenth); cout << " the file size is " << downloadFileLenth / 1024.0 << endl; } curl_easy_cleanup(curl); return 0;}
1 0
- 利用libcurl 抓取google影像瓦片
- 利用Python实现google瓦片转Arcgis瓦片
- 利用Python实现google瓦片转Arcgis瓦片
- google瓦片地址
- 《Google Map中的瓦片》
- osgearth加载本地离线影像瓦片地图
- 全景影像多层级瓦片生成
- Cesium:局域网离线影像及瓦片影像地图加载
- 利用Google Custom Search API抓取google搜索内容
- 利用Python在Jetson TX2上抓取和显示摄像头影像
- 一步步DIY: OSM-Web服务器(七) 利用 Google WebService 批量下载遥感瓦片数据
- 一步步DIY: OSM-Web服务器(七) 利用 Google WebService 批量下载遥感瓦片数据
- google map 瓦片地图算法
- Google瓦片地图算法解析
- Study《Google Map中的瓦片》
- Google瓦片地图算法解析
- Google瓦片地图算法解析
- Google瓦片地图算法解析
- 完整的Linux嵌入式环境搭建(Ubuntu 9.10)
- CMake中find_package功能演示
- OpenCV图像读写
- 【剑指offer之数组中出现次数超过一半的数字 】
- ImageView的scaleType属性设置区别
- 利用libcurl 抓取google影像瓦片
- 子字符串查找(上):从暴力算法到KMP
- url重写
- Java中String int A=null与String int A=""区别。
- 进程之间的通信-剪切板
- web.py框架入门
- mac版jdk,maven,eclipse安装
- 禁止通过ip直接访问网站来防止恶意解析-(apache,nginx,iis)
- 最简单动态设置不同cell高度的方法。