feat: Add an example for Geohash Layer - #1242
Conversation
| { | ||
| "cells": [ | ||
| { | ||
| "cell_type": "markdown", |
There was a problem hiding this comment.
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:
| @@ -0,0 +1,289 @@ | |||
| { | |||
There was a problem hiding this comment.
CI is failing on some formatting and linting on this notebook
| "# /// script\n", | ||
| "# requires-python = \">=3.12\"\n", | ||
| "# dependencies = [\n", | ||
| "# \"geohash2\",\n", |
There was a problem hiding this comment.
geohash2 is 10 years old: https://github.com/dbarthe/geohash/
Can we use another more modern geohash library like https://pypi.org/project/pygeohash/?
| "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", |
There was a problem hiding this comment.
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.
Thank you for the review. Let me know if any changes are needed. |
This PR adds an example demonstrating the Geohash Layer. Reference: #1232