GSAK (Geocaching Swiss Army Knife)
Contents - Index

Database Variables

All Database variables begin with $d_ and each variable has a given type. Caches database variables are displayed as columns and more information can be found here. ("string" database variables have a physical limit of 2gb)

Most database variables  can be updated simply by using the statement $d_SomeVariable = $SomeValue, where $d_SomeVariable is a valid database variable and $SomeValue is any valid variable or literal (but it must match the data type of the database variable). This actually updates your database, but as some variables are calculated from other items in the database there are exceptions. These are:  $d_Bearing, $d_Changed, $d_Degrees, $d_Distance, $d_FoundCount, $d_HasCorrected, $d_HasUserNote, $d_HastravelBug, $d_LastFoundDate, $d_LastGPXDate, $d_LastLog, $d_LastUserDate, $d_LatOriginal, $d_LonOriginal, $d_NumberOfLogs, $d_UserNoteDate, $d_cByUser, $d_cParent, $d_cPrefix, $d_kBeforeCounty, $d_kBeforeState, $d_kCode, $d_kBeforeLat, $d_kBeforeLon, $d_lIsowner, $d_lParent, $d_aName

$d_ Database variables are separated into 5 GSAK tables -  caches, corrected, logs, waypoints, and attributes You can navigate through each of these tables using the Table and Goto commands. Note: The tables CacheImages, LogImages and Custom are not supported in this manner - use Sqlite to read these tables. 

Caches
 
Variable   Type  Description
$d_Archived   Boolean   Deprecated - use $d_Status instead
$d_Bearing    String   Bearing (NW, SW, etc) from current centre point
$d_CacheID    String  Unique cache ID
$d_CacheType    String   A 1 character string representing the cache type (See below)
$d_Code    String   Unique Waypoint code
$d_Changed      Date  Date data was actually changed in this waypoint
$d_Container   String  Container size
$d_County      String   County
$d_Country      String   Country
$d_Created      Date   Date the waypoint was created in the database
$d_Degrees  Numeric  Bearing in degrees from your current centre point
$d_Difficulty  Numeric  Difficulty rating
$d_Distance    Numeric  Distance from current centre point
$d_DNF  Boolean  Cache currently has the DNF flag
$d_DNFDate  Date  Date of most recent DNF
$d_Elevation Numeric  Elevation (always in meters)
$d_FavPoints Numeric Geocaching.com favorite points
$d_Found   Boolean  Found Status
$d_FoundCount   Number   Found Count (number of times you have found this cache)
$d_FoundByMeDate  Date  Date of your most recent find for a cache
$d_FTF     Boolean  First to find
$d_GcNote String Geocaching.com personal note
$d_Guid String Geocaching.com cache GUID
$d_HasCorrected  Boolean  Waypoint has corrected coordinates
$d_HasTravelBug  Boolean  Cache has a travel bug
$d_HasUserNote   Boolean  Waypoint has a user note
$d_Hints   String   Hints for this cache (decoded)
$d_IsPremium Boolean Geocaching.com member only cache status
$d_LastFoundDate   Date   Date the cache was last found (by anybody)
$d_LastGPXDate  Date   Date this waypoint was last updated by loading a GPX file
$d_LastLog   Date   Date of the last log for this cache (any log)
$d_LastUserDate  Date  Date this waypoint was last updated manually by any user action
$d_LatOriginal    String   Original Latitude (before change by corrected coordinates)
$d_Latitude   String  Latitude in decimal degrees format
$d_Lock    Boolean   Waypoint is locked see columns
$d_LongDescription  String  Cache Long description
$d_LongHTM     Boolean  Long description contains HTML code
$d_LonOriginal   String  Original Longitude (before change by corrected coordinates)
$d_Longitude   String   Longitude in decimal degrees format
$d_MacroFlag   Boolean  Macro only "UserFlag" see MacroFlag command
$d_MacroSort     String   Internal "macro sort" more information
$d_Name     String   Waypoint name
$d_NumberOfLogs  Numeric   Number of logs linked to this cache
$d_OwnerId     String   ID (usually a number) of the owner of this cache (not all source data contains this)
$d_OwnerName   String   Owner name (more information)
$d_PlacedBy   String   Name of cache placer/hider
$d_PlacedDate    Date   Date the cache was placed/hidden
$d_Resolution String Elevation resolution
$d_ShortDescription String   Cache Short description
$d_ShortHTM        Boolean  Short description contains HTML code
$d_SmartName       String   Waypoint smart name
$d_SmartOverride  Boolean  Smart name override flag
$d_Source      String  Source of data from GPX/LOC see columns
$d_State   String  State/Province name the cache is in
$d_Status   String  Cache Staus (see below)
$d_Symbol   String  Symbol name for this waypoint
$d_TempDisabled  Boolean   Deprecated - use $d_Status instead
$d_Terrain    Numeric  Terrain rating
$d_TravelBugs   String   Details of any travel bugs in this cache. See also $d_HasTravelBug
$d_Url       String   Waypoint URL
$d_UserData     String   User data
$d_User2     String   User data 2
$d_User3     String   User data 3
$d_User4     String   User data 4
$d_UserFlag   Boolean  User flag
$d_UserNote   String   User Note [1]. See also $d_HasUserNote
$d_UserNoteDate  Date   Date the last time the user note was updated
$d_UserSort   Numeric   User sort
$d_Watch    Boolean   Cache is being watched


[1] - The user note is comprised of two sections, the note section and the log section (see notes dialog) These two sections are seperated by the literal string "$~ ". If you wish to split the user notes into these two discreet sections then the macro code would go something like:
 
$NoteSection = Extract($d_UserNote,"$~",1) 
$LogSection = Extract($d_UserNote,"$~",2)
 

 
For a more complete explanation of some of these fields please this topic

$d_Status (Cache Status):

A = Available
T = Temporary disabled
X = Archived

$d_CacheType (Cache Types):

A = Project Ape
B = Letterbox
C = Cache In Trash Out
D = Groundspeak Lost and Found Celebration
E = Event
F = Lost and Found Event
G = BenchMark
H = Groundspeak HQ Cache
I = Wherigo
L = Locationless
M = Multi
O = Other
P = Groundspeak Block Party
R = Earth
T = Traditional
U = Unknown/Mystery
V = Virtual
W = Webcam
X = Maze Exhibit
Y = Waymark
Z = Mega event

Also see the CacheType() function 
 
Corrected
     
Variable Type Description
$d_kCode String  Parent waypoint code
$d_kBeforeLat String  Latitude before correction (from load of last GPX file)
$d_kBeforeLon String  Longitude before correction (from load of last GPX file)
$d_kBeforeState String State before correction (from load of last GPX file)
$d_kBeforeCounty String County before correction
$d_kAfterLat String Latitude after correction
$d_kAfterLon String Longitude after correction
$d_kAfterState String State after correction
$d_kAfterCounty String County after correction
$d_kType String Type to indicate how created.


 
kType - possible values, api - when a corrected coordinate is added/changed via the api. gui - when a corrected coordinate is added/change via the GSAK GUI. macro - when using the macro command "Addnew" .

Note: GSAK automatically keeps the fields $d_kBeforeLat and $d_kBeforeLon in sync with the caches table $d_LatOriginal and $d_LonOriginal. Consider these corresponding fields ans "synonymous" if you will. 


Logs
   
Variable Type Description
$d_lParent  String  Parent waypoint code
$d_lType  String  Log type
$d_lTextString  Full log text
$d_lBy  String  Logged by name
$d_lDate Date Date of log
$d_lTimeString Time of log (read only and can not be updated)
$d_lLogid  Numeric  Unique log id number
$d_lLat String  Latitude coordinate if given
$d_lLon  String  Longitude coordinate if given
$d_lEncoded Boolean  Text encoded status
$d_lOwnerid  Numeric  Owner ID of log creator
$d_lIsOwnerBoolean  User owns this log (as per matching settings)



Currently known values for $d_lType from Geocaching.com include:

Announcement
Archive
Attended
Didn't find it
Enable Listing
Found it
Needs Archived
Needs Maintenance
Owner Maintenance
Post Reviewer Note
Publish Listing
Retract Listing
Temporarily Disable Listing
Unarchive
Update Coordinates
Webcam Photo Taken
Will Attend
Write note

Waypoints
 
Variable Type Description
$d_cParent  String  Parent waypoint code
$d_cCode  String  Child waypoint code
$d_cPrefix String  Child prefix (same as first 2 characters of code)
$d_cName String  Child waypoint name
$d_cType String  Child waypoint type (see notes)
$d_cLat String  Child waypoint latitude (decimal degrees - string)
$d_cLon  String  Child waypoint longitude (decimal degrees - string)
$d_cUrl  String  Child waypoint URL
$d_cComment  String  Child comment
$d_cByUser  Boolean  Child waypoint created by user (not Geocaching.com)
$d_cDate  Date  CDate the child waypoint was created
$d_cFlag Boolean  Child user flag


Notes:

User created ($d_cByUser = True) child waypoints are effectively locked from updates by Geocaching.com additional waypoints that have the same code

$d_cPrefix is provided for version 6 compatibility and is read only because it is set via $d_cCode. That is, $d_cPrefix is always equal to the first 2 characters of $d_cCode

The current possible values for $d_cType are set by GroundSpeak and they include:

Final Location
Parking Area
Question to Answer
Stages of a Multicache
Trailhead
Reference Point

You can also add your own types (more information)

By setting the $d_cFlag in a macro you can control which child waypoints will be selected for export. Most export dialogs have the following option:



more information

Attributes (use view "attname" to also include $d_aName) 
 
Variable Type Description
$d_aCode  String  Cache waypoint code
$d_aId Numeric Attribute ID number
$d_aName String  Attribute name/description
$d_aInc Boolean 1=Include, 0 = exclude

 
 
Note: currently the attributes table is read only. It is provided here for consistency with other tables, but it is recommend that you use sqlite() in macros to read and interrogate attribute data.
Copyright 2004-2014 CWE Computer Services  
Privacy Policy Contact