maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [M5] [Announce] Advanced Geocaching Tool (https://talk.maemo.org/showthread.php?t=48036)

rob_kouw 2012-02-16 21:12

Re: [Announce] Advanced Geocaching Tool
 
How about the following? (Don't know how to add the new cache record in core.py and the indents disappear...)

hildon_plugins.py, around line 830 add:


button = hildon.Button(gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_VERTICAL)
button.set_label("Download Cache by GC-code")
button.connect("clicked", self._show_tool_download_by_name, None)
button.connect("clicked", lambda caller: dialog.hide())
list.pack_start(button)



hildon_plugins.py, button above could be accompanied by:

def _show_tool_download_by_name(self, caller, data = None):
dialog = gtk.Dialog("Dowload Cache by GC-code", self.window, gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
search = hildon.Entry(gtk.HILDON_SIZE_AUTO)
search.set_text('GC')
dialog.vbox.pack_start(search)
dialog.show_all()
result = dialog.run()
dialog.hide()
name_search = search.get_text().strip().upper()
if result != gtk.RESPONSE_ACCEPT or name_search == '':
return
if left(name_search,2) != 'GC' or len(name_search) < 6 or len(name_search) > 7:
self.show_error("GC-code should be entered like GC1234 or GC12345.")
return
current_cache = self.core.get_geocache_by_name(name_search)
if current_cache.name != name_search:
# Search returned no geocaches. Add a new cache record to the db. Should be performed by core.py, can't figure that one out.
current_cache = newcache
self.core.on_download_cache(self.current_cache)

pedro42 2012-03-05 21:40

Re: [Announce] Advanced Geocaching Tool
 
Quote:

Originally Posted by rob_kouw (Post 1165978)
How about the following? (Don't know how to add the new cache record in core.py and the indents disappear...)

Hi,

i'm not programmer, but i have some idea, how to download caches. There is posibility to display caches around given coordinates, for example:

http://www.geocaching.com/seek/neare...submit8=Search

It is called from http://www.geocaching.com/seek/default.aspx

Is it usefull for ? (for programmers) ?

Petr

bullrin 2012-03-06 17:10

Re: [Announce] Advanced Geocaching Tool
 
Can someone check if the latest cachedownloader.py works?

https://github.com/webhamster/advanc...dvancedcaching

for me it doesn't work, agtl doenst start anymore.

rob_kouw 2012-03-06 22:44

Re: [Announce] Advanced Geocaching Tool
 
To pedro42: This is more or less what AGTL does. Then it reads the HTML page and puts the found geocaches into the database. But as the HTML coding changed, AGTL needs to be changed as well. My contribution was meant as a temporary work-around, but I could not finish it.
To bullrin: I cannot get changes in cachedownloader.py to work in AGTL. Only when downloaded as an update from within AGTL. I think this newest version from github was never officially released. You may check earlier discussions on page 28 of this thread.

MartinK 2012-03-06 23:07

Re: [Announce] Advanced Geocaching Tool
 
The version on github is probably the new one for Harmattan with Qt Components based interface - there might have been some changes incompatible with the old Hildon interface in the meantime.

Might be easier use the new Qt Components based UI. With CSSU there should be all dependencies available. I'm actually integrating parts of AGTL into modRana (namely the PinchMap so far) and they run just fine & fast on the N900. :) Only issues are some missing icons due to the incomplete "base" theme for Qt Components on Fremantle.

bullrin 2012-03-07 11:23

Re: [Announce] Advanced Geocaching Tool
 
so as far as i can see, there is no quick workaround or solution to download new geocaches at the moment?

webhamster 2012-03-11 12:57

Re: [Announce] Advanced Geocaching Tool
 
Hi!

Sorry for letting you wait here. I haven't managed to really test the updated version and package it, as I still don't have an N900 again. I'm currently searching for one:
http://talk.maemo.org/showthread.php...13#post1177813

Regards
Daniel

bullrin 2012-03-11 13:47

Re: [Announce] Advanced Geocaching Tool
 
oh no! what a pity.

but can't you use Nokia QT SDK with the Emulator?
Otherwise you can ask us to test your code and give feedback.

webhamster 2012-03-11 13:54

Re: [Announce] Advanced Geocaching Tool
 
I found the Nokia QT SDK with the Emulator quite hard to use with the python and GPS stuff. Remote testing is very tedious, I tried it already with some people.

rob_kouw 2012-03-25 20:00

Re: [Announce] Advanced Geocaching Tool
 
webhamster just pushed some new code to github. Thanks, webhamster, can't wait to try it!

peterleinchen 2012-03-26 20:10

Re: [Announce] Advanced Geocaching Tool
 
1 Attachment(s)
Hey webhamster,

just tried your latest git code. Thanks.
And got some errors at first run. You fin the output attached as txt file.
Is this helpful for you to do so? Or may we be more helpful any other way?

@rob_kouw
also a big thanks to you for being so generous and trusting

@webhmaster
started second time and its very slow, some caches are not shown anymore (some are), sometimes the map is not updated/displayed anymore. Starting the old version again returns to old state (so at least database alterations seems to be not harmful for old version). Or did you create a new version? Where? But I do not think so. Downloading overview and details seems to work, but I do not see them updated on map (see above).
Is this the right place to give feedback?

Cheers

webhamster 2012-03-27 08:40

Re: [Announce] Advanced Geocaching Tool
 
Quote:

Originally Posted by peterleinchen (Post 1184392)
Hey webhamster,

just tried your latest git code. Thanks.
And got some errors at first run. You fin the output attached as txt file.
Is this helpful for you to do so? Or may we be more helpful any other way?

@rob_kouw
also a big thanks to you for being so generous and trusting

@webhmaster
started second time and its very slow, some caches are not shown anymore (some are), sometimes the map is not updated/displayed anymore. Starting the old version again returns to old state (so at least database alterations seems to be not harmful for old version). Or did you create a new version? Where? But I do not think so. Downloading overview and details seems to work, but I do not see them updated on map (see above).
Is this the right place to give feedback?

Cheers

There seem to be some problems with the database. You could try to rename your .agtl/caches.db to something else.

I've also created a bug report on github, which is the best way to report bugs (it's easy to miss or forget about bugs posted on the forum): https://github.com/webhamster/advancedcaching/issues

Please note that the new downloader will be considerably slower than the old one (and there's no way around that), but it'll download the complete cache descriptions (except for the logs and images) now.

webhamster 2012-03-27 13:53

Re: [Announce] Advanced Geocaching Tool
 
And if anybody wants to join, I'll be at this geocaching event: http://coord.info/GC3BJ3A

peterleinchen 2012-03-27 20:55

Re: [Announce] Advanced Geocaching Tool
 
1 Attachment(s)
Quote:

Originally Posted by webhamster (Post 1184666)
And if anybody wants to join, I'll be at this geocaching event: http://coord.info/GC3BJ3A

Would love to meet and "pay you a beer" personally, not only via donation. But seems too far and does not fit in my time schedule ;)

About database you seem to be right. A removal and fresh start looks better.
But now all my caches/notes/history are gone. Have to investigate and find a solution somehow ...

Nevertheless I had a crash:
downloaded some overview (about 8 caches), then downloaded detail for one cache and switched tabs from logs to description or vice versa and suddenly UI hanged and short time later UI disappeared. Process python was still running.
Next time I will use the github for reporting :)

webhamster 2012-03-31 17:48

Re: [Announce] Advanced Geocaching Tool
 
A new AGTL version for the N900 and for the N9 is available at http://www.danielfett.de/privat,blog...aching-n9-n900 and in extras-testing. Please test it and report any bugs!

caco3 2012-04-04 15:28

Re: [Announce] Advanced Geocaching Tool
 
Looks very great, thank you very much!

peterleinchen 2012-04-05 19:40

Re: [Announce] Advanced Geocaching Tool
 
Quote:

Originally Posted by webhamster (Post 1184552)
There seem to be some problems with the database. You could try to rename your .agtl/caches.db to something else.

Yep, of course you were right.
But I did not want to loose my caches history, so I investigated a bit and a bit more of time. And Heureka.

This behaviour of not refreshing the screen and not showing the caches only appeared on a specific part of the map. For the rest of the map everything was fine and smooth. So I moved/zoomed the map around until I could guess, which was the bad guy(s).
Somehow I downloaded a few new caches (do not ask me how, maybe mixing with git version and the temporary cache.db column structuring). And exactly those few caches, which I found, marked and field noted, caused the problem. Deleted them via SQL from DB and voila. Now I can use it again.

Happy caching.

rob_kouw 2012-04-06 05:02

Re: [Announce] Advanced Geocaching Tool
 
Dear peterleinchen,

SQL! I love working with SQL on a database. What is the way to go? Copied it to a pc? On the N900 itself? Which SQL program?

(I only I knew before how to... I could have added new caches by hand, and just download the details one by one. And I could have deleted those archived caches.)

Thanks, Rob

(Edit: I found SQLite Database Browser for Mac, managed to delete irritating caches, but even after compacting AGTL will not finish any download. I think there is something wrong with the format. Reading seems to be fine though. But anyhow I reinstalled the old database.)

peterleinchen 2012-04-07 22:32

Re: [Announce] Advanced Geocaching Tool
 
Quote:

Originally Posted by rob_kouw (Post 1188684)
Dear peterleinchen,

SQL! I love working with SQL on a database. What is the way to go? Copied it to a pc? On the N900 itself? Which SQL program?

, but even after compacting AGTL will not finish any download. I think there is something wrong with the format. Reading seems to be fine though. But anyhow I reinstalled the old database.)

Hey rob,

simply grab sqlite3 package
apt-get install sqlite3
and you can go with the N900 only (as I almost always do: takes a bit more time, but more fun ...): sqlite3 /home/user/.agtl/caches.db

About your other problems, I dunno know, but my problems derived from (just guessing here, needs to check/compare old and new caches.db, but this time on PC :)) database table structure changes.
Did you use the git version and the 0.8.0.7 version at the same time or close to each other? Using the git or newly released version changes your table structure. And using the old program may screw, as it may use a fixed "hardcoded" table structure. And webhamster changed table structure from old version to one of the git versions and again to the latest layout.
But again, just guessing here. For me it worked.

I had made a backup of DB and played with that, until everything was fine.
I would copy back your latest DB (using 0.8.0.5/7) and just start new version (agtl will convert just fine). If the problem was not already in the backup, you should at least go without errors from that status.
I'm afraid, I can't help you more.

Kegetys 2012-04-12 15:49

Re: [Announce] Advanced Geocaching Tool
 
New AGTL seems to be working nicely, thanks!

I still needed to add in the power optimizations though (peterleinchen's method for the screen off detection works nice) to get the background cpu usage down to good levels.

I also wanted to have JPEG satellite image maps support, but only PNG images are currently supported. It turned out it was quite easy to add jpeg support, I did the following to _load_tile in gtkmap.py:

Code:

    @staticmethod
    def _load_tile(filename):
        try:
          surface = cairo.ImageSurface.create_from_png(filename)
        except MemoryError:
          # Try JPEG. Load jpeg image, add alpha channel (32 bits), create imagesurface
          pixbuf24 = gtk.gdk.pixbuf_new_from_file(filename)
          pixbuf = pixbuf24.add_alpha(False, chr(0), chr(0), chr(0))
          pix_data = pixbuf.get_pixels_array()
          surface = cairo.ImageSurface.create_for_data(pix_data, cairo.FORMAT_RGB24, pixbuf.get_width(), pixbuf.get_height(), pixbuf.get_rowstride())
        if surface.get_width() != surface.get_height():
            raise Exception("Image too small, probably corrupted file")
        return surface

Would be more ideal to detect the image format somehow instead of using the exception, but this works ok. The maps source I am using even has ".png" in the url, but when zooming in close enough it turns into a jpeg satellite image. (it is quite nice though :))

pterozaurus 2012-04-19 15:12

Re: [Announce] Advanced Geocaching Tool
 
Hello geocachers,
I have a N900 and have the problem that I could not update or install agtl0.9.0.0
The installation crashes with: package libxslt not available, and the installation of phyton-lxml crashes with " python-lxml not compatibel"
Any idea how to solve the problem?

Tx
pterozaurus

peterleinchen 2012-04-19 21:38

Re: [Announce] Advanced Geocaching Tool
 
Please check your catalog settings.
You need all extras catalogs (even devel for version 0.9.0.0)
AND also Nokia Apps (]https://downloads.maemo.nokia.com/fremantle/ssu/apps/), as libxslt (libxslt1.1) is available only from that repo.

Or give us some more infos (e.g. log of installation errors, of course only appropriate parts)

pterozaurus 2012-04-20 08:47

Re: [Announce] Advanced Geocaching Tool
 
Adding the Nokia Apps repository solved the problem and agtl is now updated.

Thank you

pterozaurus

webhamster 2012-05-06 14:02

Re: [Announce] Advanced Geocaching Tool
 
AGTL needs a new icon, and I need your opinion to select it among four proposals:

Please Vote here!

http://danielfett.de/files/agtl-vorschlag-2.png
http://danielfett.de/files/agtl-vorschlag-3.png
http://danielfett.de/files/agtl-vorschlag-4.png
http://danielfett.de/files/agtl-vorschlag-1.png

peterleinchen 2012-05-06 20:01

Re: [Announce] Advanced Geocaching Tool
 
Personally I like he first one, but third one is more related to geocaching.com (web site this program is supporting) and it keeps a bit of history (the arrow).

tadzik 2012-05-08 06:41

Re: [Announce] Advanced Geocaching Tool
 
The second or the third seem to be the best choices imho.

SirSocke 2012-05-08 06:53

Re: [Announce] Advanced Geocaching Tool
 
I think the third ist the best Icon, because it unifies the old Icon, the geocaching-logo and harmattan-style.

immi.shk 2012-05-08 07:28

Re: [Announce] Advanced Geocaching Tool
 
http://danielfett.de/files/agtl-vorschlag-2.png

this one is Unique.. :)
try some variations(toon compass or toon car from front view) in the middle & use it..

Louke 2012-05-24 07:07

Re: [Announce] Advanced Geocaching Tool
 
http://danielfett.de/files/agtl-vorschlag-4.png or http://danielfett.de/files/agtl-vorschlag-2.png

Would it be possible to get Wherigo support? :)

rob_kouw 2012-07-14 08:39

Re: [Announce] Advanced Geocaching Tool
 
Since yesterday agtl for n900 shows QR codes for new map tiles. Previously downloaded map tiles are still fine.
http://tinyurl.com/osmtile1
It seems we need new map urls. QR code leads to:

OpenStreetMap Devs,

After the 30th June 2012 a number of non-standard
tile.openstreetmap.org URLs will no longer function.

The only valid URL format is:
http://tile.openstreetmap.org/{z}/{x}/{y}.png

Valid host aliases are: a.tile.openstreetmap.org,
b.tile.openstreetmap.org, c.tile.openstreetmap.org, tile.osm.org,
a.tile.osm.org, b.tile.osm.org and c.tile.osm.org

Common non-standard URLs:
http://tile.openstreetmap.org//{z}/{x}/{y}.png
http://tile.openstreetmap.org/mapnik/{z}/{x}/{y}.png
http://tile.openstreetmap.org/mapnik_tiles/{z}/{x}/{y}.png
...and many more
All non-standard tile URLs will return 404 Not Found from the 30th June onwards.

The vast majority of websites and apps are using the valid URL format,
however you may wish to check that you are using the correct URL to
access tiles.

Please be aware that tile.openstreetmap.org has a usage policy:
http://wiki.openstreetmap.org/wiki/Tile_usage_policy
Mass scraping of tiles for offline usage or similar is NOT permitted
on this tile server.

Technical: The invalid URLs are poisoning our caches. Storage
re-writing is impractical due to the request rate. (>1000 tiles per
second)

Sincerely
Grant
Part of OpenStreetMap sysadmin team.

rob_kouw 2012-07-14 10:46

Re: [Announce] Advanced Geocaching Tool
 
I don't get it. It should work. Found core.py, line 144:

'map_providers': [
('OpenStreetMaps', {'remote_url': "http://a.tile.openstreetmap.org/%(zoom)d/%(x)d/%(y)d.png", 'prefix': 'OpenStreetMap I', 'max_zoom': 18}),
('OpenCycleMaps', {'remote_url': 'http://a.tile.opencyclemap.org/cycle/%(zoom)d/%(x)d/%(y)d.png', 'prefix': 'OpenCycleMap', 'max_zoom': 18}),
],

peterleinchen 2012-07-14 18:38

Re: [Announce] Advanced Geocaching Tool
 
Did not have time for caching and no need to download new tiles in the last weeks...

Maybe something wrong with the user agent?

rob_kouw 2012-07-18 18:53

Re: [Announce] Advanced Geocaching Tool
 
webhamster published AGTL 9.0.2 in extras-devel. A lot of problems have been solved. I am afraid OpenStreetMaps not yet, as I still get QR codes as map tiles.

Apparently webhamster has gone on a well-deserved holiday. On Twitter he asked to spread the word.

N900 version: http://maemo.org/packages/view/advancedcaching/
N9 Meego version: http://t.co/j7D3ODwv

webhamster 2012-07-23 13:40

Re: [Announce] Advanced Geocaching Tool
 
Thanks rob, I'm back from holidays and I already updated AGTL again. Please see my homepage for more details.

Louke 2012-07-24 12:04

Re: [Announce] Advanced Geocaching Tool
 
I update 9.0.3 in extras and i still get QR codes as map tiles.

webhamster 2012-07-24 12:29

Re: [Announce] Advanced Geocaching Tool
 
Quote:

Originally Posted by Louke (Post 1242178)
I update 9.0.3 in extras and i still get QR codes as map tiles.

Please delete or rename your settings file (.agtl/config, for example to .agtl/config.old). You will then have to enter your account details again.

Alternatively you can send me this exact file so that I can update AGTL to filter out the broken URLs. But remember to remove your password from the config file before sending it!

My e-mail address ist advancedcaching [@] fragcom [.] de

zlerba 2012-07-24 16:10

Re: [Announce] Advanced Geocaching Tool
 
Quote:

Originally Posted by webhamster (Post 1242192)
Please delete or rename your settings file (.agtl/config, for example to .agtl/config.old). You will then have to enter your account details again.

How I do this? Simple guide please :)

webhamster 2012-07-24 16:13

Re: [Announce] Advanced Geocaching Tool
 
Quote:

Originally Posted by zlerba (Post 1242275)
How I do this? Simple guide please :)

Ok, very simple guide:
  1. Mentally prepare to lose your AGTL settings. Downloaded geocaches and maps will not be affected.
  2. Close AGTL if it is running.
  3. Open the terminal.
  4. Enter "mv .agtl/config .agtl/config.old" and press return.
  5. Done.

peterleinchen 2012-07-24 22:30

Re: [Announce] Advanced Geocaching Tool
 
Yippie!

It works again. Now I found also, that the download URl is hidden in config. OK! :)

Thanks again and all the best to you.

P.S.: one issue I have. I have since v0.9 (source from advancedcaching to agtl-maemo) no icon anymore on my N900.
I checked and it looks like a MeeGo location link came into Maemo tree.
Code:

lrwxrwxrwx    1 root    root            27 Jul 24 09:27 /usr/share/icons/hicolor/64x64/apps/agtl-maemo.png -> /res/advancedcaching-64.png

rob_kouw 2012-07-25 06:07

Re: [Announce] Advanced Geocaching Tool
 
Yeah, it works beautifully. Together with the improvements from the github version, wonderful.

Now tell us webhamster, does the community donate enough? In any case I am curious how big the AGTL community is.


All times are GMT. The time now is 20:52.

vBulletin® Version 3.8.8