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

Change H3Poly/H3MultiPoly to LatLngPoly/LatLngMultiPoly #332

Closed
ajfriend opened this issue Dec 5, 2023 · 0 comments
Closed

Change H3Poly/H3MultiPoly to LatLngPoly/LatLngMultiPoly #332

ajfriend opened this issue Dec 5, 2023 · 0 comments

Comments

@ajfriend
Copy link
Contributor

ajfriend commented Dec 5, 2023

Lat/Lng vs Lng/Lat order is one of the biggest sources for user bugs/questions/issues, especially when creating Polygon and MultiPolygon objects. Lng/Lat order is what's used in many other tools like geopandas and GeoJSON, but the H3 C library uses Lat/Lng order.

h3-py will stick with Lat/Lng order, but we can alleviate the mistakes caused from switching orders between tools by potentially making the ordering explicit in the name. An additional goal is to make it obvious that our polygon and multipolygon objects are different from shapely Polygon and MultiPolygon objects.

Some options:

  1. H3Poly and H3MultiPoly (current; users need to read docstrings to know/recall ordering)
  2. LatLngPoly and LatLngMultiPoly (explicit, but a bit long)
  3. constructors like H3Poly(outer, *holes, latlng=True) (short name, "latlng choice" more prominent in the constructor signature than docstring)

I'm leaning towards LatLngPoly and LatLngMultiPoly but wanted to have a separate discussion here for future reference rather than having it hidden in the comments of #301.

I see it as a decision of how forcefully we want to remind the user of the ordering. In ordering of increasing forcefulness:

  1. documentation or function docstrings
  2. constructor signature
  3. class name
@ajfriend ajfriend changed the title Change H3Poly/H3MultiPoly to LatLngPloly/LatLngMultiPoly Change H3Poly/H3MultiPoly to LatLngPoly/LatLngMultiPoly Dec 5, 2023
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

No branches or pull requests

1 participant