ENH: Add geometry property to GeoDataFrame #47
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 inGeoDataFrame
more explicitly sets the geometry instead of just operating on the geometry column. The interface is modeled onDataFrame.set_index()
including thedrop
andinplace
options, as well the ability to use an existing column. (Most of its code comes fromset_index
as well). The geometry should be accessed using thegeometry
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.