Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-09-2006, 03:07 PM   #1
leha
Member
leha began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Nov 2006
Device: prs-500
google maps to pdf converter

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.
Attached Files
File Type: pdf map4prs500.pdf (541.1 KB, 1509 views)
File Type: txt map2pdf.rb.txt (8.6 KB, 742 views)
leha is offline   Reply With Quote
Old 11-09-2006, 03:11 PM   #2
tcv
Addict
tcv will become famous soon enoughtcv will become famous soon enoughtcv will become famous soon enoughtcv will become famous soon enoughtcv will become famous soon enoughtcv will become famous soon enough
 
tcv's Avatar
 
Posts: 330
Karma: 596
Join Date: Oct 2006
It's pretty nice. Thanks for sharing. Of course, I have a thought.. feel free to ignore them since I'm not a programmer and can't help you in the slightest.

The resulting image is bitmapped a bit. Is there anyway to control that? Is the image scaled when it goes to PDF?
tcv is offline   Reply With Quote
Old 11-09-2006, 09:32 PM   #3
Nightwing
Addict
Nightwing will become famous soon enoughNightwing will become famous soon enoughNightwing will become famous soon enoughNightwing will become famous soon enoughNightwing will become famous soon enoughNightwing will become famous soon enough
 
Nightwing's Avatar
 
Posts: 303
Karma: 541
Join Date: Oct 2006
Device: Cowon A2 Dell x3i, Sony Reader & Eee PC!
Tried another trick the other day and was to print it as a PDF file.. Uses it to "save" the direction to a place.

Need toy try your trick.
Nightwing is offline   Reply With Quote
Old 11-12-2006, 10:09 PM   #4
leha
Member
leha began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Nov 2006
Device: prs-500
Quote:
Originally Posted by tcv
It's pretty nice. Thanks for sharing. Of course, I have a thought.. feel free to ignore them since I'm not a programmer and can't help you in the slightest.

The resulting image is bitmapped a bit. Is there anyway to control that? Is the image scaled when it goes to PDF?
The images are compressed to make pdf smaller (I am going to change this, need to figure out how to change pallet in imagemagick). It is fairly easy to add compression as an option.

Printing out maps is an option but the main problem is that reader's screen is small and you need some kind of navigation system to use big maps. Even the system that is used in my program is not convenient if map get bigger then 5x5 screens. The solution could be a tree like structure with different zoom on each level.
leha is offline   Reply With Quote
Old 12-25-2006, 09:09 AM   #5
Lisana
GadgetGirl
Lisana began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2006
Location: Southern California
Device: Sony Reader / eBookman (currently misplaced)
Neat idea! I just had to comment though, because I used to live on Alondra, over in Bellflower.
Lisana is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Jetbook works well on Google Maps Slash5 Ectaco jetBook 5 03-08-2010 10:39 PM
Amazon Kindle Has Secrets: Faux-GPS Google Maps, Minesweeper, and More cmumford Amazon Kindle 1 12-28-2007 06:24 PM
Mobile GMaps brings Google Maps to your phone Colin Dunstan Lounge 0 07-04-2005 06:01 AM
Google Maps with Satellite photos! doctorow Lounge 9 04-15-2005 11:01 PM


All times are GMT -4. The time now is 10:27 AM.


MobileRead.com is a privately owned, operated and funded community.