I've written a guide (attached) which is the method I use to import Speed Camera POI's. A lot of this has been done from memory so please let me know if any of it needs clarifying or just doesn't make sense/work. There is a lot of preparation to be done the first time you create the db, but updating it is easy.
Importing Speed Camera Locations to the RNS.pdf
The process makes use of a VBScript file to modify the camera data and convert it to the format I prefer. In the interest of openness I have attached the code contained in PrepareCameraData.vbs. You can copy everything in the code block and save it as PrepareCameraData.vbs if you don't feel comfortable downloading the file.
Code: Select all
Set objFSO = CreateObject("Scripting.FileSystemObject")
strSourceFolder = "Source Data"
strOutputFolder = "Output Data"
' Clear any files in the output folder
objFSO.DeleteFile(strOutputFolder & "\*.*")
' Open the source folder
Set objSourceFolder = objFSO.GetFolder(strSourceFolder)
Set colFiles = objSourceFolder.Files
' Loop through the list of files and process appropriately
For Each objFile in colFiles
If inStr (objfile.Name, ".asc") Then
If inStr (objFile.Name, "specs") Then
Call addToFile(objFile.Name, "Average Speed")
ElseIf inStr (objFile.Name, "redlight") Then
Call addToFile(objFile.Name, "Red Light")
ElseIf inStr (objFile.Name, "_mobile_") Then
Call addToFile(objFile.Name, "Mobile Confirmed")
ElseIf inStr (objFile.Name, "_pmobile_") Then
Call addToFile(objFile.Name, "Mobile Predicted")
ElseIf inStr (objFile.Name, "gatso") Then
Call addToFile(objFile.Name, "Fixed")
End If
End If
Next
For Each objFile in colFiles
If inStr (objfile.Name, ".asc") Then
If inStr (objFile.Name, "20") Then
Call addToFile(objFile.Name, "20")
ElseIf inStr (objFile.Name, "30") Then
Call addToFile(objFile.Name, "30")
ElseIf inStr (objFile.Name, "40") Then
Call addToFile(objFile.Name, "40")
ElseIf inStr (objFile.Name, "50") Then
Call addToFile(objFile.Name, "50")
ElseIf inStr (objFile.Name, "60") Then
Call addToFile(objFile.Name, "60")
ElseIf inStr (objFile.Name, "70") Then
Call addToFile(objFile.Name, "70")
ElseIf inStr (objFile.Name, "var") Or inStr (objFile.Name, "tba") Then
Call addToFile(objFile.Name, "VAR")
End If
End If
Next
Wscript.Echo "Done"
Sub addToFile(strInputFile, strCategory)
strDestName = strOutputFolder &"\Speed Camera " & strCategory & ".asc"
Set objSourceFile = objFSO.OpenTextFile (objSourceFolder & "\" & strInputFile, 1)
Set strOutputFile = objFSO.OpenTextFile (strDestName,8,True)
Do Until objSourceFile.AtEndOfStream
strLine = objSourceFile.ReadLine
If instr (strLine, ";Longitude,Latitude,Name") = False _And inStr (strLine, "Copyright PocketGPSWorld.com") = False Then
strOutputFile.WriteLine(strLine)
End If
Loop
strOutputFile.Close
objSourceFile.Close
End Sub
You do not have the required permissions to view the files attached to this post.