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.

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_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_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_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 StringElevation 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. 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


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
E = Event
G = BenchMark
I = Wherigo
L = Locationless
M = Multi
O = Other
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 GPXf file)
$d_kBeforeLonString  Longitude before correction (from load of last GPX file)
$d_kBeforeState  String  State before correction (from load of last GPX file)
$d_kBeforeCounty Date County before correction
$d_kAfterLat  String  Latitude after correction
$d_kAfterLon String  Longitude after correction
$d_kAfterState  String  State after correction
$d_kAfterCounty Boolean  County after correction



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_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_aNameString  CAttribute name/description
$d_incBoolean 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 read and interrogare attribute data.



 



Copyright 2004-2011 CWE Computer Services  
Privacy Policy Contact