Use Google Earth to geotag the dive sites

3rd party extensions (phpDivingLog, dive computer downloader,...)
AndyDragon
Posts: 110
Joined: Tue Nov 14, 2006 08:38
Location: Penetanguishene, Ontario
Contact:

Re: Use Google Earth to geotag the dive sites

Post by AndyDragon »

awesome, can't wait to play with it!
Andrew Forget
PADI IDC Staff Instructor 212158
lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: Use Google Earth to geotag the dive sites

Post by lloyd_borrett »

G'day,

So I downloaded the updated version and copied it into where I had the old version running. Then I clicked on the exe file. It came up with a Microsoft .NET Framework error: Unhandled exception has occured in your application.

The details were:

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at DL5GeoTag.FormPlace.Form3_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.237 (RTMGDR.030319-2300)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
DL5GeoTag
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/Diving%20Log%205.0/DL5GeoTag/DL5GeoTag.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.235 built by: RTMGDR
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.236 built by: RTMGDR
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.237 (RTMGDR.030319-2300)
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.233 built by: RTMGDR
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.233 built by: RTMGDR
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data.DataSetExtensions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
If I click continue I get the program to run. I think I've got the new version because it now has "ft" next to the Max Depth. (A version number displayed somewhere within the program might help.)

I open a logbook and it lists the dive sites, but I can't see any icon showing which dives have co-ords. And the indicator is still saying the depth is in feet when my logbook setup is using metric.

So I went through the process again but this time deleted the files first. Still the same problem.

Also, one of my dive sites should be "0°17'3.47"S" for the Lattitude, but DL5GeoTag drops the "0".

Any chance you could put a space between the various parts of the Lattitude and Longitude to make them easier to read? That is "0° 17' 3.47" S" instead of "0°17'3.47"S".

By the way, I think the sort order is by most recently changed, not created. I can see how that would work for most people. For me, having the ability to know which sites don't have co-ords will be more important.

Something for Sven to consider: Being able to easily add approximate location information this way also highlights to me the need for Diving Log to be able to record the source and/or accuracy of location information. Because now for some dive sites I might have highly accurate information sourced from GPS marks, but for other dive sites it's only approximate locations souced via Google Earth, web sites, maps and other non-accurate sources. Being able to easily distinguish which values can be used to accurately locate and dive a site is vitally important. I don't people going out and trying to use the innacurate marks.

Best Regards, Lloyd Borrett.
rene
Posts: 65
Joined: Sun Sep 12, 2010 19:07
Location: France

Re: Use Google Earth to geotag the dive sites

Post by rene »

Hello Lloyd,

Thank you for testing, I will investigate... Unluckily the text if the exception is not very helpful :p

What regional settings do you use ? And which version of Windows ?

If you see "ft" after the MaxDepth textbox, DivingLog is configured to use feet for depths (UnitFeet="1" in the registry).
1.jpg
1.jpg (25.63 KiB) Viewed 37317 times
By default, I use meters. The only way to see "ft" is to turn on this setting in DL.

The icon for sites with coords, it should look like:
1.jpg
1.jpg (44.12 KiB) Viewed 37317 times
Text is shifted by 16 pixels

Did you launch the program outside DL5 ? And then open a logbook with the toolbar button ? (normally it's possible only if you don't have a "default" logbook selected in DL5).

For spaces between digits and seperators in coords, I use the same format as Diving Log ;) I can easily change if you think it's more readable.

Finally, if you can send me by email your Place table it may help me (create an empty logbook and import the dive sites from your logbook).

Regards,
rené
lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: Use Google Earth to geotag the dive sites

Post by lloyd_borrett »

rene wrote: What regional settings do you use ? And which version of Windows ?
MS Windows 7 Professional on an Acer Eee PC netbook with 1024 x 600 screen resolution. Regional settings are for Australia.
rene wrote: If you see "ft" after the MaxDepth textbox, DivingLog is configured to use feet for depths (UnitFeet="1" in the registry).

