Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add geometry property to GeoDataFrame #47

Merged
merged 1 commit into from
Oct 30, 2013

Conversation

jwass
Copy link
Member

@jwass jwass commented Oct 30, 2013

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.

Adds a geometry property and set_geometry() method to GeoDataFrame. This was
suggested in Issue geopandas#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.
kjordahl added a commit that referenced this pull request Oct 30, 2013
ENH: Add geometry property to GeoDataFrame
@kjordahl kjordahl merged commit cccf936 into geopandas:master Oct 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants