Skip to content

feat: Add an example for Geohash Layer - #1242

Open
aryanxk02 wants to merge 3 commits into
developmentseed:mainfrom
aryanxk02:geo
Open

feat: Add an example for Geohash Layer#1242
aryanxk02 wants to merge 3 commits into
developmentseed:mainfrom
aryanxk02:geo

Conversation

@aryanxk02

Copy link
Copy Markdown

This PR adds an example demonstrating the Geohash Layer. Reference: #1232

@kylebarron kylebarron changed the title Add an example for Geohash Layer feat: Add an example for Geohash Layer Aug 7, 2026
@ds-release-bot ds-release-bot Bot added the feat label Aug 7, 2026
{
"cells": [
{
"cell_type": "markdown",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similar to other examples like https://github.com/developmentseed/lonboard/blob/main/examples/data-filter-extension.ipynb, could you create the example notebook with juv, so that dependencies are automatically managed with uv?

Assuming you have uv installed already, you can use something like uvx juv init [name] to create the notebook, uvx juv add [name] [dependency] to add dependencies, and uvx juv run [name] to run the notebook.

Then you can copy in the markdown instructional cell:

Image

@@ -0,0 +1,289 @@
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CI is failing on some formatting and linting on this notebook

Comment thread examples/geohash-layer.ipynb Outdated
"# /// script\n",
"# requires-python = \">=3.12\"\n",
"# dependencies = [\n",
"# \"geohash2\",\n",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

geohash2 is 10 years old: https://github.com/dbarthe/geohash/

Can we use another more modern geohash library like https://pypi.org/project/pygeohash/?

Comment on lines +189 to +192
"requests_df[\"geohash\"] = [\n",
" geohash2.encode(latitude, longitude, precision=6)\n",
" for latitude, longitude in zip(requests_df[\"latitude\"], requests_df[\"longitude\"], strict=True)\n",
"]\n",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be nice if the geohash library provided a vectorized API, so that we could nudge people towards a faster approach. But this is fine.

@kylebarron kylebarron left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall looking good, thank you

@aryanxk02

Copy link
Copy Markdown
Author

Overall looking good, thank you

Thank you for the review. Let me know if any changes are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants