Jump to content

Generating PQs


Recommended Posts

If, like me, you have every UK cache loaded into GSAK, and use a complicated set of date ranges to do this, you may be interested in a new macro that Clyde has written...

 

See here for the macro.

 

Basically, it looks at your GSAK database and reports on a series of date ranges, by placed date, keeping each to as close to 500 as possible, but always less. You can then use these suggested date ranges to define the PQs on GC.com...

 

Just thought I'd mention this in case some folks hadn't seen the GSAK forums!

 

dave

Link to comment

Nice! Now if we could just teach our American cousins how to write the date in correct order we'd be on to a winner!! Or get the macro to print "June" instead of "6" to avoid any confusion?! :)

 

From what I've read I can edit the macro to adjust the sensitivity? My concern is that I have run the macro on my main database which has had all archiveds removed. When I run the new macro dates they are much closer to 500 than those predicted. All so far have been under 500 but I can't be bothered to check them as I go so I guess I'll see if I get the dreaded red 500 at any point.

 

I guess the differences are caused by temporarily archived caches?

Link to comment

Nice! Now if we could just teach our American cousins how to write the date in correct order we'd be on to a winner!! Or get the macro to print "June" instead of "6" to avoid any confusion?! :)

 

From what I've read I can edit the macro to adjust the sensitivity? My concern is that I have run the macro on my main database which has had all archiveds removed. When I run the new macro dates they are much closer to 500 than those predicted. All so far have been under 500 but I can't be bothered to check them as I go so I guess I'll see if I get the dreaded red 500 at any point.

 

I guess the differences are caused by temporarily archived caches?

 

haven't tinkered with it yet, but I can say there is no such thing as a temp archived! an archived cache is gone for good (with a few rare exceptions). Temp disabled on the other hand should be in your PWs anyway, although there is an option to not include them. If you don;t include them, then this may explain the differences...

 

having typed all this, i've just realised that this would mean the actual PQ would have less than the predicted PQ, unless you move the temp disabled caches out of your GSAK database, which might explain it...

 

all of which is far too confusing and making my brain ache! Basically, this might run into problems if your offline GSAK database is missing caches, be they temp disabled, your own caches, or maybe your founds... they all need to be in the GSAK database to get an accurate prediction.

 

Any help?

 

Dave

Link to comment

Nice! Now if we could just teach our American cousins how to write the date in correct order we'd be on to a winner!! Or get the macro to print "June" instead of "6" to avoid any confusion?! :D

 

<snip>

Actually Clyde is one of our Australian "cousins" and he is the GSAK developer :) . He wrote the macro in question. I've adjusted it a bit to get the months shown as you asked. try the following block amendment to the original code - it should be fairly obvious where it goes.

 

  # if too many caches, use the previous date
 If $count > $MaxCaches
$ThisPQ = $ThisPQ + 1
$ThisPQStr = Right("00000" + NumToStr($ThisPQ), 2)

######################################################
# The following between the # lines are used to put the month into the html output #
######################################################
$FromDMY=(DateToString($From))
$FromYYYY=Left($FromDMY,4) 
$FromMM=Extract("Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",",",Val(Substr($FromDMY,5,2)))
$FromDD=Right($FromDMY,2)
$FromDate=$FromDD+" "+$FromMM+" "+$FromYYYY
$ToDMY=(DateToString($gdate))
$ToYYYY=Left($ToDMY,4) 
$ToMM=Extract("Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",",",Val(Substr($ToDMY,5,2)))
$ToDD=Right($ToDMY,2)
$ToDate=$ToDD+" "+$ToMM+" "+$ToYYYY
#######################################################
# The following line has been amended to use the $FromDate & $ToDate variables.  #
#######################################################
$out = $out + "<tr class=row><td>" + $ThisPQStr + "</td><td>" + $FromDate + "</td><td>" + $Todate + "</td><td> $gtotal</td>" + "<td>$tick</td></tr>" +  $_NewLine

$from = $gdate + 1
$count = $count - $gtotal
 EndIf

 Goto position=Next
