Skip to end of metadata
Go to start of metadata

Quantum GIS

http://www.qgis.org/

Quantum GIS (QGIS) is a user friendly Open Source Geographic Information System ( GIS ) licensed under the  GNU General Public License . QGIS is an official project of the  Open Source Geospatial Foundation  (OSGeo). It runs on Linux, Unix, Mac OSX, Windows and Android and supports numerous vector, raster, and database formats and functionalities.

Table of Contents

 

To connect to PostGIS Database

 

  1. Click on the Add PostGIS Layer button
  2. Click on "New" to add a new connection.
  3. Give it a Name, set the Host to the db server URL, the Database name, the Username and Password
  4. Click Test Connection to verify it works
  5. Click OK to save the connection.
  6. Click Connect to list the tables in the Database.
  7. Select the table you are interested in, then click Add to add it to the map.

Editing Data

  1. Select the layer to edit
  2. Toggle on the editing Mode
  3. Click the Save Edits button to save
  4. Toggle off the editing mode

or

  1. Select the layer to edit
  2. Click on the Open Attribute Table icon 
  3. Toggle on the Editing Mode
  4. Double click on the cells to edit

Layer Styles

To choose which editing widgets get used for editing field values:

  1. Display the Layer's Property window (double-click the layer)
  2. Select the Fields tab
  3. For each field, click on the Edit Widget to change how the values are edited (line editor, value sliders, etc)

Test Case

  1. Create Points Table and Lines Table
  2. Add new points, set attributes
  3. Create new lines, set attributes
  4. Output a custom formatted .CSV file
  5. Run the GAMS/CPLEX computation
  6. Load the results .csv back into QGIS
  7. Stylize the results layer.

 

 

1. Create Points Table and Lines Table (Using the PostGIS Manager plugin)

  • Create Points Table
    • Schema: "public"
    • Enter Name
    • Add Field: "OID", Type: "serial"
    • Primary Key: "OID"
    • Create Geometry Column: POINT. Name: "geometry"
    • SRID: "4326"
    • Create spatial index: "true"
    • Add columns as needed
  • Create Lines Table
    • Schema: "public"
    • Enter Name
    • Add Field: "OID", Type: "serial"
    • Primary Key: "OID"
    • Create Geometry Column: LINESTRING. Name: "geometry"
    • SRID: "4326"
    • Create spatial index: "true"
    • Add columns as needed

2. Add new points, set attributes

  • See " To connect to PostGIS Database " to add new PostGIS layer
  • Select the Points Layer in the "Layers" window
  • Click on "Toggle Editing"
  • Click on "Add Feature" 
  • Left-Click on the display to add a new Point
  • In the "Attributes" popup window, leave the "OID" field alone, set the other fields as needed
  • Click on the "Toggle Editing" to quit editing and save the changes to the database

3. Create new lines, set attributes

  • See " To connect to PostGIS Database " to add new PostGIS layer
  • Select the Line Layer in the "Layers" window
  • Click on "Toggle Editing"
  • Click on "Add Feature" 
  • Left-click on the display to begin creating the line. Continue left-clicking to add more segments. Right-click to stop the line.
  • In the "Attributes" popup window, leave the "OID" field alone, set the other fields as needed
  • Click on the "Toggle Editing" to quit editing and save the changes to the database

 

Tips

To Reload a plugin via the Python Console:

qgis.utils.reloadPlugin('myplugin')

To Display Map Data (e.g., Google, Bing) in the Background Layers

  • Plugins->Fetch Python Plugins...
  • Filter for the "OpenLayers Plugin"
  • Select and Install
  • Then from the Plugins menu bar, select "Open Layers Plugin" and choose your layer type

Plugin Development

Tutorial example

QGIS Plugins

Custom Attribute Window UI

Use the Plugin Builder Plugin for easy creation of plugins

0%

To Do's

  1. handler

    Invistigate PostGIS Manager Plugin table versioning.

    Priority MEDIUM
    rejohnso
    Apr 04, 2013

 

 

  • No labels