Thursday 2 September 2010

GPS 2 CAD & Android

I have recently picked up a project that I started awhile ago (I mention the idea in a previous post dated Jan 2010) when i started to learn android application development, after reading a friends blog on 7cache, a geocaching application he is working on for windows phone 7 it kind of got me wanting to try and finish an app idea i started and never went back to.

The idea behind the app was to use the GPS hardware in a phone to capture points and record them so that they could be used for CAD/mapping applications later on. When I started this I did not realise how in accurate the GPS could be, I knew that you were lucky to be accurate to within 5 metres of the point, but thought that the error would be reasonably constant once the GPS was stable. It would seem that this is not always the case.

The basic application started of life as the android notepad tutorial, the note editor was modified to record the GPS point data along with a title. To try and make the data useful afterwards I added an export to Dxf function (dxf is a drawing exchange format from Autodesk used by a large number of CAD applications). The dxf file contains points located by using x,y,z Cartesian co-ordinates which were converted from the GPS Latitude, Longitude and altitude recordings using some formulas to calculate bearing and range, along with a bit of basic trig (which i actually managed to remember the formulas for even though I have not used them for years).

An view capability was also added to allow the recorded points to be visualised while still on the phone. This was basic on the Open GL ES graphics demo from the android SDK with a zoom in and out function added.

This was where until last weekend I left it, the points plotting was in accurate even for the GPS and it was a bit lacking in other areas and I was not even sure if the app would be useful if I ever did do any more work on it.

I have now added a Map view so that recorded points can be shown on a map using the Google Maps API, this lets you see what you have stored and how accurate the GPs actually is. Adding this has actually made the whole thing feel like it has a purpose or some aim apart form me learning Java and more about android.

My current intent is to spend sometime trying to test if resultant data is at all accurate, the screens below are taken using the DDMS tool within eclipse to drive the GPS co-ordinates and take screen shots of the emulator and so are not really a good representation of accuracy of output.

Future plans are add an export latitude and longitude to file as well as look into a format that can be imported into a desktop application like Google Earth (KML or Kmz maybe).


some screen shots:




Dxf file viewed and lines added using DoubleCAD XT



2 comments:

Android app development said...

This one of the brilliant post.I learn some good tips from your post.This is one of the relevant Information.This is one of the supporter post.Android app developers

intercad said...

Wish I had an answer for you mate. I'm starring your question in hopes of some of my architect friends seeing it.

Solidworks Support