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

2010-09-13 Thread Mark Cave-Ayland
Denis Rykov wrote: Mark, thanks for quick response, I've try to do it with bash: [...@gis ~/gl/projects/osmrus]$ pgsql2shp -u pgsql -f dagestan.shp osm "SELECT st_intersection as geom from dagestan_point_attr WHERE highway='bus_stop'" Initializing... ERROR: Could not determine table metadata

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

2010-09-13 Thread Denis Rykov
Mark, thanks for quick response, I've try to do it with bash: [...@gis ~/gl/projects/osmrus]$ pgsql2shp -u pgsql -f dagestan.shp osm "SELECT st_intersection as geom from dagestan_point_attr WHERE highway='bus_stop'" Initializing... ERROR: Could not determine table metadata (empty table) [...@gis ~

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

2010-09-13 Thread Mark Cave-Ayland
Denis Rykov wrote: I've try to get exit code with my python script: import os code = os.system("pgsql2shp -f dagestan.shp -h gis-lab.info -u labinfo -P *** osm \"SELECT ^^ st_intersection as geom from da

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

2010-09-13 Thread Denis Rykov
I've try to get exit code with my python script: > import os > code = os.system("pgsql2shp -f dagestan.shp -h gis-lab.info -u labinfo -P > *** osm \"SELECT st_intersection as geom from dagestan_point_attr WHERE > highway='bus_stop'") > print code > At result I've got 256 (not 2 as expected). On Th

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

2010-09-02 Thread strk
On Thu, Sep 02, 2010 at 12:48:17AM +0100, Mark Cave-Ayland wrote: > Mark Cave-Ayland wrote: > > >Ah wait a second, you're right - I've been looking in the wrong place. > >It looks like there is still some (old) pgsql2shp code which hasn't been > >updated to use the new error handling, and hence

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

2010-09-01 Thread Mark Cave-Ayland
Mark Cave-Ayland wrote: Ah wait a second, you're right - I've been looking in the wrong place. It looks like there is still some (old) pgsql2shp code which hasn't been updated to use the new error handling, and hence it doesn't get propagated back up to the main function correctly :( Will fix

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

2010-09-01 Thread Mark Cave-Ayland
strk wrote: 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; Ah wait a second, you're right - I've been looking in the wrong plac

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

2010-09-01 Thread strk
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

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

2010-09-01 Thread Mark Cave-Ayland
Denis Rykov wrote: It would be great if you can add an exit code for 0 records dbfs, it'll make my life so much easier. Okay done - it was quite a simple patch in the end. Can you update to SVN r5888 and confirm that you get an exit code of 0 on success, and 2 if 0 records were processed?

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

2010-09-01 Thread Mark Cave-Ayland
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 stric

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

2010-09-01 Thread Denis Rykov
It would be great if you can add an exit code for 0 records dbfs, it'll make my life so much easier. 2010/9/1 Mark Cave-Ayland : > Denis Rykov wrote: > >> Just updated pgsql2shp from svn and try to use it: pgsql2shp -f >> arkhan.shp osm "SELECT st_intersection as geom  from arkhan_line_attr >> WHE

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

2010-09-01 Thread strk
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

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

2010-09-01 Thread Mark Cave-Ayland
Denis Rykov wrote: Just updated pgsql2shp from svn and try to use it: pgsql2shp -f arkhan.shp osm "SELECT st_intersection as geom from arkhan_line_attr WHERE tourism<>''" If SELECT returns empty table I get notice: ERROR: Could not determine geometry type (empty table). Done (postgis major ver

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

2010-08-31 Thread Denis Rykov
Just updated pgsql2shp from svn and try to use it: pgsql2shp -f arkhan.shp osm "SELECT st_intersection as geom from arkhan_line_attr WHERE tourism<>''" If SELECT returns empty table I get notice: ERROR: Could not determine geometry type (empty table). Done (postgis major version: 2). Output shape