kjordahl/geopandas — pull request #47 by jwass (2013-10-30 06:49:07+00:00)
Title: ENH: Add geometry property to GeoDataFrame

Adds a geometry property and set_geometry() method to GeoDataFrame. This was
suggested in Issue #45. The implementation mimics that of DataFrame's
set_index in that it returns a copy of the GeoDataFrame by default with the
new geometry. You can specify a column or give a list/ndarray of geometries.

This addresses the discussion in Issue #45. The new `set_geometry()` method in `GeoDataFrame` more explicitly sets the geometry instead of just operating on the geometry column. The interface is modeled on `DataFrame.set_index()` including the `drop` and `inplace` options, as well the ability to use an existing column. (Most of its code comes from `set_index` as well). The geometry should be accessed using the `geometry` property instead of as a column.

Soon, we might also want to remove the geometry column altogether soon and just access it through the property and `set_geometry` method. I didn't want to go that far before getting feedback.

The Travis build on this fails on Pandas master due to the new implementation of head and tail. Pull request #46 takes care of that.