What is PostGIS?
PostGIS is software that stores additional spatial data to geographic objects through the PostgreSQL database. It operates as a “light-weight” software with geometries and indexes that use less memory. It also includes additional features such as Oracle Locator/Spatial and SQL Serve. To see more features included click here.
PostgreSQL draws its origins from Ingres Database (INteractive GRaphics REtrieval System) which was developed to support commercial and government applications. The name refers to it being "post-ingres." (See Ingres (database) for more information).
A PostGIS layer is stored in a PostgreSQL database and helps you to include more information to support GIS objects. This system allows you to identify work more accurately than with adding vector layer in QGIS.
This tutorial is for QGIS version 2.0.1 Dufor on a Mac
To use a PostGIS layer, you must have PostGIS installed and connected to a PostgreSQL database.
To install PostgreSQL and PostGIS:
- Go to the PostgreSQL website and click “Download” then select your operating system version (Mac OS). Or click here
- Click the “Download” link for the “Graphical installer”
- On the latest download version (at the top of the screen), select your operating system version (Mac OS) and save the file.
- PostgreSQL will download as a .zip file. To unzip and use it, double click on the .zip file, and then double click the “postgresql…” to open the program.
- Follow the Setup Wizard, providing when prompted a password of your choice (you will use this password in the future, so write it down), the provided Port number (5432), and the Default Locale.
- When it has finished downloading, click “Okay” with the Stack Builder box checked. In the dropdown box, select the “PostgreSQL” option.
- Under the categories list, select arrow to view the “Spatial Extension” category, and check the box for “PostGIS” and click “Next”
- It will now direct you to install “PostGIS.” When promted for a password, use the password you created before on the PostgreSQL Setup Wizard. Continue as directed, and click “Finish” when completed.
- To check that you installed it correctly, go to your Applications menu and select the “PostgreSQL” folder, then click “pgAdmin III” (with the poorly drawn elephant image.)
- On the “pgAdmin” window that appears, double click the “PostgreSQL” option on the Object browser menu (under Server Groups > Servers > PostgreSQL), and a dialog box prompting you to enter your password will appear.
- Enter your password. Use the dropdown menu under “PostgreSQL” to access PostGIS by selecting the arrows next to Databases > template_postgis > Schemas > public > Functions. This will give you access to all of the PostGIS spatial functions.