mbtiles and Geo Bucket

23 07 2013

(The tutorial is down under the blah, blah, blah….)

While I have a Garmin Oregon 450 that I do a lot of my caching with, because several of us use it I don’t carry it everywhere.  So I use my iPhone.  But I don’t have a data plan (story not worth going into).

I bought and use Geo Bucket because it is a great application, and supports offline maps.  Something that is crucial when you don’t have data on your device.  Some other applications support caching of maps, and it is in development with at least on other – as far as I have been able to determine this is the only one that currently supports offline maps.    (edit:  I had forgotten that Looking4Cache also supports offline maps in the pro version – but I did not like the workflow when I tried the free version.  These mbtiles maps should also work for L4C.  I have also heard L4C is now using vector map data as well in Pro.)

It also has a good interface and workflow that is easy to use and understand, and the newest update brings some well thought out and useful features that make it even better.

There are two tools mentioned by the author to create mbtiles map files that can be used with Geo Bucket.

  • Tile Mill is powerful and complex and more than I care to wrap my head around for what I need.
  • MOBAC is easy to use, but I have had some serious issues with downloading map tiles and many have been substituted with an image that notes the software has been banned due to overdownloading.  Once cached I have not found an easy way to remove these tiles.  So a map that has taken many hours to download is missing sections, and the cache is basically useless.

While reading about the MOBAC issue in a forum, I happened to stumle upon mention of another piece of software – MaperativeMaperative will allow you to contact the server and download the data for the defined map area, and then use that data to generate your  raster (png, bmp, etc) tiles or an mbtiles file.  It also allows you to define rules that can effect the look of the map.

The process is reasonably easy if you are using the default look of the map data, and quick.  My experience has been that downloading the data and generating the map is much, much faster for the same area than MOBAC, and with no bad tiles and less bandwith useage.


Here is my process:

  1. Setup
    1. Download Maperative – It is Windows based, but will run on Linux and Mac using the latest Mono.  (These instructions are being done from a Windows installation.)
    2. Unzip the file.  The Maperitive folder is treated as the root – all files and tiles will be generated inside this folder.
    3. Start the software by launching Maperitive.exe.
  2. Choosing your area:
    1. The initial view is a mountain range in slovation at a 1:9 368 scale.  The easiest way to find the area you want to map is to hold down the – key until you see a map of the globe.  You can then right click on the area you want to work on and choose ‘center map here’.
    2. Hold the + key down to zoom in.  Left click and drag to move the map.
    3. Once you have the area you wish to make the map of filling the screen, right click on the map and choose ‘Place Geometry Bounds Here’.  This will create a red box that defines the map boundaries.  Change the size using the yellow squares at the corner, or grabbing the edge and dragging to resize.  Map boundaries can also be set manually using the command line ‘set-geo-bounds’ command.  An example would be  set-geo-bounds 15.42,46.44,15.62,46.55
  3. Setting up your map
    1.  Choose your map.  Maperitive uses OSM Mapnik by default.  You can choose an alternate map by clicking Tools / Add Web Map.  If you add an alternative map, highlight the one you are not using in the ‘Map Sources’ area (bottom right corner) and click on the red X to delete the unused layer.Different maps have slightly different looks – you can add several maps to see what they look like.  Clicking on the star beside the layer will enable/disable viewing the layer.  Highlight and delete layers you do not wish to use once you make your choice.
    2. Import the map data.  Up to now you have been using map tiles/image files.  To generate your own tiles, we will download the map data and do some customization. The easiest method is to select Map / Download OSM Data (Overpass API).  This will download the OSM data required (nodes/ways).
    3. This will create a new layer, but the data is not saved by default.  To save the data use the command save-source in the commander area (ie:  save-source file=mapfilename.osm).  This will save the file in the root directory by default.  To reload the data use the command load-source (ie:  load-source file=mapfilename.osm)
    4. Remove the web map layer from the Map Sources area.
  4. Customization:
    1. Hill Shading (Tools/Generate Hill Shading) – several types of hill shading can be applied to indicate slope/height.  I prefer ‘Slopes’.  ‘Igor’ is subtle, and I find ‘standard’ fairly heavy.  This will add an additional layer to the Map Sources area.  (Hill shading contacts NASA’s SRTM server and download all the appropriate DEM tiles for the area to generate the hillshade mapsource.)
    2. Hypsometric Tinting (Tools/Generate Hypsometric Tinting) – I find this additional layer makes it easier to see the roads and paths.
    3. Relief Contours (Tools/Generate Relief Contours) – This will add a layer that shows relief contours which may be helpful depending on where your map area is.
    4. There are several rules supplied with the program to change the look.
      1. If you are generating a hiking map, you may wish to switch to the hiking ruleset – Map\Switch to Rules\4 hiking.  This ruleset downplays the roads, and highlights pathways.
      2. If you prefer a Google style look to your map, you can choose the Google rule – Map\Switch to Rules\3 googlemaps
      3. If you decide you do not like the look, you can try using the default rules, but it may not return to the exact look of the original downloaded data.  To do this you will need to delete the map layer, and reload your OSM data.
    5. Map layers can be enabled/disabled by clicking on the star next to the layer in the Map Sources list.  Once you get the look you prefer we can generate the mbtiles file.
  5. Generate mbtiles by using the command generate-mbtiles.  Parameters of most interest will be minzoom=, maxzoom=, and file=.  These are used to set the minimum zoom level, maximum zoom level, and provide a file name.    For example:  generate-mbtiles minzoom=8 maxzoom=16 file=montrealarea.mbtilesUnless a path is defined, the mbtiles file will save into ’tiles’ folder in the root Maperitive folder.Each zoom level creates 4x the number of tiles of the previous level (roughly).
    The tiles are generated based on your boundaries that were set.

