How to write a (memory) layer from QGIS to PostGIS?

المشرف العام

Administrator
طاقم الإدارة
I am looking for an "elegant" solution to write, from a python script, a layer from qgis and into a new table of a PostGIS database. I thougth that this might be solved by QgsWriteVectorLayer, but I could not find any hint that this is supported. I only found the solution that this can be done e.g. with Qtsql, but then one has to:

  1. analyse the layer (field names, field datatypes, srid, ... )
  2. create the table and
  3. fill the table with date.
Question: Does pygis offers a "simple" solution to write a complete layer directly into a new PostGIS table?



أكثر...
 
أعلى