leha
11-09-2006, 02:07 PM
Hi
I wrote a small program that grabs google map and puts it into a pdf (pdf is optimized for a sony reader). Basically the program downloads a map from from google cuts it into pieces and creates a new page for each piece. To ease navigation each page has links to all neighbors. In addition, there is a TOC like page that shows the whole map and has links to all pieces.
Usage:
ruby map2pdf.rb "http://mt1.google.com/mt?n=404&v=w2.29&x=11237&y=26208&zoom=1" 2 2
the scary looking link should be replaced by another link to google map image (linux: right-click on a google map->view image->copy link from address bar; windows-firefox: right-click to the left of the map->view page info-> media tab-> find google map images -> copy link; windows-ie6,7: install firefox)
the resulting map will be centered around the image you provided in other words the link is a starting point, zoom level will be preserved and one pixel on the image will be one pixel on reader screen.
two numbers determine how big the resulting map will be , in this case it will be 2x2 sony reader screens.
The main problem is that the program is written in ruby ;) not the most popular language for this kind of things. To make it work you also need RMagick and PDF::Writer gems. Some links for ruby stuff
RMagick: http://rmagick.rubyforge.org/install-faq.html#win
PDF::Writer: http://ruby-pdf.rubyforge.org/pdf-writer/
(rmagick is in ubuntu repository so I guess most other distribs should have a native way to install it)
To install gems in win go to where you have downloaded a gem and type:
gem install --local gem-name-without-version-number
There are 2 attachments: an example of pdf and the program itself (remove .txt from the end)
I bet that this program violates "terms of use" for google maps so dont use it if you are afraid of an FBI raid. There are a few ways to improve interface that I am going implement in the near future and post new version here if there will be interest in this hack.
I wrote a small program that grabs google map and puts it into a pdf (pdf is optimized for a sony reader). Basically the program downloads a map from from google cuts it into pieces and creates a new page for each piece. To ease navigation each page has links to all neighbors. In addition, there is a TOC like page that shows the whole map and has links to all pieces.
Usage:
ruby map2pdf.rb "http://mt1.google.com/mt?n=404&v=w2.29&x=11237&y=26208&zoom=1" 2 2
the scary looking link should be replaced by another link to google map image (linux: right-click on a google map->view image->copy link from address bar; windows-firefox: right-click to the left of the map->view page info-> media tab-> find google map images -> copy link; windows-ie6,7: install firefox)
the resulting map will be centered around the image you provided in other words the link is a starting point, zoom level will be preserved and one pixel on the image will be one pixel on reader screen.
two numbers determine how big the resulting map will be , in this case it will be 2x2 sony reader screens.
The main problem is that the program is written in ruby ;) not the most popular language for this kind of things. To make it work you also need RMagick and PDF::Writer gems. Some links for ruby stuff
RMagick: http://rmagick.rubyforge.org/install-faq.html#win
PDF::Writer: http://ruby-pdf.rubyforge.org/pdf-writer/
(rmagick is in ubuntu repository so I guess most other distribs should have a native way to install it)
To install gems in win go to where you have downloaded a gem and type:
gem install --local gem-name-without-version-number
There are 2 attachments: an example of pdf and the program itself (remove .txt from the end)
I bet that this program violates "terms of use" for google maps so dont use it if you are afraid of an FBI raid. There are a few ways to improve interface that I am going implement in the near future and post new version here if there will be interest in this hack.