PostGIS based transport supply framework.
Warning
This package is in an early stage of development so features may change or be removed. If using this package it is recommended to set a specific version and check before upgrading to a new version.
Install PostGreSQL server locally and connect to the database, it should be accessible within pgAdmin with:
- Host: localhost
- Port: 5432
Install PostGIS database extensions with Application Stack Builder (search in Start Menu), tick setup postgresql server and install GDAL.
- Open Application Stack Builder (search in Windows Start Menu)
- Select your local database server
- Select Spatial Extensions > PostGIS 3.6
- Download extensions to your downloads folder, then click next to start installation
- Click through the PostGIS installation window
- Enable "Create spatial database" to create a sample database in your local server
- Enable "Enable All GDAL Drivers"
Once extensions are installed, enable them in the database, with the following SQL queries.
CREATE EXTENSION postgis;
CREATE EXTENSION pgrouting;- Open the Data Source Manager in QGIS (Layer > Data Source Manager)
- Add a new PostgreSQL connection:
- Name: whatever you like
- Host: localhost
- Port: 5432
- Database: name of the database to connect to
- Add an authentication configuration with the username and password to connect to your local database, should just be a "Basic authentication".
- Click "Test Connection"
- Open DB Manager (Database > DB Manager) to check your new database connection is visible and use it to view / import tables from the database directly into QGIS.
QGIS comes with some command-line tools for interacting with PostGIS, GDAL and others, these are contained
within the QGIS install location in a bin sub-folder usually C:\Program Files\QGIS {version}\bin. The QGIS bin
folder might want to be added to the PATH environment variable by either:
- Add the folder to the account level PATH environment variable (not recommended as it can cause issues with other packages)
- Set the PATH environment variable within a single command-line instance with
set PATH="C:\Program Files\QGIS {version}\bin";%PATH%
Warning
Other tools / packages which use GDAL (e.g. geopandas, fiona) can be unusable if the QGIS bin folder is added to the account wide PATH environment variable.