[GIS] How to save data from QGIS 1.8 to PostGIS without shapefile intermediate

importpostgis-2.0qgis

Is it possible to save data directly into an existing PostGIS database from QGIS without having to first save it as a shapefile? I know about the SPIT plugin but that requires a shapefile. I want to know if is there a way to skip the save-to-shapefile-use-SPIT/shapefile-loader-to-import-to-Postgis process after an analysis in QGIS.

Edit:
Example: Load road layer from PostGIS to QGIS. Calculate shortest path using road graph plugin and export as temporary (temp) layer. Right click on temp layer, select save as… the save as options include the general vector type files (shapefile,GeoJSON) and at the bottom of the list is an option to save as a spatiallite database. This, unfortunately, only creates a new spatiallite database with only the one shortest path road layer (no postgis option). What I would like to know is, is it possible to save a temp file directly into an existing PostGIS database?

Best Answer

If you have your data in a QGIS layer, and a separate layer from a postgis table visible, you can always

  • zoom to the extent of the QGIS layer
  • select all features with a rectangle
  • make the postgis layer editable
  • Edit -> Insert the objects
  • Save the postgis layer
  • Toggle Edit mode of the postgis table off
Related Question