By default, I use meters. The only way to see "ft" is to turn on this setting in DL.
Diving Log is configured to use metres. See screenshot below...
Screen shot of DL5.0.5
Screen shot of DL5.0.5
dl5_preferences.png (21.51 KiB) Viewed 37314 times
I can't see any UnitFeet in my registry settings for DivingLog. Indeed, I can't see any registry settings that seem to have anything to do with any unit settings. Are you sure that's where Sven is getting them from? Or maybe he assumes default settings for metric units and only creates registry values if they are changed at some point. Maybe the errors are to do with your code not finding any registry settings.
rene wrote: The icon for sites with coords, it should look like:
Text is shifted by 16 pixels
No icons are being displayed.
Screenshot showing what's happening
Screenshot showing what's happening
dl5geotag_screenshot.png (66.54 KiB) Viewed 37314 times
Note that the dive being displayed in the screen shot above has a depth of 34 metres. But 34 feet being displayed.
rene wrote: Did you launch the program outside DL5 ? And then open a logbook with the toolbar button ? (normally it's possible only if you don't have a "default" logbook selected in DL5).
Yes, I did that too.
It doesn't open the currently set default logbook.
rene wrote: Finally, if you can send me by email your Place table it may help me (create an empty logbook and import the dive sites from your logbook).
Will do.

Best Regards, Lloyd Borrett.
Last edited by lloyd_borrett on Tue Sep 27, 2011 08:16, edited 1 time in total.
rene
Posts: 65
Joined: Sun Sep 12, 2010 19:07
Location: France

Re: Use Google Earth to geotag the dive sites

Post by rene »

Ok, the exception should occur before some settings are read and the listbox correctly initialized.

There is a serious candidate:
this.placeTableAdapter.Connection = new OleDbConnection(dbs.ToString());

not protected by a try-catch and throw an exception if datasource can't be found.

I will certainly make a ClickOnce application like the Andy's one. And manage the version number...

Patch in some minutes.

rené
lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: Use Google Earth to geotag the dive sites

Post by lloyd_borrett »

G'day rene,

Did you see this update to my previous post...
I can't see any UnitFeet in my registry settings for DivingLog. Indeed, I can't see any registry settings that seem to have anything to do with any unit settings. Are you sure that's where Sven is getting them from? Or maybe he assumes default settings for metric units and only creates registry values if they are changed at some point. Maybe the errors are to do with your code not finding any registry settings.
AndyDragon
Posts: 110
Joined: Tue Nov 14, 2006 08:38
Location: Penetanguishene, Ontario
Contact:

Re: Use Google Earth to geotag the dive sites

Post by AndyDragon »

Lloyd,

Here is where I see these values in the registry, I have one for each unit type...hmm...I assume if the value does not exist, use the default (for me that would be imperial)...might have to reverse that logic:

HKEY_CURRENT_USER\Software\Divinglog\Divinglog50\Start

Can you confirm whether or not the UnitFeet value is there or not?

Sven: do you set these values if the units are metric? I will peek in the application code, but might take time to track it down...
Andrew Forget
PADI IDC Staff Instructor 212158
AndyDragon
Posts: 110
Joined: Tue Nov 14, 2006 08:38
Location: Penetanguishene, Ontario
Contact:

Re: Use Google Earth to geotag the dive sites

Post by AndyDragon »

I looked at Sven's code and he doesn't delete the settings if they are changed to metric, but if the settings dialog is never opened and then the OK button clicked, it's possible the values are not set yet (did not do a complete scan of the code to see if they're initialized elsewhere).

In his code, he does provide a default value for the GetValue() function for the registry and uses "0" as the default. I have changed my code to do the same. I will publish a new clickonce later with the changes. Rene, the new code will be checked into the repository, you can see what I'm doing in that code (DivingLogRegistryHelper.cs in the view model project).
Andrew Forget
PADI IDC Staff Instructor 212158
lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: Use Google Earth to geotag the dive sites

Post by lloyd_borrett »

AndyDragon wrote:Here is where I see these values in the registry, I have one for each unit type...hmm...I assume if the value does not exist, use the default (for me that would be imperial)...might have to reverse that logic:

HKEY_CURRENT_USER\Software\Divinglog\Divinglog50\Start

Can you confirm whether or not the UnitFeet value is there or not?
I'm now at home, without my Netbook computer where I'm running the Diving Log software and the add-ons, plus have my up-to-date database files. But there were no values anywhere in the registry under DivingLog50 related to unit settings on that netbook setup.

And I've just checked the setup on my home computer, which also has Diving Log 5 installed, and it also has no registry values for UnitFeet.

