Jump to content

.loc Files--what Is The Format?


reveritt

Recommended Posts

There are about a bazllion formats on the planet collectively known as ".loc". If you're asking about the one produced by geocaching.com, I know of no formal definition. It's XML without a formal DTD but it's pretty self-explanatory once you crack it open.

 

If you're interested in GPL'ed source that reads and writes them look in GPSBabel. The code for geocaching.com's strain of .loc is in geo.c.

Link to comment
It's XML without a formal DTD but it's pretty self-explanatory once you crack it open.

We must be talking about two different formats. The .LOC format I am looking for is the one that Pocket Queries produce. It's apparently proprietary to TopoGrafix (the guys who give away EasyGps). I doesn't look like XML. It looks like some sort of position-delimited format, but I can't make it out because it's full of non-printable ASCII.

 

I reckon I could decode it, but I was hoping to find a Spec. somewhere.

Link to comment

The .loc that the pocket queriest produce is the XML strain I described above.

 

There is another .loc produced by old versions of EasyGPS and ExpertGPS that more closely match what you're describing. It, too, can be read and written by GPSBabel...It's not documented as Topografix has deprecated that format in favor of GPX.

 

I'll wager that you've loaded the thing you got from a PQ into an old Topograffix progam and saved it and have confused the results with what you actually got from the PQ. That proces changed it from "geocaching loc" to "topografix loc" which have essentially nothing in common.

Link to comment

This is the header and text of one waypoint from an LOC file I got from GC.com

 

<?xml version="1.0" encoding="UTF-8"?>

<loc version="1.0" src="Groundspeak">

 

<waypoint>

<name id="GCGFTA"><![CDATA[The Volunteer Cache or Find The Bridge by Eagle Son]]></name>

<coord lat="41.6965166666667" lon="-88.1080166666667"/>

<type>Geocache</type>

<link text="Cache Details">http://www.geocaching.com/seek/cache_details.aspx?wp=GCGFTA</link>

</waypoint>

 

I believe this is just standard xml.

Link to comment
...

I'll wager that you've loaded the thing you got from a PQ into an old Topograffix progam and saved it and have confused the results with what you actually got from the PQ. That proces changed it from "geocaching loc" to "topografix loc" which have essentially nothing in common.

Yes, that appears to be the case. When I look at a new .loc file, without opening it in EasyGPS first, it is clearly XML. My recently-installed version of EasyGPS apparently reads the newer XML format, but doesn't write it.

 

Thanx.

Link to comment
...<waypoint>

<name id="GCGFTA"><![CDATA[The Volunteer Cache or Find The Bridge by Eagle Son]]></name>

<coord lat="41.6965166666667" lon="-88.1080166666667"/>

<type>Geocache</type>

<link text="Cache Details">http://www.geocaching.com/seek/cache_details.aspx?wp=GCGFTA</link>

</waypoint>

 

I believe this is just standard xml.

Yes, I can see that now, too (see my last post).

 

My problem is that when I upload a large .loc file to my Magellan Sportrak Map, it runs out of data for storing the "comment" field, which contains the actual cache name (as opposed to the waypoint ID). I want to write a little utility to preprocess .loc files and shorten the comment, or strip it out altogether--a trivial task, as it turns out.

 

Thanx.

Link to comment

Neither of the .locs are the preferred format by EasyGPS. GPX - a much more robust and better speciried - XML strain is the one it wants to write.

 

Not to sound like a Broken record, but GPSBabel has code for limiting the number of waypoint comments transmitted to a Magellan. This feature was added specifically to keep DirectRoute usable when you have lots of comments.

 

Shortening the comments won't help. You get 200 non-blank comments.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...