UDCF Import and the <PLACE> Element

Problems ? Get help here!
Post Reply
gjc999
Posts: 45
Joined: Tue Aug 03, 2010 12:27 pm
Dive Computer: Pro 2.1

UDCF Import and the <PLACE> Element

Post by gjc999 »

HI. I have a lot of dives to import from another package that exports dive data via UDCF. I'm looking at the <PLACE> element in the exported UDCF, and I see data in the following format:

<PLACE>Country, Location, Dive Site</PLACE>

Now, I'm not sure at all that there is any info in the UDCF spec that says that those three fields are to appear in that order or not. Regardless, Mac Dive 2.0 is reading the PLACE element and dropping the whole string, commas and all, in the 'Site Name' column on imported dives. How hard would it be to add the ability to define the mapping for these fields to the Country, Location, and Site columns in Mac DIve so an import will correctly populate these values? Perhaps an option in the preferences dialog could do the trick. Something to accept a default mapping, or to break the values as needed.

Thanks for a great piece of software!
gjc999
Posts: 45
Joined: Tue Aug 03, 2010 12:27 pm
Dive Computer: Pro 2.1

Re: UDCF Import and the <PLACE> Element

Post by gjc999 »

Further investigation reveals that a UDCF export from Mac Dive 2.0.2 does not correctly import back into the Mac Dive log book. The Country, Location and Site fields are all concatenated and stored in the dive site column of the log table. The Country and Location columns are left as unknown. The UDCF spec doesn't seem to clarify what order, if any, these values should be, much less that these fields are expected at all, so I can understand the issue here.

Giving users some control of what to expect in that <PLACE> element seems like a reasonable fix, but I think the best fix is trying to support some sub-set of UDDF, which has much more detailed elements for this sort of data.
User avatar
nick
Site Admin
Posts: 4363
Joined: Sat Apr 12, 2008 8:33 am
Dive Computer: Shearwater Teric
Contact:

Re: UDCF Import and the <PLACE> Element

Post by nick »

Apologies for the delayed reply, I was away for a few days -

Yep, that field is freeform text. There's no way to know whether it should be split on commas or not, and even that isn't necessarily accurate. I store some parts of the location with a comma, so it can get messed up.

It's a limitation of UDCF with no ideal solution.
Post Reply