I'm guessing that Sven uses metric as the default metric settings. Then as I've never changed them to any imperial settings, Sven hasn't needed to create those registry values.

Best Regards, Lloyd Borrett.
Last edited by lloyd_borrett on Tue Sep 27, 2011 10:06, edited 1 time in total.
rene
Posts: 65
Joined: Sun Sep 12, 2010 19:07
Location: France

Re: Use Google Earth to geotag the dive sites

Post by rene »

Hello Lloyd,

I do something with the registry value UnitFeet (if it exists or not) AFTER the exception has been thrown. So the program will use the code default value which is "feet" (I don't why I wrote that... since I'm European :p).

And yes, I'm sure that Sven stores the unit settings into the Registry :)

But these values seem not to be created if preferences window has not been opened or its button OK not clicked.

Still don't have idea for:
Also, one of my dive sites should be "0°17'3.47"S" for the Lattitude, but DL5GeoTag drops the "0".
BTW, DL5 reformats the lat/lon without spaces. I can add spaces between numbers, but DL5 will suppress them.

I will see for ClickOnce later.

Here is the updated version : http://google-earth-tagging.googlecode. ... ag_1.2.zip

rené
lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: Use Google Earth to geotag the dive sites

Post by lloyd_borrett »

I think Sven's code assumes the default is metric unit settings and only creates values in the registry when someone changes them.

Remember, the data values in the tables are always metric, regardless of what the unit settings are.

I'll test your new version tomorrow on my netbook computer.

Best Regards, Lloyd Borrett.
rene
Posts: 65
Joined: Sun Sep 12, 2010 19:07
Location: France

Re: Use Google Earth to geotag the dive sites

Post by rene »

lloyd_borrett wrote:I think Sven's code assumes the default is metric unit settings and only creates values in the registry when someone changes them.

Remember, the data values in the tables are always metric, regardless of what the unit settings are.

I'll test your new version tomorrow on my netbook computer.

Best Regards, Lloyd Borrett.
I assume the same things, if no error occured :)

Thank you. G'night :)
lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: Use Google Earth to geotag the dive sites

Post by lloyd_borrett »

An asside. I've always found it strange that Sven uses "Meters" not "Metres" for the English spelling of the length units in Diving Log.

In most versions of the English language (e.g. UK and Australian), metre is a unit of distance (such as in micrometre, millimetre, metre, and kilometre). In many instances even the USA, notorious for messing with English spelling, also use metre.

Meter is any device that measures something (such as gas meter, parking meter, speedometer, and voltmeter) or to a particular measurement (such as diameter and perimeter).

Best Regards, Lloyd Borrett.
rene
Posts: 65
Joined: Sun Sep 12, 2010 19:07
Location: France

Re: Use Google Earth to geotag the dive sites

Post by rene »

Thank you for these details, Lloyd !

In general I am extremely attached to the spelling (especially French, it's easier for me ...). For example, I cannot stand that people write "sa va" instead of "ça va" (<=> it's okay).

For non native English speaking writers, it's difficult to choose between UK English and American English. I know that they are some differences, like programme => program, analyse => analyze, I'll take a bath => I'll have a bath (or the inverse...), etc.

So, when I develop or write somthing, I try to choose an "international" english (or what I believe an international english is), e.g. the american one. I guess German people do the same thing :lol:

From now on, I will use "metre" instead of "meter" for the unit :angelic:

the USA, notorious for messing with English spelling
:mrgreen:

When I was young I spent a month in the United States, trying to learn to speak English (not a total success ...) My host family said that even people with good education spoke very badly English .

By the way, google translates "mètre" => "meter" 8)
AndyDragon
Posts: 110
Joined: Tue Nov 14, 2006 08:38
Location: Penetanguishene, Ontario
Contact:

Re: Use Google Earth to geotag the dive sites

Post by AndyDragon »

To make matters worse, here in Canada (90% of our "English" is UK English spelling), we use meter usually (kilometers and kilometers per hour) yet we use Litres. How messed is that? Also, Canadians use all weird capitalization (meter, but Litre). We use colour, not color (UK). We say dove (usually) instead of dived (US). We seem quite confused!

When I develop though, inside code or in exposed UI, everything is American spelling. Habit given who I work for...
Andrew Forget
PADI IDC Staff Instructor 212158
Post Reply