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

Optional geometry parameter for summary endpoint #13

Closed
zacdezgeo opened this issue Jul 24, 2024 · 1 comment · Fixed by #21
Closed

Optional geometry parameter for summary endpoint #13

zacdezgeo opened this issue Jul 24, 2024 · 1 comment · Fixed by #21
Assignees
Labels
enhancement New feature or request

Comments

@zacdezgeo
Copy link
Collaborator

It may be helpful for API users to obtain a response from the summary endpoint that includes a geometry column. This would remove the need for a user to write custom code that adds the geometry, such as:

import h3
from shapely.geometry import Point

def h3_to_point(h3_id):
    lat, lng = h3.h3_to_geo(h3_id)
   
    return Point(lng, lat)

We could set the default to None, and support two other options in the endpoint:

  1. Polygon: returns a polygon geometry of the hexagon
  2. Point: returns a point geometry of the centroid of the hexagon

@bpstewar @andresfchamorro; I look forward to your feedback regarding your preferences. Lift is relatively small but I'll wait on your feedback before working on implementation.

@zacdezgeo zacdezgeo added the enhancement New feature or request label Jul 24, 2024
@zacdezgeo zacdezgeo self-assigned this Jul 24, 2024
@bpstewar
Copy link
Collaborator

I think both make sense; I did something similar here when creating h3 indices although I only cared about polygons. https://github.com/worldbank/DECAT_Space2Stats/blob/main/src/h3_helper.py#L49

I think having the option for both would be interesting as the points will make for much lighter output files while maintaining options for vizualization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants