Country/City Error ?

Country/City Error ?

Postby RogerSelwyn » Tue Mar 20, 2018 2:07 am

I've just noticed a possible error. When looking at my dives that I have brought through from Sven Knoch's Diving Log 6.0 on a PC. When I look at the dives in DiveLogDT they show an incorrect location. Looking at the 'Place' table in the database, it looks like it is using 'CountryID' to lookup a value in the 'City' table, when you'd really expect that it would look it up in the 'Country' table.

Not sure if this is intended or not. If it is, that's fine, I'll modify the values via a database editor (I couldn't see how to edit them in the interface). However since I have 700 or so dives, if it isn't meant to be like that I'd be happy not to have to correct the values.

Thanks
Roger
RogerSelwyn
 
Posts: 4
Joined: Tue Mar 20, 2018 1:47 am

Re: Country/City Error ?

Postby RogerSelwyn » Tue Mar 20, 2018 2:11 am

Just a thought, this problem shows when I look at a Dive Site in the Locations browser. The City shows to the right of the Rating.
RogerSelwyn
 
Posts: 4
Joined: Tue Mar 20, 2018 1:47 am

Re: Country/City Error ?

Postby support » Tue Mar 20, 2018 9:59 am

Hi Roger,

I'd like to divide this up into 2 issues for clarity.

First, I'd like to find out why DiveLogDT is showing an "incorrect location" when you brought it over from Diving Log 6.0 on the PC. Technically, that shouldn't be possible :-) One thing that might be happening is that Diving Log 6.0 allows you to have Locations that are *not* "linked". On the PC, when looking at a *Dive*, you must click the small icon next to the eg: DiveSite in order to have that "linked" to the list of eg: DiveSites. Often PC users don't do that and so Sven has a program that he can run on your logbook that will go through and automatically "link" all the Sites, Cities, Countries for you. Our software always creates things as "linked", but should work fine if they are set as "unlinked" when a logbook comes from a PC. (But Statistics depends on them being linked)

So first, could you elaborate on "incorrect" and maybe send us your Diving Log 6.0 logbook and the exported .sql file from it so we can take a look and see what is going on?

Now second, if you're running a database program over the sqlite file, you should know a few things. As you've noted, the Place table and the City table both have a "CountryID" column. I think when Sven created the database schema in the first place way back when, he accidentally used the name "CountryID" in the Place table and since this is generally hidden from sight, there was no reason to go to all the work to change the name. But most importantly, these fields are only used as a *suggestion* for what to *automatically* fill in for City and Country when the user selects a particular Place and City. Notice they are not tied to the dive at all. If you want to actually change the values for a Dive, you need to use the PlaceID, CityID, and CountryID fields in the Logbook table.

Of course you are welcome to use a Database Editor on the file if you want, but if you want to change multiple Dives at once using DiveLogDT, this might be easier and faster for you. If you select all the dives you want to change in the bottom window (using either the Command or Shift keys), then click Edit, you can change the Location Information all at once. (And of course anything else you want). Just select the eg: Site, or City, or Country you want them all changed to.

You can contact us at our support email address to send those files along and ask further questions if you'd like.

Thanks,
Janice
support
 
Posts: 590
Joined: Wed Mar 31, 2010 4:35 pm

Re: Country/City Error ?

Postby RogerSelwyn » Thu Mar 22, 2018 11:28 am

Hi Janice,

Sorry for not replying sooner, I thought'd I'd subscribed to the thread and it would email if any posts were added.

Thanks for your reply. I'll take your second point first, and I had noticed both Place and City had CountryID against them I've previously set them accurately, but haven't really worried about them being correct recently.

Can you confirm whether it should be showing Country or City in the Location browser when selecting a Dive Site? Then I'll have another dig into it. Then I can always send you my .sql file? Really it doesn't matter to me what Diving Log does any more because I don't use it, I've moved completely Apple. But it just looked like it was using a value set from Country to show a Place. But once I know what it is meant to do, I can let you know what it is doing and then when I send over a .sql let you know where to look.

Cheers
Roger
RogerSelwyn
 
Posts: 4
Joined: Tue Mar 20, 2018 1:47 am

Re: Country/City Error ?

Postby support » Thu Mar 22, 2018 4:22 pm

RogerSelwyn wrote:
> Hi Janice,
>
> Sorry for not replying sooner, I thought'd I'd subscribed to the thread and
> it would email if any posts were added.

Yeah, we have the same problem. Sometimes the software works, and sometimes it doesn't :-|

> Can you confirm whether it should be showing Country or City in the
> Location browser when selecting a Dive Site?

On the Locations panel, if you select an eg: Dive Site, the name in the Upper right corner is simply the City Name associated with the 'CountryID' for that Site. And if you have a City selected, the name in the upper right is simply the Country Name associated with the 'CountryID' for that City. It's just showing you what the suggested / default subsequent entry will be if you pick that Dive Site or City.

And FYI, if you're Editing a Dive, and if you pick a Dive Site, and then choose a different City, the default 'CountryID' for that Site will now change to be the new one.

AND Technically you can have 2 different dive sites with the same name. You can have a Site called 'Aquarium' associated with a live aboard in Belize, and you can have another Site called Aquarium associated with a land resort in Hawaii. You'd have two Dive Sites with the name Aquarium, but they would have different GPS locations and their 'CountryID's, ie: their default Cities, would be different so the name in the Upper right would be different for the two as an additional way to tell them apart.

Let us know if you see a problem with what you have,
Thanks!
Janice
support
 
Posts: 590
Joined: Wed Mar 31, 2010 4:35 pm

Re: Country/City Error ?

Postby RogerSelwyn » Fri Mar 23, 2018 1:07 am

Hi Janice,

OK, I see what it's doing. So I actually need to populate Place CountryID with a CityID value. As you say, when I started correcting the data many years ago on Sven's software, I'm pretty sure that value was being set in line with Countries rather than Cities, but I'm happy to correct it, that should be easy (just need to get my SQL right, I'm a bit rusty - just need to lookup from a dive to the site in Logbook where it is set correctly).

As a matter of interest, is there a way to set the correct City (CountryID) on Places through the GUI? I have quite a few where there is no CountryID set (I'm pretty sure ones I did on my iPhone because that has GPS on it). I don't want to have to get out a database tool every time I manage to enter it wrong.

And yes I agree that there should be possible to have multiple dive sites with the same name, just wish I'd been to Belize and Hawaii to dive Aquarium.... More likely Portsmouth and Poole to dive Green Water ;-)

Cheers
Roger
RogerSelwyn
 
Posts: 4
Joined: Tue Mar 20, 2018 1:47 am

Re: Country/City Error ?

Postby support » Fri Mar 23, 2018 12:02 pm

RogerSelwyn wrote:
> Hi Janice,
>
> OK, I see what it's doing. So I actually need to populate Place CountryID
> with a CityID value. As you say, when I started correcting the data many
> years ago on Sven's software, I'm pretty sure that value was being set in
> line with Countries rather than Cities, but I'm happy to correct it, that
> should be easy (just need to get my SQL right, I'm a bit rusty - just need
> to lookup from a dive to the site in Logbook where it is set correctly).
>
> As a matter of interest, is there a way to set the correct City (CountryID)
> on Places through the GUI? I have quite a few where there is no CountryID
> set (I'm pretty sure ones I did on my iPhone because that has GPS on it). I
> don't want to have to get out a database tool every time I manage to enter
> it wrong.

No one wants to have to use a database tool :-) Actually, isn't that what
logbook software is at it's core? Just a custom database tool for scuba
divers :-)

Yes. The Place.CountryID get's reset each time you Edit a dive, select a DiveSite,
and then manually enter a City. Once the City is selected, the Place.CountryID
will get reset to that City. And the same thing for the City to Country connection.
So it get's (re)set each time you Edit it manually.

So, no database program required! Also, DiveLog for iOS does the same thing
so it should have been set there too.

> And yes I agree that there should be possible to have multiple dive sites
> with the same name, just wish I'd been to Belize and Hawaii to dive
> Aquarium.... More likely Portsmouth and Poole to dive Green Water ;-)

Hah! I'm sure there are places with the same dive site name in Green water
too! For some reason, we don't get too creative with dive site names sometimes.

Janice
support
 
Posts: 590
Joined: Wed Mar 31, 2010 4:35 pm


Return to Dive Log

Who is online

Users browsing this forum: No registered users and 2 guests

cron