Keno/Shapefile.jl — pull request #3 by jiahao (2014-06-30 16:00:49+00:00)
Title: RFC: Add some conversion functions to play nice with Compose.jl

This PR provides some conversions from `Shapefile.Rect` and `Shapefile.Polygon` shape primitives to their analogues in [`Compose.jl`](https://github.com/dcjones/Compose.jl).

- A new method for `Compose.rectangle` is defined which takes a `Shapefile.Rect` as input and returns a `Compose` rectangle.
- A new function `polygons()` is defined which takes a `Shapefile.Polygon` as input and returns a `Vector` of `Compose` polygons. As `Shapefile.Polygon`s are allowed to have multiple disjoint components, there is no guaranteed 1:1 correspondence between a `Shapefile.Polygon` and a `Compose` polygon.

The primary design question is where these functions should live. Either `Shapefile.jl` or `Compose.jl` would be obvious candidates, but that means that the order of loading modules becomes important since this PR conditionally defines these new methods only if `Compose` is already loaded. This PR isn't ideal, since it introduces an asymmetry requiring that `Shapefile` be loaded only after `Compose`, and furthermore that the corresponding conversions from `Compose` objects to `Shapefile` objects have to be defined herein and not in `Compose` (if they were, then there would be no way to load both sets of conversion methods).

A separate metapackage is another possibility, but seems somewhat less elegant.

cc: @dcjones @JeffBezanson