Offline Maps: added ripping functionality and released it as version 1.0.0.1

I finally got to where I wanted to bring this application: you are now able to provide a path and rip all the tiles from google maps along this path.

The GUI is still somewhat primitive but it does give you the possibility to:

  1. Navigate to a certain point by providing a name
  2. Set the type of tile you want to view
  3. Zoom in and out of this point
  4. Drag the map to reveal neighbouring tiles
  5. Set a ripping radius
  6. Set a ripping zoom level
  7. Set the tile-type you want to download
  8. Provide a path along which to download alll the tiles

Following is a small manual on how to use the application.

Functional areas

Functional areas

The applications user interface has four main areas:

  1. The viewing area into which the tiles are displayed.
  2. The area into which the properties for viewing tiles retrieved from google maps are set: the Google Server area
  3. The area into which the properties for viewing tiles retrieved from a local folder are set: the File Server area
  4. The area with controls for setting the properties for ripping tiles from the Google server to a local folder: the Google Ripping area

Viewing tiles from Google Maps: the Google Server area

Google server area

For viewing tiles served by Google maps you must provide following data

  1. First, select the type of tile in the zoomfactor of those tiles.
  2. Second, type in a location in the “location” textbox and hit the “Get” button
  3. If multiple locations correspond with the text you gave, the combobox is filled with those locations and youn can select one of them.

If everything went right, you should see the tiles served by Google Maps in the viewing area. Depending of the type of tile selected, these will be Map or Satelite tiles. You have to be a bit patient is the user interface locks up because the retrieving of the tiles is dne in the user interface thread.

Next you can hold the left button mouse down on the viewing area and drag the mouse to pan the tiles.

Downloading tiles from Google Maps to your computer: the Google Ripping area
This is actually why I started this project: to be able to enter a path along which the tiles from Google Maps are downloaded.

Ripping area

For entering the path you do the following:

  1. Select a radius for the path. The path will have a width of twice this radius.
  2. Press the “Start Recording” button.
  3. Double click inside the viewing area on the points that you would like on the path.
  4. Press the “Stop Recording” button.

You will see a visual cue in the form of a transparent red line covering the area that will be ripped.
Ripping path

Now that you have entered the path, you can specify the parameters to use for ripping the tiles on the path:

  1. Enter the zoom factor of the tiles
  2. Enter the type of tiles you want to download.
  3. Enter the folder into which to download the tiles.

You can now press the “Start ripping” button and the downloading of the tiles will start. As a visual cue you will see transparent green squares appear for each tile that was downloaded. If a tile for some reason could not be downloaded a red square will appear.
Ripping active

Viewing downloaded files: the File Server area

File server

For viewing files downloaded to your computer you must provide following data:

  1. The name of the folder where the tiles are saved.

Once you provided the name of the folder, the application will get the first tile in this folder and retrieve neighbouring tiles to fill the complete viewing area.

You can again hold the left button mouse down on the viewing area and drag the mouse to pan the tiles.

Hope you enjoy the application.

What’s next?
Next on my list of whiches is (in no particular order):

  • A GPS layer giving you the ability to navigate using the downloaded tiles.
  • A more beautiful GUI.
  • An AJAX-ified user interface (allthough it may become Silverlight too).

Downloads

Update
The code in this post is no longer available. You can find the latest release of the code and binaries on this page dedicated to the offline maps application.

The code
The binaries

Links
[1] Bilinear interpolation
[2] Writing XML Documents
[3] XmlWriter.WriteBase64 Method
[4] Bitmap to a bytearray
[5] Building Your Own Enumerator To Use With The foreach Construct
[6] Calculate distance, bearing and more between two Latitude/Longitude points
[7] How do you convert a string into an enum?

Updates
19 november 2007: Original article
23 december 2007: New version of the application. Removed version originally refernced in thia post.

Advertisements

4 thoughts on “Offline Maps: added ripping functionality and released it as version 1.0.0.1

  1. Thank you very much for making this available!! A great piece of work.

    I am an OpenStreetMap contributor and have been able to do two things that might interest you and I would be very happy to email you the modified source:

    – get the local file server and display portion running on a PDA

    – download / store / display OpenStreetMap map tiles instead of Google ones

    I note that you are interested in adding a GPS layer. I have already written that and my next step is to add an offline Google and OpenStreetMap map layer … which is what you have done. If you would be interested in cooperating, please let me know.

    Mike

  2. And a question. If I have a have lat/lon I can create a WorldCoordinate instance. How do I then translate that to a pixel X/Y for drawing on the PictureBox?

    (I’m studying all the classes but understanding is only coming slowly)

    Mike

  3. Well, I’ve answered my own question and got a crude GPS layer runnning – I can overlay previously created logs by cloning and editing the RipperLayer class.

    Next step is to integrate with my live GPS feed. I’ve got a problem on the PDA that it runs out of memory if a lot of tile panning occurs. I”m guessing that is because the display image just gets bigger and bigger.

    The other thing I’m trying to work out is how to do a dynamic zoom.

    Mike

  4. Hi Michael,

    Thanks for the positive feedback.

    I’d be very happy to see how you integrated the openstreetmap tiles into the application. I just had a look at the website and it looks like a great project.

    I recently bought myself an UMPC (Gigabyte U60, I still have to write a review about it on my blog) and I started this project to be able to take the google tiles with me. Because my UMPC has a full Windows XP installed I didn’t really have a need for a PDA viewing application.

    Currently, I’m working on the GPS functionality. It would indeed be interesting to compare your code with what I did.

    About running out of memory when panning a lot: I have a caching solution incorporated which is very inefficient and which I have to update: now i put all the tiles viewed in an array but have no criteria for removing them. So the array only gets bigger. If you have any idea on criteria for removing tiles again I’d be very interested to hear them. I’ve been thinking about following criteria:
    – location: you’re more likely to want to see tiles close to each other
    – number of times viewed: if you’re panning an area, you will view tiles multiple times.
    – last time viewed: tiles not recently viewed can be removed from the cache
    – a combination of the above

    You can reach me at my e-mail adress available on the “About” page of my blog.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s