Skip to content

Commit

Permalink
Merge pull request #1527 from henrykironde/postgis-docs
Browse files Browse the repository at this point in the history
Update create CREATE EXTENSION postgis
  • Loading branch information
ethanwhite committed Dec 16, 2020
2 parents 020e8ac + 178fb14 commit 9e596ea
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
4 changes: 3 additions & 1 deletion docs/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ Check the services' home pages in case you have to add the same capabilities to
links `Read The Docs`_, `codecov`_, `AppVeyor`_ and `Travis`_

To run the tests you will need to have all of the relevant database management systems and associated
modules installed (see ``Setting up servers``). Create the appropriate permissions for the tests to access
modules installed (see ``Setting up servers``). For PostgresSQL installation refer to `Spatial database setup`_.
Create the appropriate permissions for the tests to access
the databases. You can do this by running the following commands in MySQL and
PostgreSQL and creating the .pgpass(pgpass.conf for Microsoft Windows) file as described below:

Expand Down Expand Up @@ -416,3 +417,4 @@ Use ``-f`` flag to force pushing changes to the branch. ``git push -f origin [br
.. _installing the wheel: http://www.lfd.uci.edu/~gohlke/pythonlibs/
.. _setup tools: https://pythonhosted.org/an_example_pypi_project/setuptools.html
.. _Data Retriever repository: https://github.com/weecology/retriever
.. _Spatial database setup: developer.html#Spatial-database-setup
28 changes: 21 additions & 7 deletions docs/spatial_dbms.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
=======================
Spatial database set up
=======================
======================
Spatial database setup
======================

Supporting installation of spatial data into `Postgres DBMS`.

1. **Install Postgres**

To install `Postgres` from scratch please ref to `Postgres installation`_.
For Mac the easiest way to get started with PostgreSQL is with `Postgres.app`_.

For Debain and Ubuntu, install `PostgresSQL and PostGis` please ref to `Postgres installation`_.

Otherwise you can try package installers for WINDOWS, MAC, Linux and MacOS from the main `PostgreSQL download`_ page

For simplicity, use `.pgpass` file(`pgpass.conf` file for Microsoft Windows) to avoid supplying the password every time
as decribed in `Passwordless configuration`_.

Expand All @@ -17,7 +22,7 @@ Supporting installation of spatial data into `Postgres DBMS`.

**For example, this could be a sample of paths exported on Mac:**

.. code-block:: sh
.. code-block::
#~/.bash_profile file, Postgres PATHS and tools .
export PATH="/Applications/Postgres.app/Contents/MacOS/bin:${PATH}"
Expand All @@ -30,21 +35,30 @@ Supporting installation of spatial data into `Postgres DBMS`.
This is done by using either `Postgres CLI` or `GUI(PgAdmin)` and run
**For psql CLI**

.. code-block:: sh
.. note::
PostGIS excluded the raster types and functions from the main extension as of version 3.x;
A separate CREATE EXTENSION postgis_raster; is then needed to get raster support.

Versions 2.x have full raster support as part of the main extension environment,
so CREATE EXTENSION postgis; is all that you need`

.. code-block::
psql -d yourdatabase -c "CREATE EXTENSION postgis;"
psql -d yourdatabase -c "CREATE EXTENSION postgis_topology;"
**For GUI(PgAdmin)**
.. code-block:: sql
.. code-block::
`CREATE EXTENSION postgis;`
`CREATE EXTENSION postgis_topology`
For more details refer to the `Postgis docs`_.


.. _PostgreSQL download: https://www.postgresql.org/download/
.. _Postgres.app: https://postgresapp.com/
.. _Postgres installation: https://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21UbuntuPGSQL93Apt
.. _Postgis docs: https://postgis.net/docs/postgis_installation.html#install_short_version
.. _Passwordless configuration: developer.html#passwordless-configuration

0 comments on commit 9e596ea

Please sign in to comment.