Menu

About MapFramer

Agnar Renolen

What is MapFramer?

MapFramer is a simple command line tool that I wrote in Python to help automate the process of creating and designing frames around maps that contain coordinate ticks, coordinate values, title and so forth.

Basically, you 'design' the map frame by writing an XML-file specifying the various components of the frame. This may even include the geographical bounds of the map, the map scale and the map projection or spatial reference system used.

MapFramer then parses this file along with the command line arguments, and creates a PDF-file for the frame. If you have Adobe Illustrator, you can open your map frame in Illustrator, and if you have your map in illustrator- or in PDF-format too, it easy to put your frame on top of the map, using Illustrator, or even Adobe InDesign.

At the current stage, MapFramer is rather crude (after all, this was my first Python project); you can't do a whole lot with it, but if you need more sophisticated content, you can add that in Illustrator.

Getting MapFramer

MapFramer is a free software copylefted by me under the GPL license, version 3.
It is hosted on sourceforge.net, here at mapframer.sourceforge.net

Currently, executables are available only under the windows platform. But by obtaining the source (using Subversion), installing Python 2.7 and the dependent libraries, Reportlab and PyProj, you can even use it on OSX and Linux.

Executables for other platforms is on the wish list. If you are a developer and know how to do it, I'm happy to accept some help.

Installing and running MapFramer

Windows

Simply download and run the installer. Then you may start the MapFramer shell which basically is an ordinary CMD window, but with the path to the mapframer.exe file set up for you.

OSX and Linux

Currently, you will have to install Python 2.7 and add ReportLab and PyProj (and their dependencies) manually. You may use pip or easy_install to do that. Then download the source code using Subversion using the following command:

svn checkout svn://svn.code.sf.net/p/mapframer/code/ mapframer-code

The XML-file

The content of the XML file is described in the [XML-specification].
Although, not directly used by MapFramer to validate the XML (actually referring to the DTD in the XML-file as DOCTYPE will cause errors), a [DTD-File] has been produced.

Running MapFramer

MapFramer is invoked using the following command in your command shell.

mapframer [-h] [-s map_scale] [-p srs]
          [-b minx miny maxx maxy] [-o pdf_file] xml_file

Arguments

-h --help print help message
-s map_scale --scale map_scale map scale denominator
-p srs --srs srs spatial reference system(any string accepted by the PROJ.4 library)
-b minx miny maxx maxy --bounds minx miny maxx maxy geographical bounds of map frame
-o pdf_file --output pdf_file Name of PDF file to output (defaults to the name of the xml-file but with pdf-extension). Any existing PDF-file will be overwritten

** NOTE: ** map_scale and map bounds must be specified either in the XML file or on the command line. If it is not specified either place, mapframer will exit wit error.

** NOTE: ** the spatial reference system (srs) must be specified only if your map frame contains graticule elements, either in the XML-file, or at command line.


Related

Wiki: DTD-File
Wiki: Home
Wiki: XML-specification

MongoDB Logo MongoDB