How to access Offline Maps in Android - android

I was given a task where i need to build an offline map i have shape file and a kml file..
I found something about kml where i need to parse the data and overlay the data on the maps.but it should be done from scratch.If there any tutorial Please do help me for kml.
or
IS there any easy way to store the maps offline and use it in android. i see lot of things like tpk,.map etc
please do help i am struck with this from abt a week and dint find any clue how to do it..

tpk is basically doing the map with tile packages concept, whereas the other option involves using sqlite format compact cache. for more details, you can consult arcgis library at
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#/Welcome_to_the_ArcGIS_Server_10_Help/009300000004000000/
and also this is for OSMdroid library
http://www.haakseth.com/?p=30. hope it will help you

Related

How to connect Kml layer + Autocomplete in Kotlin Android?

I have a question about SDK Google maps in Android
I have a Autocomplete Place that works perfectly. When i write some text in the input, google show me locations, and when i click on any print coordinates.
Question:
Is there any way to know if those coordinates are in a polygon of a Google my maps kml file?
I tried:
KmlLayer(map,id for local file, context)
Documentation: https://developers.google.com/maps/documentation/android-sdk/utility/kml
The problem is that i need the local kml file on my local repository. I need to get KML file from URL with a map id (https://www.google.com/maps/d/u/0/viewer?mid=XXXXrsxRFHqpMEmYXXXXX)
That "mid", can change, since sometimes I will need to use another kml file with a different url.
Also, Autocomplete documentation: https://developers.google.com/maps/documentation/places/android-sdk/autocomplete
Thank you everyone.
Any help would be greatly appreciated! Thanks

Offline google maps from image

Ok, so, I have a .tiff file that is my image for the map. I read a bunch of tutorials and forums about it, but I cannot find a solution on how to implement this. I created the .mbtiles, tried implementing that, it doesnt work, converted the .tiff file to .png, app crashes because of out of memory, been stuck here for some time, so, if anyone knows how to implement my .tiff, .mbtiles of .png file to a google map, please share that with me.
You need to implement a custom TileProvider and provide your implementation using the following way:
mMap.addTileOverlay(new TileOverlayOptions().tileProvider(new MyTileProvider()));
I suggest you to investigate this similar question.

Android : Shapefile in Googlemaps

I'm Developing an app with Google Maps. In which i need to show a layer of data from the shape file or imagery.
Do any one has an idea on how to do it, i have no idea how to project the layer over the Google maps in android.
Provide me with some API and sample codes if available else with any other suggestion.
There is no way to render .Shp file directly in Google Maps.
But if you really want to do then export .Shp to .Kml file using some QuantumGIS or ARC GIS and then Make XMLPullParser that can easily parse this .Kml file.
Refer this questions for more information
Does anyone know of a library in Java that can parse ESRI Shapefiles?
Android lib to read or parse shapefile
https://gis.stackexchange.com/questions/48191/how-to-display-esri-shapefile-in-android
https://gist.github.com/kiichi/6119073
With Google Maps Android API utility library you can display KML or GeoJSON data over a Google Maps MapView.
Now you only need to parse your shapefile and convert it to one of the previous mentioned formats.
The shapefile parsing process can be accomplished with one of the libraries mentioned in this question.
The conversion process (java objects to XML or JSON objects) will need to be programmatically handled by you.

Shp layer to Fusion Table

I need to store a .shp file (vector data file) in Fusion table and then "get" him from the fusion table and use it as a layer/overlay on my MapView in android (using google map Api)
is it possible ?
a sample of how to do it will be helpful...
Thanks in advance ! Tom.
I use shpescape.com to convert a shapefile to Fusion Tables, super useful. Getting it in a MapView is a bit trickier, because there is no "official" way to do it in the SDK. You may find some answers here and here.
The url that Gady P shared works, but here are some alternative options:
You need to get your shapefile into KML format. You can either use the Layer to KML tool in ArcGIS. It can be found in Toolboxes > System Toolboxes > Conversion Tools > From KML > KML to Layer.
You can also use GDAL/ogr2ogr to convert the shapefile to KML. I wrote a tutorial on doing this at the GISCollective website a few months ago...
http://giscollective.org/tutorials/gis-techniques/spatial-data-conversion-using-python/
It should be enough to walk you through how to convert it to KML.
Once you have it converted to KML just go to Google Drive and create your Fusion Table, then upload the KML from your computer.
EDIT: After re-reading my tutorial, it seems I give an example of converting a shapefile to KML, so this should be exactly what you need

osmdroid sqlite tile source

I want to add a SQLite tile provider to OSMDroid just like RMaps. I went through OSMDroid source code and its tile providers and I found that they are designed to get tiles from File, Archive file and internet.
I am using osmdroid-android 3.0.5.
I don't belive this is possible with the current Osmdroid library. If you want to do it you will have to create your own TileProvider to fit into the framework which should be possible.
I expect that using an archive file for the actual map tiles and a seperate database for your meta data is by far the simplest solution. Putting large amounts of data like the tiles into the database is not recomended.
Have a look at this page. I think this is what you are looking for :o)
I recently implemented a sqlite storage for the tiles of the osmdroid lib, and the only thing missing is the ability to create it with mobac. So I wrote this patch to provide the new output option. Please have a look and commit it if you like it. Let me know if you think I should change something.

Categories

Resources