cmcmahon
Posts: 6
Joined: Wed Dec 03, 2008 12:34 am

WGS84 to SPC 83

Wed Dec 03, 2008 12:42 am

I am working within .NET I have WGS84 datum comming in at 1 sec intervals and would like to convert it to SPCS 83 and shoot it back out the second serial port.

When i build i get the following error message:

InvalidArgument=Value of '31' is not valid for 'SelectedIndex'. Parameter name: SelectedIndex

Here is a snippet of the code:


Private Sub init_grid_dropdown(ByRef dd As System.Windows.Forms.ComboBox)
dd.Items.Add("No Grid")
dd.Items.Add("SPCS 83")

dd.SelectedIndex = SPCS_83

End Sub

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: WGS84 to SPC 83

Wed Dec 03, 2008 1:36 am

SelectedIndex is an integer value between 0 and Count-1, is it not?
In this case I suppose dd.SelectedIndex=1 would be appropriate.

Regards,
Jonas

cmcmahon
Posts: 6
Joined: Wed Dec 03, 2008 12:34 am

RE: WGS84 to SPC 83

Wed Dec 03, 2008 6:10 pm

I made the switch and the program compiles and runs now but it does not seem that the conversion is happening properly.

The incoming WGS84 data looks like it is being parsed correctly and we converted back from decimal and it looks like it is correct. But the Grid data does not look correct at all.. It is almost like it is converting to something other than SPCS83...

Here is an example

Input:

Latitude: 39.6564794
Longitude: -78.7687978650001
Datum: WGS84

Output:

Easting: 691414.756606895
Northing: 4392010.1085083
Zone: 17S
Grid: SPCS 83


Here are the two snippetts of code

Private Sub init_datum_dropdown(ByRef dd As System.Windows.Forms.ComboBox)
dd.Items.Add("No datum")
dd.Items.Add("WGS 84") ' World, gps standard
dd.Items.Add("NAD 83") ' North America

dd.SelectedIndex = 1
End Sub

Private Sub init_grid_dropdown(ByRef dd As System.Windows.Forms.ComboBox)
dd.Items.Add("No Grid")
dd.Items.Add("SPCS 83")

dd.SelectedIndex = 1

End Sub

Return to “GpsTools”