8

Is there anywhere available shp2pgsql binaries for windows without installing the whole PostGIS? I particularity need the command line version of that import tool.

I would like to share a batch script that uses the shp2pgsql.exe to my co-workers but don't know how to share the shp2pgsql.exe. Could I just copy that file from my postgres/bin folder? I suppose that then I need at least libpg.dll. How about other files (libgdal-1.dll, libproj.dll)?

6
  • may be useful for you comments.gmane.org/gmane.comp.gis.postgis/3080 – Sunil Feb 6 '13 at 8:27
  • Thanks @Sunil, but didn't help. That thread was from 2004 and linked to unknown zip file that doesn't exists. And ogr2ogr doesn't work in my case. – LauriK Feb 6 '13 at 9:43
  • We are researching on your issue..and let you know soon – Sunil Feb 6 '13 at 9:45
  • 1
    Its working @ my end download.osgeo.org/postgis/windows – Sunil Feb 6 '13 at 9:49
  • 1
    Use depend.exe to find what libraries it depends on. I think libconv might be the only one. – Paul Ramsey Feb 7 '13 at 19:44
13

Answering to my own question based on help from @Sunil and @Paul.

Shp2pgsql.exe is available in binary download from http://download.osgeo.org/postgis/windows. It comes with a lot of unnecessary files. Only libiconv-2.dll in needed.

To be able to load shapes to PostGIS also the psql.exe is needed. It comes with pgAdmin installation. It depends on libpq.dll, libintl.dll and ssleay32.dll.

1
  • 1
    Thanks, small update for the current version of shp2pgsql. Additional files required: libgcc_s_seh-1.dll, libgeos.dll, libgeos_c.dll, libproj-9.dll, libstdc++-6.dll. Also libintl.dll is now libintl-8.dll. – Konrad Mar 14 '16 at 12:01
5

Not sure how long it's been available, but if you download the ZIP bundle from the link above, it contains a GUI for the Shapefile <--> PostGIS import/export in \bin\postgisgui.

Works like a charm, and no installation required!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.