Skip to content

grid_round [OLD #24] #15

@MichaelChirico

Description

@MichaelChirico

Not sure how directly useful this is, but it would be helpful to other functions (e.g. gh_grid and gh_distance).

The idea is to take points and "round" them to their current geohash centroid (or perhaps to any of the nine "cardinal" points of a geohash?).

This is simpler to do than geohash encoding as it can be done with simple vectorized arithmetic, e.g.:

# in lower-left; add gh_delta to get centroid
gh-1: (lat, lon) -> ( 45*(lat %/% 45), 45*(lon %/% 45) )
gh-2: (lat, lon) -> ( 5.625*(lat %/% 5.625), 11.25*(lon %/% 11.25))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions