Database variabelen

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

VariableTypeDescription
$d_ArchivedBooleanDeprecated – use $d_Status instead
$d_BearingStringBearing (NW, SW, etc) from current centre point
$d_CacheIDStringUnique cache ID
$d_CacheTypeStringA 1 character string representing the cache type (See below)
$d_CodeStringUnique Waypoint code
$d_ChangedDateDate data was actually changed in this waypoint
$d_ContainerStringContainer size
$d_CountyStringCounty
$d_CountryStringCountry
$d_CreatedDateDate the waypoint was created in the database
$d_DegreesNumericBearing in degrees from your current centre point
$d_DifficultyNumericDifficulty rating
$d_DistanceNumericDistance from current centre point
$d_DNFBooleanCache currently has the DNF flag
$d_DNFDateDateDate of most recent DNF
$d_ElevationNumericElevation (always in meters)
$d_FavPointsNumericGeocaching.com favorite points
$d_FoundBooleanFound Status
$d_FoundCountNumberFound Count (number of times you have found this cache)
$d_FoundByMeDateDateDate of your most recent find for a cache
$d_FTFBooleanFirst to find
$d_GcNoteStringGeocaching.com personal note
$d_GuidStringGeocaching.com cache GUID
$d_HasCorrectedBooleanWaypoint has corrected coordinates
$d_HasTravelBugBooleanCache has a travel bug
$d_HasUserNoteBooleanWaypoint has a user note
$d_HintsStringHints for this cache (decoded)
$d_IsPremiumBooleanGeocaching.com member only cache status
$d_LastFoundDateDateDate the cache was last found (by anybody)
$d_LastGPXDateDateDate this waypoint was last updated by loading a GPX file
$d_LastLogDateDate of the last log for this cache (any log)
$d_LastUserDateDateDate this waypoint was last updated manually by any user action
$d_LatOriginalStringOriginal Latitude (before change by corrected coordinates)
$d_LatitudeStringLatitude in decimal degrees format
$d_LockBooleanWaypoint is locked see columns
$d_LongDescriptionStringCache Long description
$d_LongHTMBooleanLong description contains HTML code
$d_LonOriginalStringOriginal Longitude (before change by corrected coordinates)
$d_LongitudeStringLongitude in decimal degrees format
$d_MacroFlagBooleanMacro only “UserFlag” see MacroFlag command
$d_MacroSortStringInternal “macro sort” more information
$d_NameStringWaypoint name
$d_NumberOfLogsNumericNumber of logs linked to this cache
$d_OwnerIdStringID (usually a number) of the owner of this cache (not all source data contains this)
$d_OwnerNameStringOwner name (more information)
$d_PlacedByStringName of cache placer/hider
$d_PlacedDateDateDate the cache was placed/hidden
$d_ResolutionStringElevation resolution
$d_ShortDescriptionStringCache Short description
$d_ShortHTMBooleanShort description contains HTML code
$d_SmartNameStringWaypoint smart name
$d_SmartOverrideBooleanSmart name override flag
$d_SourceStringSource of data from GPX/LOC see columns
$d_StateStringState/Province name the cache is in
$d_StatusStringCache Status (see below)
$d_SymbolStringSymbol name for this waypoint
$d_TempDisabledBooleanDeprecated – use $d_Status instead
$d_TerrainNumericTerrain rating
$d_TravelBugsStringDetails of any travel bugs in this cache. See also $d_HasTravelBug
$d_UrlStringWaypoint URL
$d_UserDataStringUser data
$d_User2StringUser data 2
$d_User3StringUser data 3
$d_User4StringUser data 4
$d_UserFlagBooleanUser flag
$d_UserNoteStringUser Note [1]. See also $d_HasUserNote
$d_UserNoteDateDateDate the last time the user note was updated
$d_UserSortNumericUser sort
$d_WatchBooleanCache 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 separated 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

Q = Lab cache

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 

VariableTypeDescription
$d_kCodeStringParent waypoint code
$d_kBeforeLatStringLatitude before correction (from load of last GPX file)
$d_kBeforeLonStringLongitude before correction (from load of last GPX file)
$d_kBeforeStateStringState before correction (from load of last GPX file)
$d_kBeforeCountyStringCounty before correction
$d_kAfterLatStringLatitude after correction
$d_kAfterLonStringLongitude after correction
$d_kAfterStateStringState after correction
$d_kAfterCountyStringCounty after correction
$d_kTypeStringType 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 

VariableTypeDescription
$d_lParentStringParent waypoint code
$d_lTypeStringLog type
$d_lTextStringFull log text
$d_lByStringLogged by name
$d_lDateDateDate of log
$d_lTimeStringTime of log (read only and can not be updated)
$d_lLogidNumericUnique log id number
$d_lLatStringLatitude coordinate if given
$d_lLonStringLongitude coordinate if given
$d_lEncodedBooleanText encoded status
$d_lOwneridNumericOwner ID of log creator
$d_lIsOwnerBooleanUser 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

VariableTypeDescription
$d_cParentStringParent waypoint code
$d_cCodeStringChild waypoint code
$d_cPrefixStringChild prefix (same as first 2 characters of code)
$d_cNameStringChild waypoint name
$d_cTypeStringChild waypoint type (see notes)
$d_cLatStringChild waypoint latitude (decimal degrees – string)
$d_cLonStringChild waypoint longitude (decimal degrees – string)
$d_cUrlStringChild waypoint URL
$d_cCommentStringChild comment
$d_cByUserBooleanChild waypoint created by user (not Geocaching.com)
$d_cDateDateCDate the child waypoint was created
$d_cFlagBooleanChild 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

Physical Stage

Virtual Stage

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) 

VariableTypeDescription
$d_aCodeStringCache waypoint code
$d_aIdNumericAttribute ID number
$d_aNameStringAttribute name/description
$d_aIncBoolean1=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.