以应对Android应用程序大(形状 - )数据在地图的最佳方式 [英] Best way to deal with big (shape-)data for map in Android Application

查看:247
本文介绍了以应对Android应用程序大(形状 - )数据在地图的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立原型,为一个Android应用程序应导致一个多功能的地图,可以处理,这将在一个单独的平台上举办一个大型而静态量环境数据与(用户生成的)数据相结合这一点。
我目前的做法是获取通过谷歌Fusion Tables的大型静态数据(原始形状文件 - .SHP,.DBF,.SHX我已经出口与QGisMaps一个.KML - 在更小.KML我现在用的就是已经66.4MB,一个供最终使用了140 MB ...)我知道这是可能的切片下来.KML但这种对加载时间的影响?
你可以看到谷歌地图的形状数据的最新的例子在这里 https://www.google .COM / fusiontables /数据源?snapid = S717313eWaJ

I am building the prototype for an Android app that should result in a versatile map that can deal with a large but static amount of environmental data combined with (user-generated) data that will be hosted on a separate platform. My current approach is to fetch the large static data via Google Fusion Tables (in original a shape file - .shp, .dbf, .shx that I have exported as a .kml with QGisMaps - the "smaller" .kml I am using is already 66.4MB, the one intended for final use over 140 MB...) I know it is possible to slice down .kml but will this have an effect on loading times? You can see a current example of the shape data on Google Maps here https://www.google.com/fusiontables/DataSource?snapid=S717313eWaJ

但是,如果我在正确的道路上,因为在所有的数据这一层是载入速度很慢我的机器上,我不知道麻烦来把这个地图到Android应用程序,现在我想知道 - 更重要也从一个单独的服务器获取更多的数据,并把它作为顶部的另一个(过滤)层。这一层会从用户那里收集的数据,因此不能静态,但定期更新 - 显示在每个地理色整数值

But now I am wondering if I am on the right path at all since this one layer of data is loading very slowly on my machine and I am not aware of the hassle to put this map into an Android app - and more importantly also fetching more data from a separate server and putting it as another (filterable) layer on top of it. This layer will be collected data from users, thus not "static" but regularly updated - integer values displayed in color per geodata.

几个人暗示我使用开放街道地图,但一定注意,Android是非常雄辩与谷歌地图 - 在开发过程中我想也许有人可以告诉我,我是否选择了正确的方向去或者最有可能面临少问题的替代解决方案。

Several people hinted me to use Open Street Maps but some advised that Android is very eloquent with Google Maps - in the middle of development I thought maybe someone can tell me whether I chose the right direction to go for or are most likely facing less problems with an alternative solution.

我会很高兴,如果有人能在这个问题上有两个不同来源的layerd结合地图数据到在Android的一个映射,而一个数据串是巨大的,但静态的和其他用户生成的值劝我。

I would be really glad if someone could advise me on the issue with combining map data from two different sources layerd onto one map in Android whereas one bunch of data is huge but static and the other user-generated values.

非常感谢您的时间和期待在这个

Thanks so much for your time and looking over this


吉特

编辑#1:我现在切换到开放街道地图,希望能够成立一个自己的GeoServer承载数据和查询与App的WMS。好像仍有待COM $ P $以某种方式pssed的数据的大小,我会及时向大家发布。

EDIT #1: I am now switching to Open Street Maps, hoping to be able to set up a GeoServer myself hosting the data and querying the WMS with the App. It seems like the size of the data still has to be compressed in some way, I will keep you updated.

推荐答案

这就是我如何最终转化一个.shp文件成可以通过OSMdroid的XYTilesource显示的格式。

So this is how I eventually converted a .shp file into a format that could be displayed by OSMdroid's XYTilesource.

我单独导出的图层作为.KML预测WGS84和进口他们作为层TileMill。后经违抗颜色CSS中的每一层,我出口我的地图作为一组MBTiles的。我上传他们Mapbox.com。从那里,我可以卖到这是在我OSMdroid图形页面的格式a.tiles.mapbox.com/v3/myUsername.myTiles/{z}/{x}/{y}.png瓷砖。

I exported the layers separately as .kml projected WGS84 and imported them as layers to TileMill. After having defied the colors for each layer in CSS, I exported my map as a set of MBTiles. I uploaded them to Mapbox.com. From there I can fetch the tiles which are in the format a.tiles.mapbox.com/v3/myUsername.myTiles/{z}/{x}/{y}.png in my OSMdroid Mapview.

final myTileSource tileSource = new XYTileSource("myTiles", null, 10, 16, 256, ".png", "http://a.tiles.mapbox.com/v3/myUserName.myTiles/");

这篇关于以应对Android应用程序大(形状 - )数据在地图的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