- 浏览: 7250921 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (1546)
- 企业中间件 (236)
- 企业应用面临的问题 (236)
- 小布Oracle学习笔记汇总 (36)
- Spring 开发应用 (54)
- IBatis开发应用 (16)
- Oracle基础学习 (23)
- struts2.0 (41)
- JVM&ClassLoader&GC (16)
- JQuery的开发应用 (17)
- WebService的开发应用 (21)
- Java&Socket (44)
- 开源组件的应用 (254)
- 常用Javascript的开发应用 (28)
- J2EE开发技术指南 (163)
- EJB3开发应用 (11)
- GIS&Mobile&MAP (36)
- SWT-GEF-RCP (52)
- 算法&数据结构 (6)
- Apache开源组件研究 (62)
- Hibernate 学习应用 (57)
- java并发编程 (59)
- MySQL&Mongodb&MS/SQL (15)
- Oracle数据库实验室 (55)
- 搜索引擎的开发应用 (34)
- 软件工程师笔试经典 (14)
- 其他杂项 (10)
- AndroidPn& MQTT&C2DM&推技术 (29)
- ActiveMQ学习和研究 (38)
- Google技术应用开发和API分析 (11)
- flex的学习总结 (59)
- 项目中一点总结 (20)
- java疑惑 java面向对象编程 (28)
- Android 开发学习 (133)
- linux和UNIX的总结 (37)
- Titanium学习总结 (20)
- JQueryMobile学习总结 (34)
- Phonegap学习总结 (32)
- HTML5学习总结 (41)
- JeeCMS研究和理解分析 (9)
最新评论
-
lgh1992314:
[u][i][b][flash=200,200][url][i ...
看看mybatis 源代码 -
尼古拉斯.fwp:
图片根本就不出来好吧。。。。。。
Android文件图片上传的详细讲解(一)HTTP multipart/form-data 上传报文格式实现手机端上传 -
ln94223:
第一个应该用排它网关吧 怎么是并行网关, 并行网关是所有exe ...
工作流Activiti的学习总结(八)Activiti自动执行的应用 -
ZY199266:
获取不到任何消息信息,请问这是什么原因呢?
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息 -
xiaoyao霄:
DestinationSourceMonitor 报错 应该导 ...
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息
GIS的学习(四十九)命令行使用 osmdroid-packager下载生成地图碎片
在以前网上经常介绍使用MobileAtlasCreator 下载地图碎片做离线地图,现在可以采用OSMMapTilePackager下载地图碎片,实现地图离线地图的碎片生成.
官方地址: http://code.google.com/p/osmdroid/wiki/HowToUsePackager
详细官方介绍如下
Introduction
This page explains how to use the osmdroid tile packager.
You will probably find it easier to use MobileAtlasCreator instead of this
Contents
- Why you might want to use it
- Determining the map area
- Run the tile packager
- Using the output
Why you might want to use it
You can use the tile packager in order to load tiles onto your device so that you will not need an internet connection when running an application that uses osmdroid.
Determining the map area
The first thing you need to do is to decide the area that you want to download. This means determining the coordinates. The easiest way is to go to OpenStreetMap.org, view the area that you want to download, and then click on the "Export" tab. You can then click the "Manually select a different area" link and choose your area by dragging a box over it. The coordinates are displayed in the "Area to Export" box.
Below is an example of choosing the lovely town of Haarlem in The Netherlands. This shows that the coordinates are:
North: 52.4244
East: 4.6746
South: 52.3388
West: 4.5949
Run the tile packager
Download osmdroid-packager-x.xx.jar.
Here is an example command line to download the area selected in the example above:
第两种方式
1.设置环境变量
参数的详细解释:
Here's what the parameters mean:
-u | http://tile.openstreetmap.org/%d/%d/%d.png | This is the pattern for tiles for the Mapnik format. |
-t | Mapnik | Location of the temporary download location. This should be the renderer name if you intend to use the zip directly in osmdroid. |
-d | haarlem.zip | Zip file to create when finished. |
-zmax | 18 | Maximum zoom level to download tiles for. |
The -d parameter is optional, in which case it won't create a zip file. In that case it also won't delete the temp files, since these are actually the required result. You can also use a .gemf or .sqlite extension in which case it will create an archive of the corresponding type.
Using the output
Just copy the zip to /sdcard/osmdroid on your device.
本文相关内容只用于个人研究,若用于商业请自行负责。
1. 下载Google地图切片到本地:如果没有要求地图显示中文,则可以用Google Maps Downloader下载Google地图到本地;如果要显示中文地图,则要用China Google Maps Downloader
2. 在tomcat服务器建个项目gmcn,为了方便查找文件,将文件按照zoom/x存放,如图:
3. 利用OpenLayers.Layer.TMS显示地图,重点是get_my_url()找到要显示的切片
<html> <head> <title>Google Local Tiles</title> <link rel="stylesheet" href="css/style.css" type="text/css" /> <script src="js/OpenLayers/lib/OpenLayers.js"></script> <script type="text/javascript"> var map, layer; //complex object of type OpenLayers.Map //Initialise the 'map' object function init() { map = new OpenLayers.Map("map", { maxExtent : new OpenLayers.Bounds(-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892), numZoomLevels : 18, maxResolution : 156543.0339, units : 'm', projection : "EPSG:900913", displayProjection : new OpenLayers.Projection("EPSG:4326") }); layer = new OpenLayers.Layer.TMS("Name", "http://10.0.0.239:8081/gmcn/", { 'type' : 'png', 'getURL' : get_my_url }); map.addLayer(layer); map.addControl(new OpenLayers.Control.Scale()); map.addControl(new OpenLayers.Control.MousePosition()); map.addControl(new OpenLayers.Control.LayerSwitcher()); var lonLat = new OpenLayers.LonLat(117.62519, 39.52329); lonLat.transform(map.displayProjection, map.getProjectionObject()); map.setCenter(lonLat, 8); } function get_my_url(bounds) { var res = this.map.getResolution(); var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w)); var y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h)); var z = this.map.getZoom(); var path = "" + z + "/" + x + "/gmcn_" + x + "_" + y + "_" + z + "." + this.type; var url = this.url; if (url instanceof Array) { url = this.selectUrl(path, url); } return url + path; } </script> </head> <!-- body.onload is called once the page is loaded (call the 'init' function) --> <body onload="init();"> <!-- define a DIV into which the map will appear. Make it take up the whole window --> <div style="width: 100%; height: 100%" id="map"></div> </body> </html>
参考:
Using Custom Tile Sources / Google-like Tile Layer Support
发表评论
-
TestNG简单的学习(十三)TestNG中Junit的实现
2013-12-04 09:00 3287TestNG和junit的整合 ... -
TestNG简单的学习(十二)TestNG运行
2013-12-03 09:08 51444文档来自官方地址: ... -
TestNG简单的学习(十一)TestNG学习总结
2013-12-03 09:08 13994最近一直在学习关于TestNG方面的知识,根 ... -
TestNG简单的学习(十)TestNG @Listeners 的使用
2013-12-03 09:07 8624TestNG官方网站: http://testng.or ... -
TestNG简单的学习(九)TestNG Method Interceptors 的使用
2013-12-03 09:07 2654TestNG官方网站: http://testng ... -
TestNG简单的学习(八)TestNG Annotation Transformers 的使用
2013-12-03 09:07 2757TestNG官方网站: http://testng.or ... -
TestNG简单的学习(七)TestNG编程方式运行
2013-12-02 09:22 2396TestNG官方网站: http://testng.or ... -
TestNG简单的学习(六)测试工厂注释的使用
2013-12-02 09:22 2713TestNG官方网站: http://testng.or ... -
TestNG简单的学习(五)参数化测试数据的定制
2013-12-02 09:22 2641TestNG官方网站: http://testng.or ... -
TestNG简单的学习(四)测试方法通过名称名称依赖实现
2013-12-02 09:21 2032TestNG官方网站: http://testng.or ... -
TestNG简单的学习(三)测试方法通过测试分组依赖实现
2013-12-02 09:21 2765TestNG官方网站: http://testng.or ... -
TestNG简单的学习(二)参数化测试并发且多方法测试方法判定
2013-11-29 15:35 3635TestNG官方网站: http://testng.or ... -
TestNG简单的学习(一)类和方法级别@Test的区别
2013-11-29 15:31 9379TestNG官方文档的地址: http://testng ... -
Feed4Junit的简单使用(七)Feed4TestNg
2013-11-29 13:35 6080在Feed4Junit主要针对junit实现的 ... -
Feed4Junit的简单使用(六)数据来特定格式文件
2013-11-29 12:29 2687Feed4Junit官方地址: http://da ... -
Feed4Junit的简单使用(五)数据来自动态约束数据
2013-11-29 12:29 2562Feed4Junit官方地址: http://datab ... -
Feed4Junit的简单使用(四)数据来自定义数据源
2013-11-28 14:09 3039Feed4Junit官方地址: http://databe ... -
Feed4Junit的简单使用(三)数据源来自数据库
2013-11-28 13:58 3097Feed4Junit官方地址: http://databe ... -
Feed4Junit的简单使用(二)数据源来自文件
2013-11-28 13:50 4521Feed4Junit官方地址: http://datab ... -
Feed4Junit的简单使用(一)
2013-11-28 13:47 2157Feed4Junit官方地址: http://databe ...
相关推荐
NULL 博文链接:https://topmanopensource.iteye.com/blog/1637317
设计用于完全替换 Android 内部的 MapView 类,包含一个模块化的地图拼图,支持在线和离线地图以及覆盖地图,支持标注图标、位置跟踪和绘制形状。地图引擎使用 OpenStreetMap
开源GIS---java系列开源GIS---java系列开源GIS---java系列开源GIS---java系列开源GIS---java系列开源GIS---java系列开源GIS---java系列开源GIS---java系列开源GIS---java系列开源GIS---java系列开源GIS---java系列...
win10解决安装.NET Framework 3.5安装不上,错误代码:0x800F081F,解决办法:超级管用。
spatialite gis是一个GIS小工具,能够从spatialite中读取、渲染空间数据。
gis学习文档gis学习文档gis学习文档gis学习文档gis学习文档gis学习文档gis学习文档gis学习文档
资源来自pypi官网。 资源全名:djangorestframework_gis-0.8.2-py3-none-any.whl
ArcObjects GIS应用开发--基于C#.NET--v3.1.pdf
基于RS和GIS的土地利用动态变化分析----以南京市高淳区为例,吴红云,张阳,利用GIS与RS技术,基于1995、2005、2015三期遥感影像研究南京市高淳区的土地利用变化规律,首先利用EXCEL生成1995-2005、2005-2015两个...
全国信息化工程师----GIS应用水平考试(NCIE-GIS.pdf
一个非常好用gis arctool的工具--距离角度生成点神器!只需要将该工具添加到ArcGIS自定义工具箱里面,双击即可运行,方便高效。
九段线地图-线图-GIS-科研教育用途
GIS在智慧交通中的应用介绍(GIS-T).pptGIS在智慧交通中的应用介绍(GIS-T).pptGIS在智慧交通中的应用介绍(GIS-T).pptGIS在智慧交通中的应用介绍(GIS-T).ppt
GIS设计与实现第十一章-GIS设计项目管理与质量保证合集.ppt
HTML+CSS+JS数据可视化大屏平台模板实例30-智慧物联网+GIS地图通用模板
全国 1-5 级河流 gis 地图shp,xml,shx,dbf文件 全国 1-5 级河流 gis 地图shp,xml,shx,dbf文件 全国 1-5 级河流 gis 地图shp,xml,shx,dbf文件
CG与GIS支持下的城市应急系统研究 GIS铁路用地信息管理系统研究与实现 GIS支持下的土地估价系统研究 GIS支持下的物流配送系统研究 房地产行业的信息化——基于GIS的房地产管理信息系统的发展趋势研究 . . .
GIS教案-第九讲-可视化与地图制图PPT课件.ppt
GIS数据转换器(矢量-矢量)转出的城市农村社区地图
《Visual C++开发GIS系统------开发实例剖析》书中代码