9

The tutorials I've been seeing such as this one https://saarapakarinen.wordpress.com/2015/06/13/tutorial-creating-a-postgis-database-for-qgis-part-2/

They mention a SPIT plugin that I can't find anywhere even after installing the WIEN version. DB Manager doesn't quite seem to do the same thing as described in the link above

Is there some other plugin to do the job?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Luffydude
  • 2,308
  • 3
  • 18
  • 38

4 Answers4

15

In 2.8 - 2.14 (Not sure about earlier versions) you can export shape files to PostGIS using the build in DB Manager.

  1. Open DB Manager enter image description here
  2. In the list of PostGIS databases find the one you want to export to, find the desired schema and pres the button marked with the red outline. enter image description here
  3. Choose the shape file in 'input' (Has to be in your 'Layers Panel') and press 'ok' enter image description here

That's it. Your shape file is now a table in PostGIS.

EDIT I see that this question has actually already been answered in this link

JonasPedersen
  • 880
  • 1
  • 8
  • 19
  • Thank you, I was trying that but for some reason I wasn't being able to save my shapefile on postgis. Also I saw that link but it involves other stuff while your explanation is more clear and direct – Luffydude May 24 '16 at 13:45
  • Hey Jonas, I've been trying to upload a large file (12Gb) and I tried doing what you just did but QGIS stopped responding, is it uploading or did it crash and fail? – Luffydude May 25 '16 at 15:15
5

There is a tool bundled with PostGIS 2.2:

PostGIS 2.0 Shapefile and DBF Loader Exporter

It allows you to import and export.

Knightshound
  • 4,430
  • 18
  • 39
  • That is a fantastic program! I found it in the official Postgis for Windows bundle here: http://postgis.net/windows_downloads/ – luca76 Apr 07 '17 at 06:38
4

The "SPIT" plugin is no longer bundled with QGIS, as the plugin was unmaintained and has been surpassed by DB Manager and the processing database import algorithms.

changelog.qgis.org/

enter image description here

pigreco
  • 4,460
  • 1
  • 15
  • 32
2

From the bin folder of Postgres, Open CMD and

shp2pgsql -I  -s 4326 -g the_geom(geometry coloumn) FIlepath/filename.shp shema.tablename | psql -h localhost -d datbasename -U username