Ladies
Drawn wrong handed:
Black and white are my favorite colors:
Posted on Monday, November 24th, 2008.
Save PDF Pages as Images
Here is an Automator application to save each page of a PDF file as an image. You can do this with Preview, but it is tedious for documents with many pages.
Download “Save PDF Pages as Images.app” (219 KB; Mac OS X 10.5 required)
When you run the application, it begins by prompting you to select a PDF file. You can select any sort of file, but nothing much will happen if it’s not a PDF.
Next you can choose the output image format. 150 DPI PNG is the default format. I don’t think the compression setting applies to PNG images, but it does apply to JPEGs.
Rendering the images may take a moment. Then you’ll be asked to define how the output files should be named. I recommend the “Make Sequential” option. By default, page images from a three-page document will be named page-01.png
, page-02.png
, and page-03.png
.
Lastly, you can choose where to save the results. Choose “Other…” from the menu to select a folder that doesn’t appear among the default locations.
Now you have an image of each page in the PDF.
Posted on Tuesday, November 18th, 2008.
Recent Things Dock Stack Revisited
I use the recent applications Dock stack more than I expected when I mentioned it a few weeks ago. So, for those wary of the command line, here’s a tiny application that adds a new “recent things” stack to your Dock.
Download “Add Recent Things Dock Stack.app” (208 KB)
Your Dock will be restarted, so any minimized windows will be revealed. It shows recent applications by default, but you can right-click its icon to choose to show recent documents or servers as well as favorite volumes or items. Mac OS X 10.5 is probably required.
Posted on Tuesday, November 18th, 2008.
Ink and Water
Emmanuel Guibert used an incredibly clever technique to illustrate Alan’s War, a graphic novel about his friend’s experience in WWII. Here’s an example (via Drawn):
I was perplexed at first, but it all becomes clear about fifty seconds into the video.
Posted on Thursday, October 30th, 2008.
MacBook Markerboard
It recently occurred to me that the exterior surface of my MacBook is quite similar to the surface of a markerboard. Tonight I purchased a package of small dry-erase markers and put the idea to the test. It works great!
Now I can’t wait to bring my notebook computer to a meeting so I can take notes on its lid.
Posted on Thursday, October 30th, 2008.
Cartograms
A cartogram is a map in which the area of each region is distorted to represent a value other than physical area, such as population.
It’s election season here in the US, which means we see many maps of red and blue states. To keep the political persuasion of the nation in perspective, take a look at Michael Gastner, Cosma Shalizi, and Mark Newman’s maps of the 2004 and 2006 elections.
One of my favorite web sites, Strange Maps, has occasionally featured cartograms, including a map of world population from another collection of global cartograms prepared by Newman.
Strange Maps also featured a cartogram of where news happens drawn from a seminal paper by Gastner and Newman. The paper presents a solution to the challenge of preserving recognizable shapes and adjacencies while manipulating area. Traditional techniques typically compromise contiguity or detail, as seen in these examples from Borden Dent’s excellent Cartography: Thematic Map Design:
Conveniently, various implementations of Gastner and Newman’s algorithm are available: cart, by Newman; cartogram, by Gastner; and Cartogram Generator, by Frank Hardisty. Hardisty’s program has a cross-platform interface and works directly with shapefiles and shapefile attributes. I used it to create a cartogram of block groups in Binghamton based on their year 2000 populations:
The distortion is not extreme, but there are some interesting changes.
In addition to the interactive comparison view shown above, Cartogram Generator allows you to save the results as a new shapefile. It is supposed to have the ability to apply the same transformation to other shapefiles, too – useful for creating reference layers – but I could not get that feature to work.
I think it is important to show an undistorted map next to a cartogram except in cases where the actual sizes are well known (as with maps of the world or your state or nation). Otherwise, changes in proportion might not be recognized, and the story they are meant to tell will not be heard.
Posted on Saturday, October 4th, 2008.
PROJ, GDAL, and OGR – Oh, My!
Here are brief introductions and home-brew installation instructions for two libraries (and sets of command line tools) widely used by open-source GIS applications.
In most cases you probably won’t need to compile these yourself, as end-user programs are typically packaged with everything you need. Sometimes batteries aren’t included, though, or you might want to write a program that uses these tools directly. They’re like wheels you don’t need to reinvent to build construction vehicles for your novel GIS problems.
proj-4.6.1: PROJ.4 Cartographic Projections Library
From the documentation (OF90-284):
Program proj (release 3) is a standard Unix filter function which converts geographic longitude and latitude coordinates into cartesian coordinates, (λ, φ) → (x, y), by means of a wide variety of cartographic projection functions.
Cartographic projection is the process by which points on a sphere are mapped to points on a plane. There are many ways this can be accomplished, all of which are necessarily compromises. PROJ.4 provides a programming interface to perform such projections.
./configure
make
make install
gdal-1.5.2: Geospatial Data Abstraction Library
GDAL provides a common programming interface to translate and access a variety of geospatial raster (i.e. bitmap) data formats. GDAL includes the OGR Simple Features Library, which performs a similar function for vector data. OGR uses PROJ.4.
./configure
make
make install
GDAL’s configure
script reports which optional features are available. Many have additional dependencies, such as the TIFF and PNG libraries built in a previous guide.
Posted on Monday, September 22nd, 2008.
American FactFinder: Geo within Geo
A great deal of census data is available through American FactFinder. The custom table interface allows you to retrieve a single table containing exactly the data you want. To obtain data for many locations within another location, use the easily-overlooked “geo within geo” selection method to avoid the tedium of retrieving and combining separate tables for a group of locations.
As an example, I’ll show you how to retrieve the year 2000 population by age and sex for each block in Broome County, NY.
First, select Decennial Census from the Data Sets menu at factfinder.census.gov:
Then select Custom Table from the Census 2000 Summary File 1 category:
Here’s the important step. Click the geo within geo selection method tab:
Choose Blocks from the Show me all menu (your table will contain data at this resolution):
By default, the table will contain all block groups within a county. Select New York and Broome County from the following menus to select which county:
Select All Blocks from the list of blocks in Broome County and click Add:
Now that you have defined the enumeration units and area of interest, click Next to choose your variables:
Select P12 Sex by Age (Total Population) from the list of tables in Summary File 1 and click Go:
Check which variables you want from table P12 – all of them. Click Add, then click Next to proceed:
Click Show Result to display the table (this may take a few moments):
Lastly, choose Download from the Print/Download menu to obtain the table in spreadsheet form:
How you use the data is up to you. Perhaps you’ll use dbfjoin
to map it with an appropriate shapefile from the Census Bureau’s TIGER/Line repository. (Users of pro GIS tools don’t need dbfjoin
, but I’m bringin’ it to the streets!) Alternatively, you might want to plot the age/sex composition of a few blocks with Population Analyst. Stay tuned for more bargain-bin demography and cartography.
Posted on Sunday, September 21st, 2008.
Compiling ChoroWare
ChoroWare is a suite of tools used to develop optimal data classifications for choropleth maps. I am surprised that I did not discover it until recently, because this is one of my favorite topics in cartography.
ChoroWare might prove to be particularly useful for ambitious users of free GIS applications like Quantum GIS or ArcExplorer. These programs do not offer very sophisticated classification schemes, but they do allow classes to be defined manually. In this way, I plan to try mapping classifications generated with ChoroWare.
Executable versions of ChoroWare are not available for Mac OS X (or any other platform), so you must build it from the source code. ChoroWare has two main dependencies: GTK+ and GSL. GTK+ itself has numerous prerequisites, which I have described in a separate article (again, it may be wise to use a package manager). Building GSL is relatively straightforward:
gsl-1.11: GNU Scientific Library
./configure
make
make install
With all the prerequisites in place, building ChoroWare is as simple as:
make
I found that make install
did not work, so I performed the equivalent action of copying the piping-hot new executables from their various subfolders to /usr/local/bin
.
The included example files run without fault. ChoroWare on Mac OS X:
More details about the theory and implementation of ChoroWare can be found in the documentation (PDF) and associated papers (PDF).
Posted on Sunday, September 21st, 2008.
Building GTK+ the Hard Way
Update: Four days after posting this list, GTK+ OS X is available. I’m not sure how to use it build ChoroWare yet, but I’m sure it’s possible (and much easier than the process outlined below).
GTK+ is a user interface toolkit used by many open source software projects.
This is a record of how I managed to build GTK+ on my Mac, not a prescription for the best way to do it. The versions identified here may be out of date, for instance, and there may be additional dependencies I have failed to list. (Most of this work was done months ago, so these steps are based on old notes.)
This procedure yields an X11 version of GTK+. I understand that there is an effort to build a native version of GTK+ for Mac OS X, but this is not it.
I have provided a link to the web site or download area for each library, along with the commands used to build it. You should cd
to the library’s directory before running each set of commands. The libraries are listed in the general order in which they were built.
This is probably trivial with a package manager like Fink.
libiconv-1.11: Libiconv (Unicode conversion)
./configure
make
make check
make install
gettext-0.14.6: Gettext (internationalization)
./congfigure
make
make check
make install
libtool-1.5.22: Libtool (shared libraries)
Needed by LibJPEG.
./configure
make
make check
make install
jpeg-6b: LibJPEG
./configure --enable-shared
- (Edit line 39 of Makefile to point to path of GNU Libtool.)
make
make test
make install
tiff-3.8.2: LibTiff
./configure --with-apple-opengl-framework
make
make check
make install
libpng-1.2.12: LibPNG
./configure
make
make install
libxml2-2.6.26: LibXML 2
Needed by FontConfig.
./configure
make
make check
make install
fontconfig-2.4.1: FontConfig
Needed by Cairo.
./configure
make
make check
make install
cairo-1.2.4: Cairo (graphics renderer)
./configure
make
make test
make install
pango-1.14.4: Pango (text renderer)
./configure
make
make check
make install
atk-1.12.3: ATK (accessibility)
./configure
make
make check
make install
glib-2.12.4: The GIMP Library
./configure
make
make check
make install
Last, but not least:
gtk+-2.10.6: The GIMP Toolkit
./configure
make
make check
make install
Anyone brave enough to try all this is encouraged to post the inevitable corrections.
Posted on Saturday, September 20th, 2008.