petern48 commented on issue #289:
URL: https://github.com/apache/sedona-db/issues/289#issuecomment-3587032015

   Wrote this up for a contributor's PR. It's kinda long to add to the 
contributor-guide.md, but we can shorten it or maybe add it under a toggle if 
that's possible (I'm not sure for the web version).
   
   
   Here's a useful tip to help with your local development: Here's how you can 
execute queries on PostGIS Docker container
   
   1. Start the postgis docker container (for you knowledge it runs this 
[compose.yml](https://github.com/apache/sedona-db/blob/16d232be0f28441b85801936b270fa43f7edceb4/compose.yml#L4)
 file.
   ```
   docker compose up -d
   
   # output:
   [+] Running 1/1
    ✔ Container sedona-db-postgis-1  Running0.0s
   ```
   
   2. Assuming it spun up properly, Now you can exec into that to enter the 
Postgres / PostGIS shell using the container name. It's usually the same for 
everyone `sedona-db-postgis-1`.
   ```
   docker exec -it sedona-db-postgis-1 psql -U postgres
   
   # output:
   psql (18.0 (Debian 18.0-1.pgdg13+3))
   Type "help" for help.
   
   postgres=# 
   ```
   
   Now you can execute queries locally against PostGIS (which is a correct 
solution we model SedonaDB after).
   ```
   postgres=# SELECT ST_NumInteriorRings(ST_GeomFromText('POLYGON ((0 0,6 0,6 
6,0 6,0 0), (2 2,4 2,4 4,2 4,2 2))'));
   
   -- output:
    st_numinteriorrings 
   ---------------------
                      1
   ```


-- 
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]

Reply via email to