EndWhile
######################################################
# The following between the # lines are used to put the month into the html output #
# for the last entry												#				 ######################################################

$FromDMY=(DateToString($From))
$FromYYYY=Left($FromDMY,4) 
$FromMM=Extract("Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",",",Val(Substr($FromDMY,5,2)))
$FromDD=Right($FromDMY,2)
$FromDate=$FromDD+" "+$FromMM+" "+$FromYYYY
######################################################

# generate last from and to if total recs not a multiple of $maxCaches

If $count > 0
$ThisPQ = $ThisPQ + 1
$ThisPQStr = Right("00000" + NumToStr($ThisPQ), 2)

####################################################
# The following line has been amended to use the $FromDate variable.		#
####################################################

$out = $out + "<tr class=row><td>" + $ThisPQStr + "</td><td>" + $FromDate + "</td><td>Maximum date</td><td>$count</td>" + "<td>$tick</td></tr>" +  $_NewLine
EndIf

 

I've no doubt that are many other ways to achieve the same end which are likely to be more efficient but I'm no code monkey I'm afraid and as best I can tell "it works" :D

Edited by Hi-Tek
Link to comment

Nice! Now if we could just teach our American cousins how to write the date in correct order we'd be on to a winner!! Or get the macro to print "June" instead of "6" to avoid any confusion?! :)

 

The date format in applications, is usually governed by your PC locale settings, you have to set them all to United Kingdom for your PC to be fully UK compliant, there are 5 places in the Regional and Language Options, to set a PC to UK, and one in the Date and Time settings.

 

Anyway, go through these settings, and you will see that it was your PC up the spout, not the script.

Link to comment

Nice! Now if we could just teach our American cousins how to write the date in correct order we'd be on to a winner!! Or get the macro to print "June" instead of "6" to avoid any confusion?! :D

 

The date format in applications, is usually governed by your PC locale settings, you have to set them all to United Kingdom for your PC to be fully UK compliant, there are 5 places in the Regional and Language Options, to set a PC to UK, and one in the Date and Time settings.

 

Anyway, go through these settings, and you will see that it was your PC up the spout, not the script.

My understanding of the 3rd poster was that he didn't want 15/12/2000 and would prefer to see 15 December 2000 instead :) . The macro as supplied gives the former not the latter. I don't think it has anything to do with his PC settings :D

 

Edited to corredct the "poster" referred to ....

Edited by Hi-Tek
Link to comment

My understanding of the 3rd poster was that he didn't want 15/12/2000 and would prefer to see 15 December 2000 instead :) . The macro as supplied gives the former not the latter. I don't think it has anything to do with his PC settings :D

 

Edited to corredct the "poster" referred to ....

Hi-Tek, you may well be correct in your assumption, but the original source was somewhat vague about what displayed date was at fault, I assumed the GSAK output.
Link to comment

The macro as supplied gives the former not the latter. I don't think it has anything to do with his PC settings

It does. The macro as supplied used the GSAK function DateFormat(). From the GSAK help:

 

DateFormat(dDate ) : string

This function will convert a date variable to a string variable suitable for display (in the PAUSE command for example) The format will be the same as you see for your date columns in the grid and is dependant on your current computer date settings.

Link to comment

Just to clarify on my post... My dates from the PQ Macro came out 03/05/2006 meaning 3rd May 06. Ideally I'd like them to come out 3 May 06, but it's not a big deal, but thanks to Hi-Tek for his amendment that will allow me to do that, even if changing my own PC settings may also have the same effect (I'll play with both!).

 

The only minor issue I was having (and it was very minor)! was that I mentally had to reverse everything when editing the PQ on the website as the date format there is May 03 2006, hence my reference to our American cousins who presumably set up the way the dates work in the PQs on the website.

 

It's really no big deal, just confusing to a bear of little brain when you see an ambiguous date like 05/06/06 and have to remember which is the day and which is the date.

 

Thanks for everyone's input on that.

 

Re PP's comments on archiving, I've traditionally moved any temp or permanently archived caches inbto a separate directory so that I don't run the risk of going after a cache that is not currently live. I guess I should only move permanently archived ones to ensure this macro runs correctly, number-wise? Shouldn't be a problem, just don't move the temp disableds out for a week before running the PQ Macro!

Link to comment

The macro as supplied gives the former not the latter. I don't think it has anything to do with his PC settings

... and is dependant on your current computer date settings.

Yes. This refers to changing the date format to dd/mm/yyyy that we tend to use here in the UK. This is set up in the "Regional" options in Windows and ensures that GSAK shows dates in the dd/mm/yyyy format.
Link to comment

The macro as supplied gives the former not the latter. I don't think it has anything to do with his PC settings

... and is dependant on your current computer date settings.

Yes. This refers to changing the date format to dd/mm/yyyy that we tend to use here in the UK. This is set up in the "Regional" options in Windows and ensures that GSAK shows dates in the dd/mm/yyyy format.

Ummm.. I know that :)

 

However, I, and clearly others judging by this thread, don't necessarily want all dates to be presented in the same way, which is what GSAK's function will enforce.

 

Which is why I was grateful for, and thanked you for, your code to make the macro do what I want.

 

I was simply correcting your erroneous statement that the date format didn't have anything to do with PC settings, as you've now acknowledged that it does.

 

Anyway, on to more interesting matters...

Link to comment

Now, to return to Alboy's point.

 

I've just run the macro and adjusted the PQ dates to suit. And there are some curious differences in the number of caches returned by the PQ compared with what GSAK thinks there should be. The differences are slight - only a few either side - but I'm puzzled.

 

The PQ returning a few less than GSAK thinks it should is easily explained. I only rotate around the placed dates in a week, so caches archived in the last week won't be in the PQ but will still be unarchived in GSAK. No worries there - things will sort themselves out over time.

 

Harder to explain is where the PQ returns more caches than GSAK thinks it should. Caches being un-archived are a possibility, but there seem to be too many (and the caches too old) for that to be the case.

 

I'm doing some analysis to see what's happening. In the meantime, anyone any ideas?

Link to comment

 

Re PP's comments on archiving, I've traditionally moved any temp or permanently archived caches inbto a separate directory so that I don't run the risk of going after a cache that is not currently live. I guess I should only move permanently archived ones to ensure this macro runs correctly, number-wise? Shouldn't be a problem, just don't move the temp disableds out for a week before running the PQ Macro!

 

Thats one way, by all means. I leave my temp disabled caches in the main db, but exlude them from ALL my exports to cachemate, Doris (the SatNav) and the GPSr, so I never know about them when I'm in the field. I do export them to MM, partly cos I don't use it in the field, but mainly cos disabled caches show as a big red icon using the wonderful Roolku script, so they're rather obvious! Just a thought!

 

Dave

Link to comment

Now, to return to Alboy's point.

 

I've just run the macro and adjusted the PQ dates to suit. And there are some curious differences in the number of caches returned by the PQ compared with what GSAK thinks there should be. The differences are slight - only a few either side - but I'm puzzled.

 

The PQ returning a few less than GSAK thinks it should is easily explained. I only rotate around the placed dates in a week, so caches archived in the last week won't be in the PQ but will still be unarchived in GSAK. No worries there - things will sort themselves out over time.

 

Harder to explain is where the PQ returns more caches than GSAK thinks it should. Caches being un-archived are a possibility, but there seem to be too many (and the caches too old) for that to be the case.

 

I'm doing some analysis to see what's happening. In the meantime, anyone any ideas?

 

I assume your GSAK database is 'complete'?? ie includes your founds/temp disabled/anything else I can't think of...

 

If so, then I'm not sure why that would be either...! :)

Link to comment

I'm doing some analysis to see what's happening. In the meantime, anyone any ideas?

After sampling and comparing a couple of PQs and the corresponding placed date ranges in GSAK, I believe I have the answer. It's those Irish cachers again :)

 

Some months back we had a discussion about why some caches in Northern Ireland were, so far as the country at geocaching.com is concerned, in the United Kingdom and some were in Ireland. As I recall, the reason was that that was what the cache owner chose and, given what were described at the time as "tribal loyalties", no-one was inclined to argue one way or the other.

 

So, in order to ensure that my GSAK database was more correct (in my eyes) I changed my PQs to get caches in Ireland as well as the UK. For completeness I then got IOM and CI. Then I wrote a GSAK macro to fix the country correctly according to the coordinates.

 

Today I decided that, as it was unlikely that I was ever going to visit Ireland (either of them), IOM or CI I was wasting PQs by getting the data. So I deleted those caches from GSAK.

 

And the missing caches I've sampled are ones which are physically in NI but recorded as being in UK. So that solves that mystery. All I need to do is just allow the PQs to recreate the missing caches and all should be well.

 

I just wish the Irish cachers could agree on which country they're in. :)

Link to comment

Just to clarify on my post... My dates from the PQ Macro came out 03/05/2006 meaning 3rd May 06. Ideally I'd like them to come out 3 May 06, but it's not a big deal, but thanks to Hi-Tek for his amendment that will allow me to do that, even if changing my own PC settings may also have the same effect (I'll play with both!).

 

<snip>

 

That is what I thought you meant and I don't think changing your PC settings will have the same effect. :)

 

If it is of help to you the following code change will output the table in mmm dd yyyy similar to the PQ set up page ...

 
##########################################################
# The following lines between the # lines are used to put the month into the html output # #########################################################
$FromDMY=(DateToString($From))
$FromYYYY=Left($FromDMY,4) 
$FromMM=Extract("Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",",",Val(Substr($FromDMY,5,2)))
$FromDD=Right($FromDMY,2)
$FromDate=$FromMM+" "+$FromDD+" "+$FromYYYY
$ToDMY=(DateToString($gdate))
$ToYYYY=Left($ToDMY,4) 
$ToMM=Extract("Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",",",Val(Substr($ToDMY,5,2)))
$ToDD=Right($ToDMY,2)
$ToDate=$ToMM+" "+$ToDD+" "+$ToYYYY
###########################################################
# The following line has been amended to use the $FromDate & $ToDate variables.		  #
##########################################################
$out = $out + "<tr class=row><td>" + $ThisPQStr + "</td><td>" + $FromDate + "</td><td>" + $Todate + "</td><td> $gtotal</td>" + "<td>$tick</td></tr>" +  $_NewLine

$from = $gdate + 1
$count = $count - $gtotal
 EndIf

 Goto position=Next
EndWhile
##########################################################
# The following lines between the # lines are used to put the month into the html output  #
# for the last entry																									#
#########################################################

$FromDMY=(DateToString($From))
$FromYYYY=Left($FromDMY,4) 
$FromMM=Extract("Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",",",Val(Substr($FromDMY,5,2)))
$FromDD=Right($FromDMY,2)
$FromDate=$FromMM+" "+$FromDD+" "+$FromYYYY
##########################################################

 

HTH :)

Link to comment

I don't think changing your PC settings will have the same effect. :)

It will. Try it and see! Change your regional date setting to dd-mmm-yyyy and run a version of the macro without your modifications. You'll get exactly the same result as with your changes.

 

But I prefer your method... :unsure:

Hi Alan, now I'm confused :D As it happens that is how my Windoze 2000 date settings are set. I've run the original macro and get (1st line only shown for clarity) ...

 

1 15/12/2000 04/08/2002 490

 

My understanding is that Alboy wanted this line to read ...

 

1 15 Dec 2000 04 Aug 2002 490

 

hence my initial posted macro amendments.

 

Anyway, I did say that there may be other ways to get this end result and thanks for preferring my method (so do I) :)

Link to comment

I like most in this thread I guess download ALL caches in the UK (because I CAN!) :unsure:

 

However I don't fancy the idea of ticking and unticking 30 PQs every 30 days as per other threads currently running. 60 refreshes just takes too long! :laughing:

 

So, can this macro be tweaked to cover just caches within a certain area? I guess I could run a filter of my preferred area then run the macro? Would that work?

 

I need a rectangular area for my likely caching territory so I guess I need to get to grips with the Arc/Poly functions of the filter?

Link to comment

I like most in this thread I guess download ALL caches in the UK (because I CAN!) :laughing:

 

However I don't fancy the idea of ticking and unticking 30 PQs every 30 days as per other threads currently running. 60 refreshes just takes too long! :unsure:

 

So, can this macro be tweaked to cover just caches within a certain area? I guess I could run a filter of my preferred area then run the macro? Would that work?

 

I need a rectangular area for my likely caching territory so I guess I need to get to grips with the Arc/Poly functions of the filter?

 

as you say, it should work on whatever filter you apply before it - i haven't checked th coding behind it myself! why rectangular? can't you use a circle (ie within 50 miles of home, or whatever..?) if it needs to be rectangular then yep, you'll need the poly filter! I think you can drfine it in MM though, and then import - someone else shoud be able to confirm that!

 

HTH

 

Dave

Link to comment

Just coz my caching is likely to be Kent, Surrey, Sussex, Hampshire and a rare London cache if it suits work. A Radius from here to encompass all that will include a lot of caches I'm very unlikely to do in the near future, well north of London.

I'll work on the poly filter!

Link to comment

OK Database Junkies..... here is a wee question for you.....

 

How many download all of France as well as UK? .... ok how about Holland ?. Belgium ??? Germany???

 

perhaps Luxembourg???? even Switzerland????? .....Spain?????? Ireland ?

 

what ? ...next to no one!!!!!!!

 

Guess the point I'm trying to make is that most of these are closer to the "Home Counties" than the North of Scotland ..... so why the fixation with downloading all of the UK? :laughing:

 

The ingenious solutions of analysis by date or whatever aren't really addressing the problem..... isn't the real solution to lobby for recognition of England; Wales; Ireland;and Scotland as separate countries with counties....( there is a thread already running on the main forum about this )

 

Alternatively a short term fix might be to ask( beg) for 1000 waypoints per PQ.

 

Just a thought ..... I'll get back to my flytying.... :unsure:

 

Edited for spelging

Edited by Flyfishermanbob
Link to comment

Guess the point I'm trying to make is that most of these are closer to the "Home Counties" than the North of Scotland ..... so why the fixation with downloading all of the UK? :huh:

 

That's true, without a doubt, FFB but while I do venture up to those Pictish Lands north of Hadrian's Wall two or three times a year, I very rarely travel across the channel to Gaul.

I was in Austria a couple of weeks ago and will be again in a months time. For those trips I'll run a 'one off' PQ as and when required.

Link to comment

OK Database Junkies..... here is a wee question for you.....

 

How many download all of France as well as UK? .... ok how about Holland ?. Belgium ??? Germany???

 

perhaps Luxembourg???? even Switzerland????? .....Spain?????? Ireland ?

 

what ? ...next to no one!!!!!!!

 

I suppose one reason for this may be the 'ease' of being able to cache in other countries if one is based on the continent. For example, a French cacher may be ble to get to Switzerland, Italy, Germany, Belgium or wherever, just as easily as he can somewhere in France. Although the distance from London to Paris may be less than to Scotland, I'm certainly more likely to cache in Scotland!

 

I agree though that if the England, Wales and Scotland were split on GC.com, I may only get England and Wales, and Scotland when I need it... But thats a whole different issue! As it stands, I can't... And since I can't get caches in blocks such as 0-50 mile radius, 51-100, 101-150 and so on, the only way is to get the whole lot...

 

yes I know I could get all within say 250 miles by combining radius with a date range, but I don't want to! As has been said, I CAN get all of the UK, therefore I like to have all of the UK - and if someone can tell me how else I can use MM to plan a caching holiday in a cache-dense area of the UK, then please do - AFAIK the only way is to start of with all the caches in GSAK...

 

phew!

 

back to work...

 

Dave

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