Questions tagged [pgsql2shp]

Command line tool to export PostGIS tables to shapefiles.

Filter by
Sorted by
Tagged with
0 votes
0 answers
54 views

Stop processes if pgsql2shp/shp2pgsql fails

I have a process where data is extracted from PostgreSQL (PostGIS) to shapefiles. The data is used as input creating new data (shapefiles) through a program outside PostgreSQL. The new data is then ...
Reje's user avatar
  • 1
0 votes
1 answer
386 views

Having problem with pgsql2shp function - get postgis_version() function not found error

I try to use pgsql2shp postgis function to export a table from another schema to .shp format. Base on this link, I run following code pgsql2shp -f "c:/path/to/export/file" -h localhost -u &...
ArashMad's user avatar
  • 655
1 vote
1 answer
191 views

How to execute pgsql2shp from batch file

I am trying to execute pgsql2shp for a remote PostgreSQL db using batch file using the below code for /f %%i in ('psql -U ihadmin -d ih_gis_production -h <xxxxx> -c "select f_table_name from ...
User123's user avatar
  • 2,976
1 vote
1 answer
1k views

Creating a shapefile with SQL Query Using Geotools Hibernate and Java

Here is my context : 1] I have geometries in an postgresql database 2] My application uses JAVA/Hibernate 3] I Currently use Geotools to create a shapefile How I do it ? First i retrieve my ...
Geek Junior's user avatar
5 votes
0 answers
156 views

pgsql2shp issue when using WITH clause

I'm using pgsql2shp.exe from a Windows batch file and I get an error when using a WITH clause: "C:\Program Files\PostgreSQL\9.4\bin\pgsql2shp.exe" [ ... ] "WITH test AS (SELECT gid, the_geom FROM ...
wiltomap's user avatar
  • 2,690
0 votes
0 answers
4k views

pgsql2shp - fe_sendauth: no password supplied

I am at a total loss here. I receive the error fe_sendauth: no password supplied when trying to execute the following pgsql2shp cmd. pgsql2shp -f folders/San Bruno/San Bruno.shp -h localhost -u ...
wtgeographer's user avatar
2 votes
2 answers
2k views

Importing shapefiles to a postgis on a remote server

I have two servers X and Y. X contains a postgis instance whereas Y doesn't have postgis installed, but connects to the postgis instance on X through a connector in nodejs. I want the node script to ...
apricity's user avatar
  • 1,151
2 votes
2 answers
2k views

Incomplete export of data from a Postgres table

I'm having a serious data export problem with the PGAdmin widget and pgsql2shp (QGIS too). The problem lies within converting a PostGIS table to shapefile. I put in 3234 feature counts...and I get ...
user14696's user avatar
  • 497
0 votes
2 answers
489 views

Using pgsql2shp in server code with PostGIS installed on Amazon RDS instance

I've created a web application using the Meteor web framework, GeoServer and PostGIS. I've deployed my app on Amazon Web Services with the Meteor app and GeoServer running as 2 separate tasks on 1 EC2 ...
user2642365's user avatar
1 vote
1 answer
164 views

Hex Grid Functions Turns out Empty

I'm trying to implement this function to create a hex grid over a layer. However, when I implement it and export it via pgsql2shp the results ends up empty. The query I used is below CREATE TABLE ...
Minh's user avatar
  • 611
4 votes
1 answer
392 views

Replace a string with a variable inside a pgsql2shp command in Python

How to replace a string with a variable inside a pgsql2shp command in Python? command = "pgsql2shp -f /test.shp -h localhost -u postgres -P postgres gis_exercise \"SELECT d.latitude, d.longitude, d....
user1919's user avatar
  • 2,654
2 votes
1 answer
214 views

Generating Shapefiles from PostGIS as a Plugin

I used to generate shapefile from PostgreSQL database that is installed with PostGIS tables as templates (geometry_columns and spatial_ref_sys) Shapefiles generated just fine using the following ...
Shadin's user avatar
  • 293
0 votes
1 answer
655 views

pgsql2shp error: table does not exist

