View Full Version : LocatU (Google Maps and Geocoder script)
asteronimo
2007-05-19, 19:58
As you may know, LocatU (http://xbmc.org/forum/showthread.php?t=26192) is the Google Maps interface for the XBOX.
v1.1 was released a few weeks ago and I am happy to announce that v1.2
is now ready to be released.
v.1.2 has satellite maps added.
You can download it with XBMCScripts in a couple of days.
Have fun with it!
Nuka1195
2007-05-19, 23:55
Nice script,
a suggestion, if your going to use getButtonCode(), then add the codes for a remote and keyboard also.
eg MOVEMENT_UP = ( 166, 270, 61478, )
asteronimo
2007-05-20, 08:47
Thnx, I wasn't aware they were different.
I will implement them in the next release (v1.3).
asteronimo
2007-05-20, 10:04
After 14 hours Google detected the script retrieving satellite images from their servers and banned it.
Clever bastards!
Streetmaps still work though.
If anybody out there knows how to make Google believe their satellite images are accessed by a regular browser, please let me know.
Gamester17
2007-05-20, 14:40
Very cool script! ...though I have a few issues with it;
1. It is designed primarly for using the gamepad as interface, most people I know (including myself) primarly use the Microsoft DVD-Remote Kit (ei. an ir-controller). It isn't clear how exacly to use this script using a infrared remote controller, so it would be nice if instructions was included for that on the screen and/if using the script a infrared remote controller was more intuative/selfunderstod. (rememeber that many people also have replaced the Microsoft DVD-Remote with an programmable Universial Remote Controller, one that the share with their TV, VCR, etc.).
2. I doesn't seem to detect which resolution or view-mode I run my Xbox skin in and thus do not scale properly on my screen. I am using a 720p display (ei. 1280x720 pixel resolution), but I would assume that those with 1080i displays have similar issues. The script need to account for if you are running in 'normal' 4:3 aspect-ratio, or if you are running in 'widescreen' 16:9 aspect-ratio, and if you are using a standard-definition NTSC TV/skin (720x480 pixel resolution), or a standard-definition PAL TV/skin (720x576 pixel resolution) and scale itself accordingly. Thic might help: http://xbmc.org/forum/showthread.php?t=13202
3. Preferably (if possible) when the script detect you use a 720p or 1080i display then it not upscale low-resolution images it downloads from google but instead should grab higher-resolution images instead (that match 720p or 1080i as close as possible so it do not have to scale as much). That way those with 720p and 1080i display will enjoy better resolution maps.
TIP: If you do not have a 720p and/or 1080i display to test and develop your script on then you should use XBMC_PC.exe on your Windows computer which is designed for this purpose, see: http://xbmc.org/forum/showthread.php?t=23235
If anybody out there knows how to make Google believe their satellite images are accessed by a regular browser, please let me know.Which interface are you using to download the images and information from googlemaps?, are you using google's open API or are you scraping the HTTP webpages? if you are scraping the HTTP webpages then you might be bombaring their server and that is the reason they have blocked it. I remember when we first implementing SHOUTcast in XBMC, we used to scrape their website for playlists via HTTP and that was too much for their servers so they blocked us, so we contaced them and they created an API to their database search so we did not have to scrape their website, making our listing faster and their servers did no longer get bombared as all XBMC scraped their website, a win win deal.
Fortunatly Goolgle Maps alreasy have a similar API, see this topic-thread for links to information about it:
http://xbmc.org/forum/showthread.php?t=13195
It could of course be some other reason, I think I recall XBMC scripts have been banned/blocked before because they did not emulate a normal webbrower (like Internet Explorer or Mozilla Firefox). It could maybe also be that you don't use cookies or something?
asteronimo
2007-05-20, 21:44
Regarding your issues (you're absolutely right of course):
1) if someone can tell me where to find the button codes for the remote controller I will add them to the script.
2) I will try and see how XBMC_PC.exe can help me figuring out the resolution dependancy.
3) There are no hires google map images. All maps are composed by a matrix of 256x256 pixel tiles. Usually 9 x 9 tiles. So it is just a matter of showing more tiles but that won't change the resolution.
Regarding the interface:
For my websites (www.emotionalfootprints.com and www.mobbah.com) I use the Google Maps API. Because in websites you can use the AJAX API. For the Geocoder I just do a REST call, no problem there.
My back-end server runs a PHP-script that composes a 480x400 pixel map for LocaTU by calculating the tile images I need and then retrieve them one by one from the Google servers. There is no other way, because there is no full-fletched browser with javascript and AJAX on XBOX. It works though.
But this evening I found a way to prevent my script from being blocked. I will test it further and upload it in a couple of days.
I could contact Google and ask them for a nice python API, but I don't think they will be very cooperative. How did you handle that?
Gamester17
2007-05-21, 00:51
1) if someone can tell me where to find the button codes for the remote controller I will add them to the script.
http://www.xboxmediacenter.com/wiki/index.php?title=Keymap.xml
http://www.xboxmediacenter.com/wiki/index.php?title=HOW-TO:_ALEX%27s_Python_Tutorial#pad_button
http://www.xboxmediacenter.com/wiki/index.php?title=Xbox_DVD-Remote
http://www.xboxmediacenter.com/wiki/index.php?title=Action_IDs
http://www.xboxmediacenter.com/wiki/index.php?title=InfoLabels
http://www.xboxmediacenter.com/wiki/index.php?title=List_of_Built_In_Functions
I could contact Google and ask them for a nice python API, but I don't think they will be very cooperative. How did you handle that?Yeah, I do not think you can ask them for a python interface, that is too specific. But maybe they would be willing to extend their existing API so it does not require AJAX or JavaScript. Like a CGI or PHP based search engine with normal XML results. Similar to how we interface to freedb.org for CDDB information, weather.com for weather forcast, and SHOUTcast for SHOUTcast stations. Try asking in their discussion groups and forums.
Alternativly use a python library that can handle or parse AJAX and/or JavaScript for your script:
http://pyjamas.pyworks.org
http://pylonshq.com
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440637
http://ajaxpatterns.org/Python_Ajax_Frameworks
http://sourceforge.net/projects/pyjtf/
http://wwwsearch.sourceforge.net/python-spidermonkey/
http://wwwsearch.sourceforge.net/DOMForm/
asteronimo
2007-05-21, 17:48
Thanks for the pointers.
With XBMC_PC.exe I tested all resolutions.
I also added a custom background.png and implemented gamepad, keyboard and remote button codes.
v1.4 has it all.
Will upload it tomorrow.
asteronimo
2007-05-22, 08:32
For the impatient, you can download LocatU v.1.4 here:
http://www.certeza.nl/XBMC/GoogleMaps/files/LocatU_v14.zip
Or wait for XBMCScripts to release it.
Gamester17
2007-05-25, 09:51
Great!, ...by the way, wave you thought about including this module?: cachedhttp (link) (http://www.xbmcscripts.com/index.php?option=com_docman&task=doc_download&gid=89&Itemid=36)This is a convenience script that makes it easier to write download code for XBMC.
Features:
Timeouts (antifreeze), Cache, CookieSupport, UserAgent, Can evaluate relative urls, Cancel-able progress bar (optional). basic authentication support.
26.05.2005: new in v1.3: fixed critical cleancache bug...More convenience modules are available here:
http://www.xbmcscripts.com/index.php?option=com_docman&task=cat_view&gid=29&Itemid=36
PS! I wonder what happened to flash and his/her beta GoogleMaps script(?):
http://xbmc.org/forum/showthread.php?t=13543
http://xbmc.org/forum/showthread.php?t=12418
:eek:
asteronimo
2007-05-25, 16:54
Sorry, but the cachedhttp and convenience link don't work.
First I cached all map images on my server but it soon took too much storage so I had to disable caching again.
I am now working a Shopfinder app that helps you locate nearby shops.
Gamester17
2007-05-25, 17:29
the cachedhttp and convenience link don't workhttp://www.xbmcscripts.com site which host them seems to be having problems at the moment (anyway when the site is up again, the convenience modules including cachedhttp can be downloaded from there under the scripts section)
asteronimo
2007-06-24, 21:48
If you are using Locatu v1.4 please download an updated version of default.py here:
http://www.certeza.nl/XBMC/GoogleMaps/files/default.py
Google changed its code which caused a crash in Locatu if you
tried to find a new address.
Thanks Bob, for bringing this to my attention.
Bye,
Asteronimo
Gamester17
2007-08-04, 18:01
Hi asteronimo, hope you are still working on this script (still needs some work on the DVD remote interface department), the zip on xbmcscripts.com also need to be repackaged as right now it unzips to "/LocatU/LocatU/default.py" when it should unzip to "/LocatU/default.py".
PS! Have you read about the progress in the IPTC/Exif meta data tags area, ge great if the GPS data could be used by the LocatU script http://sourceforge.net/tracker/index.php?func=detail&aid=1679924&group_id=87054&atid=581840
TheBoxMan
2007-08-17, 15:01
Good work!
TheBoxMan
2007-08-17, 17:03
Yeh if it could recieve GPS data it would be pretty cool.
It would pave the way for some Pocket PC/Smartphone/Other GPS enabled phone supporting Java etc. script for sending current position to XBMC over the net.
Meaning you could switch it on and see where the kids were, or where the thief that stupidly stole your PDA phone lives
Gamester17
2007-08-18, 13:04
Yeh if it could recieve GPS data it would be pretty cool.
It would pave the way for some Pocket PC/Smartphone/Other GPS enabled phone supporting Java etc. script for sending current position to XBMC over the net.
Meaning you could switch it on and see where the kids were, or where the thief that stupidly stole your PDA phone lives@TheBoxMan, you have totally missunderstod the GPS function I was refering to; I was not refering to a way to recieve data from a live GPS reciever, I only meant that this script could read GPS the metadata (http://en.wikipedia.org/wiki/Metadata) "tag (http://en.wikipedia.org/wiki/Tags)" from an existing digital-picture file (you see a JPG image-file can have "tags (http://en.wikipedia.org/wiki/Tags)" similar to how MP3 music-files have ID3 "tags (http://en.wikipedia.org/wiki/Tags)" about artist/song/album/genre/year, only a digital-picture usually have "tags (http://en.wikipedia.org/wiki/Tags)" about time/date/rotation-angle and today they can also get a tag about location where exacly the picture was taken which the camera gets at the shot time via a GPS reciever). Read this:
http://en.wikipedia.org/wiki/Tags
http://en.wikipedia.org/wiki/Exif
TheBoxMan
2007-08-18, 14:39
Thanks for the references Gamester - however it seems clear enough after reading your post.
I'll admit it I jumped to the last page of discussion skimmed what was going on - saw the words 'GPS data' and immediately jumped to conclusions! Probably wouldn't have happened if I'd read the whole discussion ;)
Having said that if we can get the script to read GPS metadata on the images it wouldn't it open the way to something like I suggested above?
Was testing the script yesterday. I'm finding it hangs on 'address' lookup. I'm not sure whether this is because google is not responding and there is no timeout for the proceedure or if the problem is actually something else.
TheBoxMan
2007-08-18, 14:40
oh should also have mentioned that it was in version 1.4 that I was experiencing this crash! So perhaps the bug is not yet fixed....
ShortySco
2007-08-18, 18:47
Yeah, both GPS ideas, would be really nice...
Dunno how recieving gps data could be made to work, but with this it would make it an amazing script for those with xbmc in-car systems.
Shorty
TheBoxMan
2007-08-19, 15:40
Digging around it looks like the software needed to track people with bluetooth GPS and phones capable of GPRS/EDGE/3G is already out there.
(Especially good if like me you already have web 'n' walk data package which can stay connected all the time and is unlimited ;) ).
Here are a few java programs that do it:
http://www.unteh.com/products/mobitrack/MobiTrack.pdf (paid but free java demos)
and here is an open source program that does similar to allow us to take it apart and see how it works:
http://www.wsrcc.com/wolfgang/gps/dgps-ip.html
Hope those help :0
TheBoxMan
2007-08-19, 15:42
I should say I only posted up one java link ;) I really need to be able to edit my posts...when I upload them I often find there are things I've really not made clear.
realjobe
2007-09-01, 15:22
Hi there.
Excelent Script hence Google Maps are always great to have!
I have one suggestion though: as it seems that the controlls are ment for GamePad, can there be also Remote Controlld (IR) version for controlls?
ps. Are there "Home Adress" in settings etc? > the first map to load.
:)
melat0nin
2007-12-21, 13:52
The script doesn't work for me -- the interface comes up, but no map displays in the map area, and I can't search for a new location. The script also won't exit properly (I have no turn the Xbox off and on again).
Any ideas? :rofl: