PostGIS — GIS (Geographic Information Systems) objects (that is, spatial and geographic objects) for QHB
PostGIS extends the capabilities of the QHB relational database by adding support for storing, indexing, and querying geospatial data.
PostGIS features include:
- Spatial Data Storage: Store different types of spatial data such as points, lines, polygons, and multi-geometries, in both 2D and 3D data.
- Spatial Indexing: Quickly search and retrieve spatial data based on its location.
- Spatial Functions: A wide range of spatial functions that allow you to filter and analyze spatial data, measuring distances and areas, intersecting geometries, buffering, and more.
- Geometry Processing: Tools for processing and manipulating geometry data, such as simplification, conversion, and generalization.
- Raster Data Support: Storage and processing of raster data, such as elevation data and weather data.
- Geocoding and Reverse Geocoding: Functions for geocoding and reverse geocoding.
- Integration: Access and work with PostGIS using third party tools such as QGIS, GeoServer, MapServer, ArcGIS, Tableau.
PostGIS Pack Installation
The PostGIS extension is available as package qhb-1.5.3-postgis.
PostGIS installation requires installed QHB with initialized database cluster. Refer to relevant section of this documentation (see Step-by-step Guides for Initial Download, Installation, and Launch) for information regarding QHB installation and configuration.
Add QHB package repository and install the extension package for chosen platform from the download page.
Installing PostGIS in QHB cluster
After installing PostGIS package you can install the extension for the database being used.
To install the extension, connect to the database via any tool and execute:
CREATE EXTENSION postgis;
To confirm PostGIS install is successful, execute this command:
SELECT postgis_full_version();
QHB optimization for PostGIS
QHB is intended to work with various database. PostGIS database objects are big compared to plain text data. Therefore, it is recommended to optimize QHB for better processing of PostGIS objects.
You can optimize QHB server by editing qhb.conf file. Change the following settings depending on your system's RAM:
# This value should be approximately 75% of your server's RAM.
shared_buffers = 1500M
# It allows QHB to cache more data in memory while sorting
work_mem = 64MB
# A checkpoint is a periodic operation that stores information about your system
checkpoint_segments = 6
# Essentially this parameter is the amount of time your optimizer should spend for storage reads before accessing your disk.
random_page_cost = 2.0
When finished, save and close the file. Than restart the QHB service so that the changes to take effect.
systemctl restart qhb
Note
See PostGIS official website for the detailed information about working with the extension, as well as documentation for it.