Gshp2pgsql Manual

Steffen Macke

<Steffen_Macke@sdteffen.de>

Copyright © 2007, 2008 Steffen Macke

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available from the Free Software Foundation (http://www.gnu.org).

$Date: 2008-09-26 07:05:32 +0200 $

Table of Contents

General
1. Introduction
1.1. What's New?
1.1.1. Version 0.4.1
1.1.2. Version 0.4.0
1.1.3. Version 0.3.0
1.1.4. Version 0.2.0
1.1.5. Version 0.1.0
2. Requirements
3. Installation
3.1. Installation Using the Installer
Reference
1. Usage
1.1. Additional Scripts
2. Configuration
2.1. Environment Variables
3. Windows Explorer Integration
4. Commandline Usage
5. Troubleshooting
6. Security
7. Development
7.1. Release Process
Index


General

Table of Contents

1. Introduction
1.1. What's New?
1.1.1. Version 0.4.1
1.1.2. Version 0.4.0
1.1.3. Version 0.3.0
1.1.4. Version 0.2.0
1.1.5. Version 0.1.0
2. Requirements
3. Installation
3.1. Installation Using the Installer


1. Introduction

1.1. What's New?
1.1.1. Version 0.4.1
1.1.2. Version 0.4.0
1.1.3. Version 0.3.0
1.1.4. Version 0.2.0
1.1.5. Version 0.1.0

Gshp2pgsql provides a graphical interface to upload shapefiles to PostGIS databases.

Gshp2pgsql is available from http://polylinie.de/gshp2pgsql/. It is free software released under the terms of the GPL license - the full source code is available (Open Source).

This manual describes Gshp2pgsql version 0.4.1.


1.1. What's New?

1.1.1. Version 0.4.1
1.1.2. Version 0.4.0
1.1.3. Version 0.3.0
1.1.4. Version 0.2.0
1.1.5. Version 0.1.0

A summary of changes in the different versions of the AV PostGIS Extension.


1.1.1. Version 0.4.1

Bug fix on Windows: Include missing gspawn-win32-helper.

openSUSE RPM have been added.


1.1.2. Version 0.4.0

The interface has been translated to German.

Bug fixes and robustness improvements.

The Windows installer now comes with a bundled GTK+ version. This avoids compatibility problems and makes the installation easier.

Library updates: GTK 2.14.2, PostgreSQL 8.3.4, PostGIS 1.3.3.

For developers: Improved build process using autotools.


1.1.3. Version 0.3.0

Bugfix: Host and port are now passed to psql.


1.1.4. Version 0.2.0

Added the possibility to specify the shapefile name on the commandline and the Windows Explorer context menu for shapefiles.


1.1.5. Version 0.1.0

  • The first public release.


2. Requirements

GTK+ version 2.6 or higher is required in order to use the Gshp2pgsql. The Windows installer includes GTK+.

A PostgreSQL database with the PostGIS extension is required.


3. Installation

3.1. Installation Using the Installer

How to install Gshp2pgsql.


3.1. Installation Using the Installer

How to install the Gshp2pgsql using the installer (on Windows).

Download the installer and execute it.


Reference

Table of Contents

1. Usage
1.1. Additional Scripts
2. Configuration
2.1. Environment Variables
3. Windows Explorer Integration
4. Commandline Usage
5. Troubleshooting
6. Security
7. Development
7.1. Release Process


1. Usage

1.1. Additional Scripts

Run the program.

Fill in the required information.

Click on the OK button.

Review the message.

[Caution] Caution

Gshp2pgsql will create a new file with the same base name as the shapefile and the extension ".sql".


1.1. Additional Scripts

Gshp2pgsql allows to run SQL scripts before and after the shapefile is loaded.

[Tip] Tip

This allows e.g. to drop views that depend on a table that will be recreated by the loader and recreate the views immediately after the data was loaded.


2. Configuration

2.1. Environment Variables


2.1. Environment Variables

A number of standard PostgreSQL environment variables are used by Gshp2pgsql, if they are set:

PGPASSWORD
PGHOST
PGPORT
PGDATABASE
PGUSER


3. Windows Explorer Integration

The installer installs a Windows Explorer context menu that allows to load shapefiles (*.shp) to PostGIS.

To use this functionality, do the following:

  1. Open the Windows Explorer

  2. Click with the right mouse button on a shapefile.

  3. Select Load to PostGIS from the context menu.


4. Commandline Usage

Gshp2pgsql accepts the shapefile name as a commandline argument.

      gshp2pgsql [shapefile]


5. Troubleshooting

Please report problems through the AVPGCon trackers.

Please include the full contents of the three output fields (commandline, output, errors).


6. Security

[Caution] Caution

Gshp2pgsql stores the password temporarily in an enviroment variable. If this is not secure enough for you, please do not use Gshp2pgsql.


7. Development

7.1. Release Process

The version number shall be derived from the packaged PostGIS version plus an additional digit for the actual extension.

PostgreSQL releases with security fixes trigger new Gshp2pgsql releases.


7.1. Release Process

Update the version number in build.xml, installer/win32/gshp2pgsql.nsi and doc/en/gshp2pgsql.xml.