I typically use a zoom range of minimum 8 to a maximum of 14 or 16 depending on the size and amount of detail I need.  On my iPhone, the 16x zoom will give me a portion of a city block on the screen.  This is not necessary for navigation, but sometimes helps if caches are very close together, or if you are using the map as well as the compass to get to the cache location.

There is a quick tutorial by the author located here where he creates a hiking map and steps through the basics.  He covers some options I do not use for my purposes.  His approach may be easier to read than mine for some items.  Software documentation is available here.

Many of the functions require command line use to access the parameters.   Skipping the parameters for ‘generate-mbtiles’ will cause the software to automatically choose zoom levels, likely based on the size and scale when the command is used.  Some of the commands used are not available on the menus.

I hope this is of some help to others who use Geo Bucket.


Vintage Air Mail Labels – Candian Pacific Air Lines (1940’s)

20 09 2012

When I first started to get into fountain pens, and correspondence, I became interested in how mail was originally sent.  Actually, to be specific, I was curious as to what was used before our current common envelope.  This led to a long and winding path through postal history, envelope and letter folding (see the Envelope and Letter Folding Association, or ghh.com where there are a large number of ELFA folds available), wax seals, the first postage stamp in 1840, and a myriad of other things.

I joined into postcard and correspondence exchanges through the Fountain Pen Network, read blog entries about penpals – what to write, and why sometimes they disappear without a word, and joined the Letter Writers Alliance.  I joined because I enjoy their blog, like their mission statement, and because it made me feel a little less like I was crazy – finding a group of people who have this weird cross between technology, and anti-technology as a part of their lives.  Kathy and Donovan put a lot of energy into the LWA, and there have some great items available for sale, and as both free and member downloads.  I joined when I realized I was crossing paths with people I had stumbled into on-line in other places – like Cole, of Simplicity Embellished.

And while this is not meant to be a rambling plug of some of my favourite spots – it has sort of become that.  So… to the point….

