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

strk strk at keybit.net
Wed Sep 1 10:52:35 PDT 2010


On Wed, Sep 01, 2010 at 06:29:56PM +0100, Mark Cave-Ayland wrote:
> strk wrote:
> 
> >>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;
> 
> This is exactly how the new code in trunk currently works - you get an 
> exit code of 0 to indicate success, and an exit code of 1 if an error 
> occurred. I was thinking of adding a new exit code of 2 to indicate 
> success, but also that 0 records were processed.

I can't see how this was a success in the reporter's case.
Could not determine a geometry type, so what could it have 
written in the .shp file ?
It even printed an ERROR message.
How's that a success ?

--strk; 

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



More information about the postgis-users mailing list