PDA

View Full Version : scripts to download maps...for linux?



juanjavier
March 30th, 2008, 20:46
I was wondering (maybe in7ane or Deniska could help)...

If this applies,



I have updated the scripts section with a new cygwin script, which gets the maps from MSN maps/ Virtual Earth engine (http://local.live.com)

usage:
./getVEmap.sh [latitude] [longitude] [base zoom] [map size]
example:
./getVEmap.sh 40.619442 -73.970926 1 16
latitude/longitude must be in decimal format
base zoom: 0-16
map size: number of 256x256 pix tiles in 1 row
map size: 16 will create an equivalent of 4096x4096 pixel map at base zoom

...would it then be possible just to run getVEmap.sh under real linux those scripts in order to download maps from MSN or Google?

Thanks for a quick reply. Regards.

fokia
March 31st, 2008, 14:02
cygwin is just an unix emulator for window$

Those scripts should work fine (or with minor changes) under native linux

I've only tried them under cygwin in an early stage before in7ane came along...

good luck!

juanjavier
March 31st, 2008, 23:03
Thanks for the fast reply, Fokia.

And...would it be possible to download maps from Google Maps using this script...or it is only valid for MSN Maps?

Sorry if it seems dumb...:):)

in7ane
March 31st, 2008, 23:29
The Google Maps url changed slightly from when the scripts were initially used - you will need to add the extra components and make sure to set a user agent for wget (or whatever the image is downloaded with, also the mt# varies randomly as does the length of Galileo, for example:

http://mt1.google.com/mt?n=404&v=w2.69&hl=en&x=9&y=12&zoom=12&s=Galileo

http://mt3.google.com/mt?n=404&v=w2.69&hl=en&x=9&y=13&zoom=12&s=G

mapURL.cs in GMDL is semi-comprehensible for other tile sources

deniska
April 1st, 2008, 06:06
You should be able to get google tiles by using
./getmap.sh from the attached archive:
./getmap.sh 40.64027 -73.98365 1 16
(use different lon/lat coordinates and zoom values)

I tested the script on Ubuntu Gutsy so it should work on other linux distros..
Apparently the google api version changed from 2.21 to 2.91 or higher

You may need to chmod the files to make them executable/writable (chmod 777 *)

juanjavier
April 1st, 2008, 09:38
You should be able to get google tiles by using
./getmap.sh from the attached archive:
./getmap.sh 40.64027 -73.98365 1 16
(use different lon/lat coordinates and zoom values)

I tested the script on Ubuntu Gutsy so it should work on other linux distros..
Apparently the google api version changed from 2.21 to 2.91 or higher

You may need to chmod the files to make them executable/writable (chmod 777 *)

---Deniska, worked perfectly straight ahead!! Thank you so much. I did chmod a+x and ran smoothly, the map was displayed in MapThis! flawlessly.

fokia
April 1st, 2008, 13:45
NICE!

I didn't remember that the API versions changed - now I remember that had to change it in the initial scripts.

Glad you could make it!

juanjavier
April 2nd, 2008, 14:37
Uuuups!!!

There's something I'm missing, I'm affraid.:confused:

Why can I get no full zoom with ./getmap.sh??

This (http://personales.ya.com/juanjavier_xxx/Lat_%2040.3251__Lon_%20-3.8650__0101_100448.png) is what I get with GMDL at full zoom (notice the slider position!).

And this (http://personales.ya.com/juanjavier_xxx/Lat_%2040.3250__Lon_%20-3.8648__0101_104836.png) is what I get with ./getmap.sh at full zoom (again check the slider!).

It seems it doesn't matter which parameters do I enter in ./getmap.sh, I am not able to download an image as close as I do with GMDL.

./getmap.sh one is at 1 128, being 1 base zoom and 128 size of map.

I don't think it is related to the size of the map value, since it will download more tiles, but not closer.

So...how to get around this?

Thank you everyone for a reply...

deniska
April 3rd, 2008, 06:02
your screen shot indeed shows zoom 1 of the google maps.... keep in mind that the original script and the docs were created prior to roll out 0 & negative zoom values by google due to acquisition of better aerial imagery...
Actually using 0 & -1 as zoom value seems to work ok for me with the latest version of the script... Let me know if you still encounter problems..

juanjavier
April 3rd, 2008, 21:47
your screen shot indeed shows zoom 1 of the google maps.... keep in mind that the original script and the docs were created prior to roll out 0 & negative zoom values by google due to acquisition of better aerial imagery...

---Mmmmh....I had no idea about that..:confused:

Seems interesting.


Actually using 0 & -1 as zoom value seems to work ok for me with the latest version of the script... Let me know if you still encounter problems..

----Works wonderfully with zoom=0. And regarding the script version...where and how can check if it is the latest one? And how can I be noticed when a new version is out?

Thank you so much for the help, Deniska!!

deniska
April 5th, 2008, 05:58
----Works wonderfully with zoom=0. And regarding the script version...where and how can check if it is the latest one? And how can I be noticed when a new version is out?

Thank you so much for the help, Deniska!!


You can download and use IE Inspector/http analyzer (google it)...
Put it in record, then navigate your browser to google maps and look at captured URLs - the API version will be in there..