Skip to content

Conversation

@Mehak3010
Copy link

Fixes #177

This PR adds a PostGIS integration guide for SedonaDB.

The documentation is written as a Jupyter notebook and rendered to Markdown
using the existing docs build pipeline.

The page covers:

  • A GeoPandas-based workflow for simplicity and exploratory use
  • A high-performance ADBC-based workflow using adbc_ingest() and fetch_arrow()
    to avoid row-wise iteration and intermediate Pandas DataFrames

This PR only updates documentation and does not modify any source code.

@paleolimbot
Copy link
Member

Thank you for opening!

I see a few CI issues (pre-commit run --all-files should take care of the formatting; you'll have to add a comment to the first cell of your notebook with a license for the other. You should be able to copy this pattern from one of the other notebooks.

I'm sorry I didn't get to this today...I will take a look Monday!

@Mehak3010
Copy link
Author

Thanks for the review and for the pointers!

I’ll add the Apache license header to the first cell of the notebook (following the pattern from the existing docs) and run pre-commit run --all-files to address the formatting issues.

I’ll push the updates shortly — thanks, and no worries at all. Looking forward to your review on Monday!

@Mehak3010
Copy link
Author

I’ve added the Apache license header to the first cell of the notebook and addressed the formatting concerns. The updates are pushed.
Looking forward to your review—thanks!

Comment on lines +51 to +54
> Note:
> SedonaDB is not currently distributed via PyPI.
> To run the SedonaDB examples in this notebook, you must install SedonaDB
> from source or use a development environment where SedonaDB is available.
Copy link
Member

Choose a reason for hiding this comment

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

You can remove this part (SedonaDB is distributed via PyPI)

Comment on lines +57 to +77
## PostGIS Setup

Keep SQL static(do NOT execute).

### Preparing a PostGIS table

```md

The following SQL creates a simple PostGIS table that SedonaDB can read.

```sql
CREATE TABLE my_places (
id SERIAL PRIMARY KEY,
name VARCHAR(100),
geom GEOMETRY(Point, 4326)
);

INSERT INTO my_places (name, geom) VALUES
('New York', ST_SetSRID(ST_MakePoint(-74.006, 40.7128), 4326)),
('Los Angeles', ST_SetSRID(ST_MakePoint(-118.2437, 34.0522), 4326)),
('Chicago', ST_SetSRID(ST_MakePoint(-87.6298, 41.8781), 4326));
Copy link
Member

Choose a reason for hiding this comment

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

Instead of leaving this as unexecuted, I think it would be better to (1) use the built-in PostGIS container we have in the repo (you can start it via docker compose up --detach) and (2) start the tutorial by writing a simple GeoDataFrame into PostGIS. That way when this tutorial needs editing somebody else can easily recreate the data required.

Comment on lines +110 to +113
sd = sedona.db.connect()
df = sd.create_data_frame(gdf)
df.show()
df.schema
Copy link
Member

Choose a reason for hiding this comment

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

I think outputs like df.show() and df.schema should be shown. If you implement the suggestion about making the notebook reproducible above, it should be easy to execute all cells in the notebook and have the output rendered automatically.

Comment on lines +199 to +201
```python
df.head(5).show()
```
Copy link
Member

Choose a reason for hiding this comment

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

This is another output that would be great to show.

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.

epic: new docs pages

3 participants