Android : Shapefile in Googlemaps - android

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.

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

How to access Offline Maps in 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

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

What solutions do we have to read and display Autocad DWG files on Android?

I would like to display rich maps contained in Autocad .dwg files in my Android app. I'd like to know if there is an existing java library to do so?
If not, is it doable to translate a dwg file to a model and draw that model shape by shape on the screen?
I can't use Google maps instead of these files. The whole point of the app is to display a map with a lot of data and all that data is contained in my autocad files library.
Besides, is there an alternative format to DWG that I could use to do exactly this? (UPDATE: would SVG do the trick?)
What I ended up doing is to convert all my files in KML. I've selected this format because it might be the most used format on Android to do GIS.
To make a custom map, I'm drawing overlays on a mapview using these hints. It's basically the most interesting solution. I don't need to pay attention to geolocation stuff, the cursor and the scale are manage by Google API itself.
If you're going to convert I'd probably suggest DXF. I haven't used it, but YCad is a java DXF library. There are also a number of DXF to SVG converters available but it's probably best to avoid two conversions.

Difficulty in displaying kml file with extension as .pl in android

I am developing an android application using google maps. I have to display some text information and some pictures related to the text. For this purpose I have a .pl file where the information is written as kml.
I know how to extract information using sax parser from an xml, however I am not able to decide as how to go ahead with .pl file.
I thought of downloading them into sd card and saving them as xml extension so the usual xml parsing can be used. But I don't know how to do this.
Kindly help or if there is some other way it can be done please tell.
Thanks,
Astha
KML is Keyhole Markup Language (KML) is an XML notation for expressing geographic annotation
Download sample project which can parse kml data from the following url.
http://www.warriorpoint.com/blog/downloads/
Thanks
Deepak

Categories

Resources