I am exporting tables from Postgresql 9.2 to shapefiles using postgis 2.0. I have the same system on other machines and it works correctly. I have tried running the command from a prompt and get an ...
Jason Hawkins's user avatar
2 votes
1 answer
1k views

Couldn't Excute command line PostGIS pgsql2shp

I am using postgres 9.3 with postgis 2.1 on Ubuntu 14. When I tried to dump pgsql table using pgsql2shp, I get the following error. Error: pg_wrapper: pgsql2shp was not found in /usr/lib/postgresql/...
wondim's user avatar
  • 1,383
2 votes
1 answer
1k views

How can I export a shapefile from PostGIS with a GeoJSON query?

I tried to export a shapefile from my PostGIS installation using pgsql2shp as follow pgsql2shp -f tiles.shp -h <host> -u <user> -P <pass> <database> "SELECT id, the_geom FROM &...
jmbarrios's user avatar
2 votes
0 answers
1k views

pgsql2shp: create shapefile from empty table, but with known attributes (dbf)

I was trying to generate shapefile from postgis tables using pgsql2shp. Everything is fine except for table with no rows. When trying to create shapefile from an empty table, an error occurs: Could ...
Mohayemin's user avatar
  • 279
2 votes
1 answer
3k views

Export shapefile From PostGIS

I've a website where I'm giving the functionality of creating and editing line features. I'm using Leaflet-Draw plugin for drawing, PostGIS for storing the data and GeoJSON to display it on map. My ...
muzaffar's user avatar
  • 1,073
2 votes
1 answer
1k views

pgsql2shp ERROR: incompatible mixed geometry types in table

I have multi-linestring in .shp files and I split the lines with postgis, but that result is only geom column. It does not works with shape file exporter error: incompatible mixed geometry types ...
dionox's user avatar
  • 29
7 votes
1 answer
753 views

Create a Shapefile from SQL dump file

I am trying to map data by querying a table called xyz. I need to show the the_geom data on the map. I have below query in my MapServer .map file: DATA "the_geom from xyz using unique id using SRID=...
Force.comBat's user avatar
3 votes
2 answers
6k views

Where to type pgsql2shp command

How to convert post gis database into shapefile, I found that I need to use pgsql2shp command on postgis database query , But how to use it and where to use it. Do I have to use it in the postgre sql ...
Force.comBat's user avatar
3 votes
1 answer
4k views

How to use pgsql2shp when PostGIS extensions installed in a separate schema as geometry

I have the PostGIS extension (postgis functions and spatial_ref_sys table) added to a specific schema called postgis. I'm wanting to run the pgsql2shp utility with a select query on geometries stored ...
generaluser's user avatar
1 vote
0 answers
595 views

PGSQL2SHP Commnad switch column type

I work with Postgis. I have table CREATE TABLE centerline ( gid serial NOT NULL, l_from integer, l_to integer, r_add_pre character varying(15), r_to integer ... } Export this table with ...
javagc's user avatar
  • 111
3 votes
1 answer
819 views

Postgis and python parameterised queries

I have a python script that i am trying to run in order to dump a postgres table and I noticed there is a pgsql2shp command in bash to perform this easily but I would like to incoperate the same ...
kartoza-geek's user avatar
  • 1,161
2 votes
1 answer
2k views

pgsql2shp error when query is introduced

I'm trying to export a table from PostGIS using pgsql2shp. The basic query to export the entire table works fine using the following format: "C:\Program Files\PostgreSQL\9.1\bin\pgsql2shp.exe" -f "D:\...
geobar's user avatar
  • 370
7 votes
1 answer
2k views

Error when using pgsql2shp

I try to export geographical data from a postgis database to a shapefile with pgsql2shp. Normally this works fine, but now I receive the following error. Preparing table for user query... Done. ...
Stefan's user avatar
  • 2,152
8 votes
3 answers
3k views

How to control encodings in pgsql2shp?

I have a database and exporting with pgsql2shp various shapefiles. But when I open the dbf the characters are displayed wrong. Example: BroeksterwÔld and this should be Broeksterwäld. This probably ...
Stefan's user avatar
  • 2,152