One of the downloads at LWA, is a great sheet of vintage air mail labels (part way down the page).  I became interested in vintage air mail labels – not enough to collect, yet, but more than enough to pique my interest.  During my on-line perusal, I came to realize that there are an insane number of air mail labels out there – as it appears that every major airline and postal system offered air mail service at one point in time.  And I ran across some great labels.  Including a number of Canadian ones.

Canadian Pacific Air Lines Air Mail Label (40's)

One of the ones I liked best, was a 1940’s Candian Pacific label.  I like it for a number of reasons – the fact that it isn’t square like the majority of labels, the fact that it was a company started in western Canada, and because the head office is in my home town.  So I set out to reproduce the label, and give a little back.

And while I am glad I did the project, I am extremely happy to be done.  It was an embarassing reminder of how little I use vector software, and how out of practice I am.  It was also amazing how difficult it was to take what appeared to be a decent image, and to attempt to reconstruct something that was misregistered, lacking detail in the original printing, and pixelated too much to follow at times when enlarged.  I was able to reference some images of luggage tags and schedules from the period I ran across on-line to assist with getting a better feel for some of the details.  I also forgot how words begin to look ‘wrong‘ after you stare at them through 1000+ fonts, trying to find a match, or something really close, or something a little close, or something passable….  only to find when I stumbled across a better reference image it looked nothing like what was on the poorly printed lable.  In the end, I was able to get a reasonable match to the fonts, clean up the registration errors, and add better details from the other reference material.

My grand scheme had included reproducing several other Canadian labels, like the Trans Canada Airlines or Yukon Air labels, but I have opted to scale back.  Just due to time.  At some point I will forget how long this project took, and do another label, but for now… this is it.

Canadian Pacific Air Lines - Reproduction 1940's Air Mail Label

And for having made it to the end, and staying awake – the following link will download the PDF file:

  CP Airlines Air Mail Labels (1946)

I print mine on Avery 8.5 x 11″ laser printer label sheets (05165).

I hope you enjoy them.

images referenced from:

inaugural post….

23 08 2012

I like ‘people’, but I am not a people person.  I prefer to be alone, but feel a need to reach out and connect.  I am very private and find sharing intensely difficult, but feel a need to establish communication.  I’ve spent my life trying to figure out who I am, where I am going, what is important, and what I want to do – still a huge mess and a work in process.

So I can’t explain why I repeatedly feel drawn to blogging.   Over the years I have started a number of blogs, and they have eventually trailed off into nothingness.  They never rose above obscurity.  It was never my intent.  I guess I feel I have something to say, but feel like I don’t have anything worth saying.  Some of them were to offer technical support, but most were part of some not fully identified yearning.

I was originally going to start this blog off by amalgamating the best posts from all of the various locations into one,  but I haven’t posted in years, and none of it seems memorable.  if I run across any that strike my fancy that aren’t completely infantile….

what will happen, is as time permits, and the mood strikes me, I plan to have something to say about one of my interests.  Or something to share – such as photographs, old advertisements, vintage stationery I have run across, photos and information on fountain pens, typewriters, sealing wax, tools, and other such things.  Some may be handwritten, or type cast.  Sporadic at best, so low expectations.

I’ve never been one to say much, But I’ve been told I can be hard to shut up at times when I get going.    I’m pretty sure I’m talking a lot at those times, but not actually saying much.

Funny how life is full of contradictions like that.

I will leave you now, with a photo, and a favourite quote.  They are unrelated to each other.

Grass Under Glass

Grass Under Glass (c) 2006

“Our battle, our struggle is to create art. Our weapon is the moving picture. Because we have the moving picture, our paintings will grow and recede. Our poetry will be shadows that lengthen and conceal. Our light will play across living faces that laugh and agonize. And our music will linger and finally overwhelm because it will have a context as certain as the grave. We are scientists engaged in the creation of memory. And our memory will neither blur, nor fade.”

– from Shadow of the Vampire, an E. Eliam Mirkle film