StefanHa
StefanHa

Reputation: 727

The pgsql2shp.exe cuts-off text to max 254 characters (varchar(254))

im using the pgsql2shp tool to generate *.shp files from geometries in Postgres. The thing is that I have a description colomn with a lot of text. In the Postgres DB it is of type text. But when I use pgsql2shp these columns are cut-off to max 254 characters it makes a varchar(254) of this column.

Any ideas to make this work?

Upvotes: 0

Views: 446

Answers (2)

Mike T
Mike T

Reputation: 43672

As you have discovered, this is a limitation of Shapefiles. To get more characters in the output, you need to export to a different format.

You can use ogr2ogr to convert the spatial data into several different formats, such as Spatialite, GeoJSON, etc.

Upvotes: 0

StefanHa
StefanHa

Reputation: 727

After some more googling and asking around, i found out that the accompanying dbf file with *.shp is based on a dBase IV format. This has a maximum length of a text field = 254 characters. Therefore it cuts the text off.

So I need to find some other solution.

Upvotes: 1

Related Questions