kjordahl/geopandas — pull request #69 by jwass (2013-11-12 20:05:34+00:00)
Title: Use Geometry namespace for all geometry operations

This is an alternate implementation for Pull Request #68 that also changes the way `GeoSeries` works.

It introduces the idea of a `geo` namespace where all the geometry methods reside. @jtratner has suggested it multiple times and I figured I'd give it a shot. The tests are completely broken, I didn't want to spend the time to fix them before discussing this.

Both `GeoSeries` and `GeoDataFrame` have a `geo` property that's analogous to `Series.str` for performing the Shapely operations.

All geometry operations take the form:
```
s = GeoSeries(...)
s2 = GeoSeries(...)

s.geo.intersects(s2)
```

The advantages of this approach are:
* Avoid any name collisions with Series/DataFrame methods
* No multiple inheritance
* Could make it easier to monkey patch `geo` on `Series` or `DataFrame`, although there would be a bunch of other issues to sort out.
* @jtratner, others?

The main disadvantage is you have to type `geo` all over the place. Here's a good example for testing bounding box overlaps:
```
gdf1 = GeoDataFrame(...)
gdf2 = GeoDataFrame(...)

gdf1.geo.envelope.geo.intersects(gdf2.geo.envelope)
```
instead of
```
gdf1.envelope.intersects(gdf2.envelope)
```

Any thoughts of this over the original implementation in Pull Request #68?