-
Notifications
You must be signed in to change notification settings - Fork 794
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
Integration with geopandas #588 #818
Closed
Closed
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
d317c98
Merge remote-tracking branch 'altair-viz/master'
iliatimofeev e297f20
Merge remote-tracking branch 'altair-viz/master'
iliatimofeev ea65ca1
Merge remote-tracking branch 'altair-viz/master'
iliatimofeev f7d66b7
__geo_interface__ in to_geojson_values
iliatimofeev e9d28a5
GeoDataFrame support without dependency of GeoPandas
iliatimofeev 985d3f6
Merge remote-tracking branch 'altair-viz/master' into it-#588-geopandas
iliatimofeev b627c6c
Unused test file
iliatimofeev 2cd9fde
Full __geo_interface__ support, test_geojson
iliatimofeev 7db9ff8
test update
iliatimofeev 950eb72
Mistakenly added .vscode files removed
iliatimofeev 9f91c00
limit_rows two returns, to_* one if "geo" statement, four spaces for…
iliatimofeev 76a2af8
geojson_feature()
iliatimofeev 094a2e7
test_geopandas_examples (hacker version)
iliatimofeev df84294
travis-ci: move finalized locals outside try
iliatimofeev 27a3df8
remove python 3 code
iliatimofeev 301ea23
flat version
iliatimofeev c114acc
flat version
iliatimofeev 143ad04
Merge remote-tracking branch 'altair-viz/master' into it-#588-geopandas
iliatimofeev 661447d
Merge remote-tracking branch 'altair-viz/master' into it-#588-geopandas
iliatimofeev d2b46e0
GeoPandas ref
iliatimofeev 649fa21
Merge remote-tracking branch 'altair-viz/master' into it-#588-geopandas
iliatimofeev 89a999e
Merge remote-tracking branch 'altair-viz/master' into it-#588-geopandas
iliatimofeev 80c56d6
merge
iliatimofeev 1bb8192
flake8 fix
iliatimofeev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ target/ | |
|
||
.ipynb_checkpoints | ||
.idea/* | ||
.vscode/* | ||
tools/_build | ||
Untitled*.ipynb | ||
.mypy* | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something strange is going on here: is not checking for
type
inattrs
necessary for this PR? And why is this block doubly indented?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'type' not in attrs
this is still checked, but in the line below (232).The idea behind: to allow user work with GeoDataFrame like as regular DataFrame but showing geoshapes attached to its rows.
Implementation details:
First of all GeoDataFrame is subclass of
pd.DataFrame
with__geo_interface__
. So it is instance ofpd.DataFrame
that has attribute__geo_interface__
. GeoPandas are stored as geojson FeatureCollection with each row as Feature object where all columns are placed in properties object. Sample will be more informative:So first step is to add ["property": "features"] to vega-light data format description. That splits valid geojson stored in values back to rows of GeoDataFrame (it is possible to replace this step with storing content of "features" directly into "values" but that will made "values" invalid geojson).
Next is access to column values of GeoDataFrame. Values are accessible from chart as "properties.column_name". I hoped to simplify user experience by adding "properties." in shorthand. Now if user use shorthands he will get same behavior for GeoDataFrame as for DataFrame (take a look to updated description of PR) .
May be I should check if field name starts with "properties." to avoid doubling it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see.
We can think about that. In the meantime can you fix the indentation? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed anymore due new save format