TrackLog or GPS points to Polyline

2853
1
03-16-2013 05:04 AM
KwantharLim
New Contributor
Hi All,

I would like some help. I have recently started using ArcPad and love this software. I am new to programming for this platform (previously in Matlab).
My little project to familiarize myself is to mimic features of a consumer GPS, like a Tomtom or Navman.
I finished my basics of 'hello world'.

I want to store the tracklog as a polyline, so when I view it in ArcGIS it doesn't show up as just points.
I also want to have it storing as a file and format I can easily identify on the device (atm. Juno 5).

So far I have implemented some other peoples code, many thanks to them.

Now I am stuck (see green text below), because I do not know what command to use for saving the polyline into a file
I assume I need to use GPS points X Y Z and keep stringing the line?


Sub Step01

'++ LOAD MAP: open whole file with shape etc

Application.Map.Open("C:\Users\Public\Documents\ArcPad\Samples\World\world.apm")
'Application.MessageBox( "Loaded map.")

'++ turn on GPS

If Application.GPS.IsOpen then
Application.GPS.Close() ' Turn off the GPS
End If

'++ when GPS ok prompt press next button
Application.GPS.Open() 'Turn on the GPS
Application.Timer.Enabled = True
Application.Timer.Interval = 360000
Application.MessageBox("Awaiting GPS Signal")

Application.MessageBox(Application.GPS.IsValidFix)

'
dim count
count=0
For count=1 to 2
if Application.GPS.IsValidFix = "False" then 'Wait for GPS fix
count=1
else
count=2
end if

Application.MessageBox(Application.GPS.IsValidFix)
Application.Timer.Enabled = True
Application.Timer.Interval = 3600000
'Application.MessageBox("Awaiting Fix Poxition")

Next

'
' Archive TrackLog: STUCK here!!
'
Dim TrackLayer, fileName, DateText
Set TrackLayer = Application.Map.Layers(0) 'Get the tracklog layer

fileName = "TrackLogging" 'Identify file
DateText = "_" & hour(now) & minute(now) & second(now) & "_" & Day(Date) & "_" & Month(Date) & "_" & Year(Date) 'Create a DateTime Stamp
application.messagebox(DateText) 'check if working
Dim myFile
Set myFile = Application.CreateAppObject("file") 'Create a File object to save the tracklog polyline.

'save data
call myFile.<COMMAND??>((fileName & DateText & ".shp"), fileName & DateText &".shp")



Application.ExecuteCommand("centerongps") 'centre on GPS location
'++ turn on Tracking
Application.ExecuteCommand("gpstracklog")


End Sub


Thanks in advance for help and consideration.
Tags (3)
0 Kudos
1 Reply
GarethWalters
Occasional Contributor III
Hi Kwanthar,

I wrote a sample a while back doing this - http://www.arcgis.com/home/item.html?id=a5e11ba4a4d04b4a8f84757911ceb413

Download, and copy and edit to your needs.

I hope this helps.

Cheers,

Gareth