[postgis-users] How to add shp2pgsql and pgsql2shp

648 views
Skip to first unread message

Terry

unread,
Dec 3, 2021, 6:48:30 PM12/3/21
to postgi...@lists.osgeo.org
I have a RHEL8 system, with PostgreSQL-13 and postgis_3.1.4.  All seems
to work well.

I wanted to add some shp files, and I was surprised to *not* find the
shp2pgsql and pgsql2shp applications.  My PostgreSQL is installed in
/usr/pgsql-13, and the missing applications are not in /usr/pgsql-13/bin
( nor elsewhere).

What is the preferred method to install shp2pgsql, please?

_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

Greg Troxel

unread,
Dec 3, 2021, 8:14:48 PM12/3/21
to Terry, postgi...@lists.osgeo.org

Terry <terry....@shaw.ca> writes:

> I have a RHEL8 system, with PostgreSQL-13 and postgis_3.1.4.  All
> seems to work well.
>
> I wanted to add some shp files, and I was surprised to *not* find the
> shp2pgsql and pgsql2shp applications.  My PostgreSQL is installed in
> /usr/pgsql-13, and the missing applications are not in
> /usr/pgsql-13/bin ( nor elsewhere).
>
> What is the preferred method to install shp2pgsql, please?

shp2pgsql is part of postgis. The pkgsrc package for 3.1.4 has a ton of
sql files to install uprade, plus:

/usr/pkg/bin/pgsql2shp
/usr/pkg/bin/raster2pgsql
/usr/pkg/bin/shp2pgsql
/usr/pkg/lib/postgresql/postgis-3.so
/usr/pkg/lib/postgresql/postgis_raster-3.so
/usr/pkg/lib/postgresql/postgis_topology-3.so
/usr/pkg/share/postgresql/contrib/postgis-3.1/postgis_restore.pl
/usr/pkg/share/postgresql/extension/postgis.control
/usr/pkg/share/postgresql/extension/postgis_raster.control
/usr/pkg/share/postgresql/extension/postgis_tiger_geocoder.control
/usr/pkg/share/postgresql/extension/postgis_topology.control

You should ask Red Hat why it isn't in the postgis package, after first
looking for some postgis-tools or similar package that has the
command-line tools.
signature.asc

Jeff McKenna

unread,
Dec 4, 2021, 10:29:24 AM12/4/21
to postgi...@lists.osgeo.org
also: ogr2ogr (if GDAL is on your system) is very powerful and works
great with importing into PostGIS.

-jeff

--
Jeff McKenna
GatewayGeo: Developers of MS4W, MapServer Consulting and Training
co-founder of FOSS4G
http://gatewaygeo.com/

Reply all
Reply to author
Forward
0 new messages