1

I am developing an app and I need to draw a path and his elevation profile. I have a .kml file with all the data I need, but i don't know how to draw the path and create the elevation profile.

I don't want to have a internet connection on my phone in order to retrieve data from google, therefore I can't use the google map API to create the path and the elevation.

I want something like that:

Route

I have the kml file with all coordinates and with my phone gps I should be able to know where I am on the route. The elevation profile should be something like that:

enter image description here

I know I can do it with google api (draw an overlay over a mapview and create the elevation using elevation api), but I didn't want to need internet connection since I have all the path data I need in a kml file and gps on my phone.

Can someone tell how it's possible to draw graphics like that on Android without Google API, and have any time the knowledge of my current position (or aprox. position) on the graphics ?

Thank you for your time.

Community
  • 1
  • 1
João Nunes
  • 711
  • 4
  • 11
  • 22

3 Answers3

1

I dont' know how to create the Elevation profile but, Here is how to draw a route on map, which get Latitude/Longitude from JSON. You can study and apply it with yours

Hope it help

Community
  • 1
  • 1
April Smith
  • 1,810
  • 2
  • 28
  • 52
  • Thanks, i'm gonna try to draw the route profile. Maybe it works similar for the creation of the elevation profile. – João Nunes Feb 08 '12 at 16:49
0

You can use Android GraphView or AChartEngine.

David
  • 901
  • 1
  • 13
  • 37
0

It depends on the complexity of the draw you want to do and how you would like to draw it. From what I see you want something 3d. In android you can do it, with opengl. A good opengl resource is http://developer.android.com/guide/topics/graphics/opengl.html. Secondly, you will need to get used with drawing terrains, and nehe http://nehe.gamedev.net/tutorial/beautiful_landscapes_by_means_of_height_mapping/16006/ .Even so you are half of your, road, but for small terrain size that should do it. If you want something more complex you will have to use a LOD(level of detail algorithm). Check for vterrain at Rendering Level of Detail.