question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation updates to sjoin geopandas docs

See original GitHub issue

Hi All, I’m working on class lessons and would really love to improve the geopandas documentation. To begin i’d like to update sjoin docs to include descriptions of the various arguments (which is actually quite good in the code). Are you amendable to my creating a PR with that update? i’m adding it to my lessons - so minus well add it here too - if it is acceptable to you all! 😃

My update to this page would look something like:

### Sjoin Arguments:

The `op` argument specifies how geopandas decides whether or not to join the attributes of one object to another. There are three different join options:

* `intersects`: Returns True if the boundary and interior of the object intersect in any way with those of the other.
* `within`: Returns True if the object’s boundary and interior intersect only with the interior of the other (not its boundary or exterior).
* `contains`: Returns True if the object’s interior contains the boundary and interior of the other object and their boundaries do not touch at all.

<a href ="http://toblerity.org/shapely/manual.html#binary-predicates" target = "_blank">You can read more about each type here.</a>
 
The `how` argument accepts following options:

* 'left': use keys from left_df; retain only left_df geometry column
* 'right': use keys from right_df; retain only right_df geometry column
* 'inner': use intersection of keys from both dfs; retain only
          left_df geometry column 

Please let me know if this addition is reasonable and if you’d like me to contribute this in a different way! i’d like to work on some other parts of the docs too but i figured i’d start here. Many thanks for your consideration. leah

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jorisvandenbosschecommented, May 31, 2018

@lwasser That would be really great!

Already quick feedback: the “Returns True if” will sound a bit strange to a user I think, as it does not really return true, it rather combines the rows if that condition is true.

0reactions
jorisvandenbosschecommented, Dec 1, 2019

Closing this issue, as the mentioned PR https://github.com/geopandas/geopandas/pull/733 has been merged long time ago.

Read more comments on GitHub >

github_iconTop Results From Across the Web

geopandas.sjoin
Spatial join of two GeoDataFrames. See the User Guide page Merging Data for details. Parameters. left_df, right_dfGeoDataFrames: howstring, default 'inner'.
Read more >
GeoPandas Documentation - Read the Docs
In an attribute join, a GeoSeries or GeoDataFrame is combined with a regular pandas Series or DataFrame based on a common variable. This...
Read more >
dask-geopandas documentation — dask-geopandas
dataframe module designed to scale pandas. Since GeoPandas is an extension to the pandas DataFrame, the same way Dask scales pandas can also...
Read more >
Spatial join — Intro to Python GIS documentation
sjoin () -function) is already implemented in Geopandas, thus we do not need to create it ourselves. There are three possible types of...
Read more >
pandas.merge — pandas 1.5.2 documentation
A named Series object is treated as a DataFrame with a single named column. The join is done on columns or indexes. If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found