-
Notifications
You must be signed in to change notification settings - Fork 50
feat: add bigframes.bigquery.st_distance
function
#1637
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
Conversation
1 POLYGON ((1.97082 2.00002, 0 2, 0 0, 1.97082 2... | ||
2 GEOMETRYCOLLECTION EMPTY | ||
3 LINESTRING (0.99265 1.00781, 0 2) | ||
4 POINT (0 1) | ||
dtype: geometry | ||
|
||
Args: |
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.
Miss series
argument here.
dtype: Float64 | ||
|
||
Args: | ||
series: |
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.
nit: add type to the arguments:
series(bigframes.series.Series)
other (bigframes.series.Series or geometric object)
1 POLYGON ((0 0, 0.99954 1, 0 1, 0 0)) | ||
2 LINESTRING (0 0, 0.99954 1) | ||
3 GEOMETRYCOLLECTION EMPTY | ||
4 POINT (0 1) | ||
dtype: geometry | ||
|
||
Args: |
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.
Missing series
argument here.
Sorry, something went wrong.
All reactions
# we can. | ||
@property | ||
def area(self, crs=None) -> bigframes.series.Series: # type: ignore | ||
"""[Not Implemented] Use ``bigframes.bigquery.st_area(series)``, |
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.
I'm curious why we cannot implement the similar methods for GeoSeries here?
Sorry, something went wrong.
All reactions
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.
It's because BigQuery returns the value in meters, but in GeoPandas, it's based on the native coordinates. We're leaving it as not implemented until we can figure out how to be more "drop in" with regards to support for GeoPandas.
Sorry, something went wrong.
All reactions
|
||
geobf_s1 = bigframes.geopandas.GeoSeries(data=data1) | ||
geobf_s2 = bigframes.geopandas.GeoSeries(data=data2) | ||
geobf_s_result = bbq.st_distance(geobf_s1, geobf_s2).to_pandas() |
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.
Do we expect st_distance
throw an error if two GeoSeries has different numbers of rows? If so, can we try to verify that offline or in a simple test?
Sorry, something went wrong.
All reactions
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.
It should not. Instead, it should return null for the mismatched rows but that'd be a good test. Will add some.
Sorry, something went wrong.
All reactions
chelsea-lin
Successfully merging this pull request may close these issues.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