Skip to content

Added GEOADD, GEODIST, GEOSEARCH commands #1742

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bipoool
Copy link
Contributor

@bipoool bipoool commented May 18, 2025

  1. Used a Similar approach like Redis
  2. Used sorted sets to store GeoHash
  3. Bit Precision is 52 bits, same as redis (Will discuss this once, can make it configurable)
  4. Created a geo package in /internal (Will discuss its placement)
  5. For GeoHashing - github.com/mmcloughlin/geohash

Other related PRs -
DiceDB-Protos PR - DiceDB/dicedb-protos#7
DiceDB-GO PR - DiceDB/dicedb-go#18
DiceDB-CLI PR - DiceDB/dicedb-cli#48

@arpitbbhayani
Copy link
Contributor

@bipoool is this a WIP or good for a review?

@bipoool
Copy link
Contributor Author

bipoool commented May 19, 2025

GEOADD, GEODIST are done and tested.
GEOSEARCH still needs some testing
Should I remove GEOSEARCH and get the first 2 commands reviewed first?
Can raise a different PR for GEOSEARCH later.
Will complete GEOSEARCH by Thursday.

@bipoool
Copy link
Contributor Author

bipoool commented May 21, 2025

Hey @arpitbbhayani
GEOADD, GEODIST & GEOSEARCH are done and tested
This PR is good for a review

Copy link
Contributor Author

@bipoool bipoool left a comment

Choose a reason for hiding this comment

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

Hey @arpitbbhayani
I've created a geo type as discussed
Will add more commands and links soon

}

// This returns all the nodes which are in the given shape
func (geoReg *GeoRegistry) GeoSearchElementsWithinShape(params map[Param]string, nonParams []string) ([]*wire.GEOElement, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function is still large due to the validation part
Should I break the validation and search part into different functions?

Copy link
Contributor

Choose a reason for hiding this comment

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

nope. that's okay.

@bipoool bipoool force-pushed the feature/geo-commands branch from f5650f1 to fa454ed Compare May 27, 2025 10:46
@bipoool
Copy link
Contributor Author

bipoool commented May 27, 2025

Hey @arpitbbhayani
I've added the rest of the GEO* commands as well

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

Successfully merging this pull request may close these issues.

2 participants