Search code examples
postgis

Postgis - How to get the GUI to work?


I started working with PostGIS in Action. The book shows a bunch of neat graphics created from various queries, but there is no mention of how to get these graphics to show up. The queries are working fine.

All of the tutorials I have found online appear outdated, suggesting, for example, to install plugins that are no longer available. I know I'm missing something obvious, but I have no idea what it would be.

I'm using Windows 7, PostgreSQL 9.3, PostGIS 2.1.

UPDATE

Thanks a lot guys. I settled on QGIS and it works as promised. So hard to pick either answer as they are both brilliant and informative.


Solution

  • There is no built-in GUI for Postgis queries. You have a number of options:

    1. Connect to Postgis directly from QGIS or other GIS package that supports direct connections.
    2. Use ogr2ogr utility to convert to another format such as shp or kml and use ArcGIS, Google Earth, etc to visualize the results.
    3. Write the results out as WKT (well-known text) or GeoJSON and load them into a web mapping library such as OpenLayers. There is an example of a WKT reader here: OpenLayers WKT example. GeoJSON is a format that has gained a lot of traction, as it is very amenable to manipulation in Javascript and hence mapping libraries such as OpenLayers or Leaflet.

    If you decide to use the ogr2ogr route, here is a cheat sheet provided by the authors of the Postgis book: http://www.bostongis.com/PrinterFriendly.aspx?content_name=ogr_cheatsheet

    I am sure there are other options, but these are the ones that sprung to mind.