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 (empty table)
[...@gis ~/gl/projects/osmrus]$ echo $?
1

But you wrote that

exit code of 0 on success, and 2 if 0 records were processed

Why I get 1, but not 2?

Yes, the return code of 2 was from an old email - I reworked it based upon strk's suggestion that trying to dump an empty table is actually an ERROR, so now it returns 1. This is because without any geometries present in the table, we are unable to generate the basic table metadata.

Note that the ERROR text is sent to stderr so you can capture it from there if you need to pass the information back to the user (or to a logfile).


HTH,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to