shp2pgsql

Shape Loader Tool

An included shp2pgsql tool is available if you installed Webmin.

There are 2 options for loading ESRI Shape files:

  1. Load using the Shape File Loader.
  2. Load using command line.

Load via Shape File Loader

Click the Shape File Loader tab as shown below

../../_images/shp2pgsql-tab.png

The load options are displayed below.

../../_images/shape-loader.png

Also select if load will be into a new Schema and, in the case of New Table creation, the table name to be created.

Load Options

Database: select the database you wish to load the shape file to.

Load Type: Create, Drop, Append, or Prepare

Set SRID: Defaults to 0 if not set

Database Username: Select the user who will own the data

Schema: Select an existing schema or create a new schema.

Table: Select an existing table or create new one

Shape File Source: Local, Upload, or FTP/HTTP

Load via Comamnd Line

Usage

shp2pgsql usage can be found using the ‘shp2pgsl’ command.

Troubleshooting

If the above commands produce ‘shp2pgsql command not found’, do the following:

On Ubuntu:

1
root@postgis:~# apt install postgis

On CentOS

1
root@postgis:~# yum install postgis3_utils

Documentation

Below are resources to get started with ogr2ogr and gdal_translate: