[RELEASE] LocatU - Google Maps and Geocoder / Geolocation Script

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
asteronimo Offline
Junior Member
Posts: 14
Joined: May 2007
Reputation: 0
Post: #16
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.
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Thumbs Up   
Post: #17
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://forum.xbmc.org/showthread.php?tid=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://forum.xbmc.org/showthread.php?tid=23235

asteronimo Wrote: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://forum.xbmc.org/showthread.php?tid=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?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
asteronimo Offline
Junior Member
Posts: 14
Joined: May 2007
Reputation: 0
Post: #18
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 (http://www.emotionalfootprints.com and http://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?
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Lightbulb   
Post: #19
asteronimo Wrote: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/inde...Keymap.xml
http://www.xboxmediacenter.com/wiki/inde...pad_button
http://www.xboxmediacenter.com/wiki/inde...DVD-Remote
http://www.xboxmediacenter.com/wiki/inde...Action_IDs
http://www.xboxmediacenter.com/wiki/inde...InfoLabels
http://www.xboxmediacenter.com/wiki/inde..._Functions

asteronimo Wrote: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/Cookboo...ipe/440637
http://ajaxpatterns.org/Python_Ajax_Frameworks
http://sourceforge.net/projects/pyjtf/
http://wwwsearch.sourceforge.net/python-spidermonkey/
http://wwwsearch.sourceforge.net/DOMForm/

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
asteronimo Offline
Junior Member
Posts: 14
Joined: May 2007
Reputation: 0
Post: #20
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.
find quote
asteronimo Offline
Junior Member
Posts: 14
Joined: May 2007
Reputation: 0
Post: #21
For the impatient, you can download LocatU v.1.4 here:

http://www.certeza.nl/XBMC/GoogleMaps/fi...tU_v14.zip

Or wait for XBMCScripts to release it.
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Lightbulb   
Post: #22
Great!, ...by the way, wave you thought about including this module?: cachedhttp (link)
Quote: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?opt...&Itemid=36

PS! I wonder what happened to flash and his/her beta GoogleMaps script(?):
http://forum.xbmc.org/showthread.php?tid=13543
http://forum.xbmc.org/showthread.php?tid=12418

Eek

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
asteronimo Offline
Junior Member
Posts: 14
Joined: May 2007
Reputation: 0
Post: #23
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.
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Post: #24
asteronimo Wrote:the cachedhttp and convenience link don't work
http://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)

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
asteronimo Offline
Junior Member
Posts: 14
Joined: May 2007
Reputation: 0
Post: #25
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
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Post: #26
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...tid=581840

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
TheBoxMan Offline
Fan
Posts: 346
Joined: Jan 2007
Reputation: 0
Rainbow   
Post: #27
Good work!
find quote
TheBoxMan Offline
Fan
Posts: 346
Joined: Jan 2007
Reputation: 0
Rainbow   
Post: #28
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
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Post: #29
TheBoxMan Wrote: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 "tag" from an existing digital-picture file (you see a JPG image-file can have "tags" similar to how MP3 music-files have ID3 "tags" about artist/song/album/genre/year, only a digital-picture usually have "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

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
TheBoxMan Offline
Fan
Posts: 346
Joined: Jan 2007
Reputation: 0
Rainbow   
Post: #30
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 Wink

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