Ivan Mincik has created a pgAdmin plugin that works as a command-line PostGIS viewer as well. The viewer could be useful for spatial databases administrators using pgAdmin.
It is not intended to add major functionalities to the viewer, but if it is required, it could be extended with all the power of Python and QGIS libraries. The PostGIS Viewer allows to display spatial tables and views from spatial databases.
Python, PyQt4, PyQGIS and libqt4-sql-psql.
For Ubuntu/Linux download the postgis_viewer.py file.
HOW TO USE THE VIEWER FROM A COMMAND LINE
Ubuntu/Linux: Set the execution permission:
Run the Python file setting some parameters:
If you run the command once more with another table, it will be loaded to the same application:
Be sure you have the QGIS libraries enabled and run in a command line:
INSTALLATION AS A pgAdmin PLUGIN (PostgreSQL 8.4)
Copy the postgis_viewer.py file into one of the folders of the environment variable PATH, for instance, /usr/bin/
Set the execution permission:
Copy the next lines to /usr/share/pgadmin3/plugins.ini (if the file does not exist, you have to create it):
Copy the postgis_viewer.py and postgis_viewer.bat files to C:/Archivos de programa/PostgreSQL/8.4/bin/
Edit C:/Archivos de programa/PostgreSQL/8.4/pgAdmin III/plugins.ini adding the following lines:
The postgis_viewer.bat file sets the OSGeo4W environment variables (Qt, Python, QGIS) to allow the execution of postgis_viewer.py The .bat file assumes OSGeo4W is installed in C:/ and PostgreSQL can be found in C:/Archivos de programa/PostgreSQL/8.4/ You should check that file if you get some troubles while running the plugin.
NOTE: The steps are based on PostgreSQL 8.4 and pgAdmin 1.10.
- Ivan Mincik's PostGIS Viewer: https://github.com/imincik/QgsPostGIS-Viewer
- Send and receive a signal between 2 Qt applications: http://www.qtcentre.org/threads/38453-Send-and-receive-a-signal-between-2-Qt-applications.?p=176716#post176716
- Single Application: http://www.qtcentre.org/wiki/index.php?title=SingleApplication