[postgis-users] Size of .dbf file produced with pgsql2shp

strk strk at keybit.net
Wed Sep 1 07:49:23 PDT 2010


On Wed, Sep 01, 2010 at 12:03:36PM +0100, Mark Cave-Ayland wrote:
> Denis Rykov wrote:
> 
> >ERROR: Could not determine geometry type (empty table).
> >Done (postgis major version: 2).
> >Output shape: Null Shape
> >Dumping: [0 rows].
>
> Checking the resulting file size is not the right way to be trying to 
> detect whether the query returned > 0 rows. It strikes me that the best 
> way to detect this would be to return a different exit code from 
> pgsql2shp if no rows are returned - would this work for you?

I'd go stricter to "if an ERROR occurred" rather than 
"if no rows are returned".

Just in case one day we'll add a flag to specify the geometry type
thus allowing creation of empty-but-structuted shapefiles starting
from a table "template".

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-users mailing list