[Qgis-user] Storing data to postgis from Qgis

Brent Wood pcreso at pcreso.com
Tue Dec 30 00:45:52 PST 2014


Hi David,
I'm not sure why you are trying to do that from QGIS, given you can do it all from Postgis directly, especially given your data is already in a database, without the mapping/GUI overhead... nothing you have suggested as a means of selecting data subsets requires QGIS. 

However, as I read it, at least some of what you are trying to do could also be done via a QGIS action, as a system call with SQL statements & data parameters, especially with known table names, etc.
Brent Wood

     From: David Kramer <davidk at gmail.com>
 To: Leknín Řepánek <godzilalalala at gmail.com> 
Cc: qgis-user <qgis-user at lists.osgeo.org> 
 Sent: Tuesday, December 30, 2014 6:10 PM
 Subject: Re: [Qgis-user] Storing data to postgis from Qgis
   
Leknin, 
Thanks for the reply. I've followed your recipe and indeed I can paste my selected features as a new memory layer (thanks Jan) and then import the layer via db manager into postgis. This is tremendously useful, but is not quite what I'm looking for.
I don't really want to create a new table, I really want to just select a few fields out of my newly selected layer and save those as a row in an already created table. For example, let's assume I have a table that lists franchises the states that they do business in and the columns:
'Franchise Name'    |  'States'             | 'geom'===================================Alice's Restaurant   | "NY, NJ, PA"    |   ...
Joe's Burgers          |  "CA, NV, OR"  |   ...
To add a new row to the table I'd like to go into qgis, select the states for a franchise (from a layer of states), save that as a memory layer. Then I'd like to have a save function which allows me to enter the franchise name. It would save only the name, the states and the geometry as a row in the table. 
Make sense? Is this possible from the GUI or do I need to write a plugin in pyQGIS?
Thx

David
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20141230/ceddb304/attachment.html>


More information about the Qgis-user mailing list