kjordahl/geopandas — pull request #68 by jwass (2013-11-12 04:44:52+00:00)
Title: Geometry Operations on GeoDataFrame

Add geometry operations to `GeoDataFrame`. It enables:
```
gdf1 = GeoDataFrame(...)
gdf2 = GeoDataFrame(...)

gdf1.intersection(gdf2)
gdf1.intersection(gdf2.geometry)
gdf1.geometry.intersection(gdf2)
...
```

This addresses Issue #44.

I'm not sure it's ready to be merged just yet. I'd like to get everyone's feedback.

A few things are happening here:
* A new `GeoPandasBase` class is introduced. It implements all the geometry operations which get removed from `GeoSeries`. `GeoPandasBase` has no instance variables.
* Both `GeoSeries` and `GeoDataFrame` inherit from `GeoPandasBase`.
* The `GeoPandasBase` geometry operations grab the `geometry` property of their inputs to use for the underlying Shapely operations
* `GeoSeries` now has a `geometry` property which returns `self` (in order to get the `GeoPandasBase` operations functioning)
* All the geometry tests are moved to `test_geom_methods` which tests all possible combinations of input types when necessary. So the binary topological operations will be tested with: (GeoSeries, GeoSeries), (GeoDataFrame, GeoSeries), (GeoSeries, GeoDataFrame), (GeoDataFrame, GeoDataFrame) input types.

All the geometry operations return a `GeoSeries`.

How do you feel about the multiple inheritance? We could also bind the geom methods dynamically without the extra class.