Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a rather basic PostGIS viewer. It should be possible to pan, zoom and retrieve coordinate information on mouse click. No need to support coordinate transformations. It should introduce as little further dependencies as possible. Preferably written in C++.

share|improve this question
2  
OpenJUMP is good for that. Install from snapshots sourceforge.net/projects/jump-pilot/files/OpenJUMP_snapshots or release version 1.8 from sourceforge.net/projects/jump-pilot/files/OpenJUMP/1.8.0. Use File - Run datastore query and write any valid SQL query into the box. BTW Oracle is also supported through DB Query plugin which is included in OJ Plus, but you must add Oracle driver ojdbc.jar yourself because of license restrictions. – user30184 Dec 2 '15 at 10:15
up vote 11 down vote accepted

Although this isn't really the direct answer to your question, qgis acts as a relatively simple GIS viewer which can access PostGIS. In addition to the main application -- which is a relatively complex piece of software -- the core of the qgis library can be 'pulled out' and used from an application written in C/C++ or (I believe, with some work) Python.

Tim Sutton's post on the topic of building minimal qgis widgets is probably a good starting place for this. In order to build a simple widget for viewing a layer, the C code is only 63 lines, including headers + other boilerplate.

share|improve this answer
    
Thanks, I'll investigate "pulling out" QGIS core. If it works, that would be great. – underdark Oct 16 '10 at 23:03
    
Fur future reference: Tim S. pointed me to this example in SVN trunk: svn.osgeo.org/qgis/trunk/code_examples/1_hello_world_qgis_style – underdark Oct 17 '10 at 8:59
    
Which is linked from the post he made, in the 'instructions on how to do this': "This example can be checked out of subversion, compiled and run using cmake like this:" ... – Christopher Schmidt Oct 17 '10 at 23:34

try SharpMap. Not written in C++ but in C#. Maybe it could be some use to you.

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

    
+1 for the nice link. Didn't know this existed. – ChristopheD Oct 19 '10 at 22:34

QGIS started out as a viewer for PostGIS, and is now a full blown open source GIS. From QGIS there is a very close integration with PostGIS enabling dynamic views, updateable views and a DB manager for working with spatial data building and running queries. Styles for your data can also be saved in PostGIS. Default styles can be set, so when you or another user opens a layer from scratch a default style is applied.

DB Manager: enter image description here

SQL query builder: enter image description here

share|improve this answer

try this link but its in vb.net
http://hilary-mushonga.blogspot.com/p/building-postgis-layer-viewer.html

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

1  
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – iant Aug 15 '12 at 10:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.