Osmarender restguide

From OpenStreetMap Wiki
Jump to navigation Jump to search

The Osmarender restguide perl script uses osmarender to create a restaurant guide (map). It is one of many approaches for putting OSM on Paper. Code is at http://svn.openstreetmap.org/applications/rendering/restguide/ .

This program has been developed using Debian Linux, and may need some changes for non-linux operating systems.

The program uses the old api (0.5), here are my patches for the new version : http://osmopenlayers.blogspot.com/2010/08/getting-resguide-to-run-on-ubuntu.html

Osmarender creates images with tiny sizes embedded in them, so I use pngcrush to resize them. The main problem with this is the scale and copyright are enlarge rediculously by doing this, so I've turned off those options. I created a separate png with the copyright notice, which can be combined with the map image, title, and osm logo using openoffice. This is designed for printing, maps for web pages will use very different paramaters to look good.

The --dpi and --res paramaters control the rescaling. --dpi 1800 --res 300 will produce an 1800 dpi image then rescale to 300 dpi (making it 6 times bigger in each dimention.)

The --lats and --lons paramaters control how big an area to map. They are in degrees, so the values will be pretty small.

The --download paramater tells the script to redownload the data from osm. It downloads an area twice as big as needed, so small position or size changes will not need another download.

As of version 0.2, two new options are added: --poi will create a list of certain types of points of interest, and --sub will substitute names of them. The --poi option will give numbers to the points of interest, sorted by lat an lon. "cut -f1,7" (6 rather than 7 if you have the ealier version without the cuisine column) can be used on this list to get the poi number and name only. You can edit this list if you want a different sort order or don't want some names substitued. You could even put whatever new name you want in column for the poi in column one, like "Our Convention here" for the convention hotel name.

The orp shell script will need to be edited to point to where you have orp installed.


restguide --lats 0.024 --lons 0.04 --dpi 1800 --res 300 loscon 33.950 -118.380

This example produces a map of the area north of LAX.

Process of creating a restaurant map:

  • Collect informaiton that you want on the map
  • edit it into the OSM database using JOSM, Potlatch, or Merkarrtor. Only put accurate information into the database.
  • Guess center coordinates and size of the map. http://informationfreeway.org/ can give you coordinates of your convention headquarters.
  • Guess size. If it is too big the png will be difficult to generate.
  • Use restguide with the --download and --poi options
  • Examine the generated png file. (I use display.) Realize it is designed for printing, not on screen display.
  • Iterate on the center and size until it shows what you want. --download and --poi options will not be needed unless you move or inlarge significantly.
  • Use cut to get the name list
  • Edit the png, the openstreetmap logo and copyright pngs, and the name list into a document, adding titles as desired. I use openoffice.
  • print and/or generate pdf
  • iterate until you get close to what you want
  • optional: edit the .osm file with josm to improve the look. If you do not upload, but only save to your local file, you can make modifications like deleting things you don't want to show, moving objects to make things clearer, adding things that don't exist, splitting ways to get the name where you want, etc. This should be done after you are sure that you have your area of the map as good as you can.
  • optional: edit the osm-restguide.xml file to change the map style. scale is one thing you may want to change if you feel the streets are the wrong width. (It interacts with the --dpi and --res options to restguide.)
  • optional: edit the svg file and use inkscape to generate the png