Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ENH: expose grid_size parameter in shapely functions#3593

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
nicholas-ys-tan wants to merge10 commits intogeopandas:main
base:main
Choose a base branch
Loading
fromnicholas-ys-tan:issue3446

Conversation

@nicholas-ys-tan
Copy link
Contributor

Looks to expose thegrid_size parm as described in#3446 forunion,difference,symmetric_difference,intersection.

overlay is a bit more complex as it has its own implementations such asoverlay._overlay_difference(). Will need more thinking on that one.

theroggy reacted with thumbs up emoji
@nicholas-ys-tannicholas-ys-tan marked this pull request as draftJune 9, 2025 05:39
@nicholas-ys-tannicholas-ys-tan marked this pull request as ready for reviewJune 13, 2025 08:04
Copy link
Member

@theroggytheroggy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you add thegrid_size parameter in the docstrings of the public functions involved in base.py?

@nicholas-ys-tan
Copy link
ContributorAuthor

Can you add thegrid_size parameter in the docstrings of the public functions involved in base.py?

yes sorry, I forgot to do that, added

theroggy reacted with thumbs up emoji

Copy link
Member

@martinfleismartinfleis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks!

@martinfleismartinfleis added this to the1.2 milestoneDec 4, 2025
Copy link
Member

@theroggytheroggy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice! Some small suggestions...

GeoSeries.intersection
"""
return_binary_geo("difference",self,other,align)
return_binary_geo("difference",self,other,align,grid_size)
Copy link
Member

@theroggytheroggyDec 4, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
return_binary_geo("difference",self,other,align,grid_size)
return_binary_geo("difference",self,other,align,grid_size=grid_size)

This is best a keyword argument (as in the others below) as it might otherwise give a warning in shapely.

Comment on lines +4425 to +4428
grid_size : float | None (default None)
Precision grid size. If 0, will use double precision (will not modify
geometry if precision grid size was not previously set). If this value is
more precise than input geometry, the input geometry will not be modified.
Copy link
Member

@theroggytheroggyDec 4, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
grid_size :float|None (defaultNone)
Precisiongridsize.If0,willusedoubleprecision (willnotmodify
geometryifprecisiongridsizewasnotpreviouslyset).Ifthisvalueis
moreprecisethaninputgeometry,theinputgeometrywillnotbemodified.
grid_size :float|None (defaultNone)
Thecellsizeoftheprecisiongridtouse.Alltheverticesoftheoutputgeometry
willfallonthegriddefinedbythegridsize.IfNone,thehighestprecision
(smallestgridsize)oftheinputsisused.

Reusing the docstring ofset_precision isn't really ideal for what is happening here I think.

For clarity: remark applicable for the 4 functions.

My proposal is based on

nicholas-ys-tan reacted with thumbs up emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@martinfleismartinfleismartinfleis approved these changes

+1 more reviewer

@theroggytheroggytheroggy requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

1.2

Development

Successfully merging this pull request may close these issues.

3 participants

@nicholas-ys-tan@theroggy@martinfleis

[8]ページ先頭

©2009-2025 Movatter.jp