paleolimbot commented on code in PR #41:
URL: https://github.com/apache/sedona-db/pull/41#discussion_r2334438684
##########
docs/geopandas-interop.ipynb:
##########
@@ -0,0 +1,211 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "caa5f2d5-28bb-4ce9-8a11-92646b3a9f6c",
+ "metadata": {},
+ "source": [
+ "# GeoPandas interoperability\n",
+ "\n",
+ "This example shows how to read a GeoJSON file with GeoPandas and then
convert the GeoPandas DataFrame to a SedonaDB DataFrame.\n",
+ "\n",
+ "Any file type that can be read by GeoPandas can also be read into a
SedonaDB DataFrame!"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "0434bead-2628-4844-a3f6-2f9c15a21899",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import sedonadb\n",
+ "import geopandas as gpd\n",
+ "\n",
+ "sd = sedonadb.connect()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "618b5d1d-ac2b-4786-ae5b-0d10efd6a8d4",
+ "metadata": {},
+ "source": [
+ "### Read a GeoJSON file with GeoPandas"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "2691bd24-9b2d-4cf9-958d-4ef01d967cb3",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "gdf = gpd.read_file(\"some_data.json\")"
Review Comment:
This would be a more compelling example with a real file.
Maybe:
- Read a .fgb file from an https:// url from https://geoarrow.org/data with
GeoPandas
- Create the SedonaDB DataFrame
There are probably also other compelling GeoJSON examples that can be loaded
from https:// urls (or you could use GeoPandas to write one to demonstrate
interop in the other direction).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]