I want to development an application like this:
There is a csv file containing the coordinates as follow.
30.6674,36.8925
30.6651,36.8926
30.6649,36.8923
...
I want to route the way on google maps api by getting the coordinate information from csv file.
How do I do this, can you give sample link or any suggestion.
Thanks.
loading csv file content in an array:
http://www.webdeveloper.com/forum/showthread.php?t=225845
passing an array of addresses (or coordinates) to the API:
how to use the google maps api with greasemonkey to read a table of addresses and trace the route?
--- EDITED [28/10/2011] ---
here: Loading an array from a .txt file? (Android)
and here: https://stackoverflow.com/questions/5668507/trying-to-load-a-list-of-overlay-positions-from-file
Related
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
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.
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
I have a KMZ vector file which works fine on my Google Earth application, but i want to overlay this on my phone (android) through Google maps.
Is that possible?
A KMZ file is simply an archived structure, containing a main KML file and zero or more supporting files. I'm assuming you want the KML data? That's what represents the "route"-like content of the KMZ.
As far as displaying a KML file goes, it's been done before - check out this previous SO question - it involves parsing the KML with a SAX parser (or other compatible parsing class) and piecing it into a path. Once you have a list of coordinates, you can create a custom Overlay class, which could take in a coordinate list as an argument. Then, on the onDraw() method of the Overlay class you simply draw a path representing the list of coordinates. For more information on drawing routes, check this out.
If that's not what you're looking for, drop a comment and I'll see what I can do!
i am creating an application in which i need to open the google map to show some nearby locations, the addresses are stored in my local DB.
can anybody suggest me what is the best way, or it will be very helpful if u share some demo code.
You might want to marshall your DB contents into a kml file and have the map view show that. This guy shows how to to do it in a previous post Adding a KML layer to an Android maps application