pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.26k stars 611 forks source link

Add Utility to Import/Export Shapefiles #7519

Open anthonydb opened 1 month ago

anthonydb commented 1 month ago

Describe the solution you'd like

The PostGIS extension allows users to import ESRI shapefiles into tables. However, the process for doing so is inconsistent across platforms. On Windows, PostGIS includes a shapefile import/export manager application. But that application isn't available on macOS and Linux, which means users must run the shp2pgsql command-line utility, which is cumbersome due to the multiple arguments it requires.

Given that pgAdmin already allows users to import CSV and text files to tables by running COPY in the background, it would be nice if pgAdmin did similar by providing a GUI interface for shp2pgsql. Given that pgAdmin includes a helpful GIS viewer, this would make pgAdmin even more useful for GIS developers.

Describe alternatives you've considered

Can continue to use existing methods on Windows and macOS.

Additional context

I may be mistaken but I believe pgAdmin 3 had a plugin for this purpose.

This is a screenshot of the PostGIS shapefile loader, which is available for Windows but not macOS or Linux:

Screenshot 2024-05-30 at 9 01 20 PM

PgAdmin would need to detect whether a database has the PostGIS extension installed and thus has access to shp2pgsql.

robe2 commented 4 weeks ago

FYI we have that on the PostGIS ticket tracker too https://trac.osgeo.org/postgis/ticket/4358 just haven't had time to invest in it. We were hoping to get a GSOC student to help out on this. and here - https://trac.osgeo.org/postgis/wiki/GoogleSummerCode2022#Idea2:AugmentpgAdmintosupportimportingandexportingshapefiles