Search code examples
androidgoogle-mapsgoogle-fusion-tablesopenstreetmapshapefile

Best way to deal with big (shape-)data for map in Android Application


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

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.

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.

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

best Birgit

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.


Solution

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

    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/");