[DUG] Shell Execute
Conor Boyd
Conor_Boyd at trimble.com
Mon Feb 13 09:01:03 NZDT 2012
Unless I’m reading it wrong, you’re missing a backslash in the path that you’re constructing to the ogr2ogr binary.
ProgramName :=
'"'+s+'\Quantum GIS Wroclaw\bin'+
'ogr2ogr"
I think there should be a slash after the “bin”?
From: delphi-bounces at listserver.123.net.nz [mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of Bob Pawley
Sent: Monday, 13 February 2012 6:54 a.m.
To: DUG
Subject: [DUG] Shell Execute
Hi
I’m having a further problem with shell execute. There seems to be a dearth of information on the web other than a simple “open” procedure.
The following two part code performs well when I copy and paste it into command prompt.
However when I use it in shell execute there is a problem getting both parts to run together.
In shell execute each part of the code does its thing when the other part is commented out.
I have tried joining the two parts with the ogr2ogr command &&, and as it appears below. I have also removed the second path to ogr2ogr with no joy.
I either get “unable to run” or the second part of the code is recognized with the first part being ignored.
The following is my command prompt code – which works as shown
set PGCLIENTENCODING=LATIN1&&set DXF_ENCODING=LATIN1&&set DXF_INLINE_BLOCKS=FALSE&&set DXF_MERGE_BLOCK_GEOMETRIES=FALSE&&ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=*** password=*****" Water2000.dxf -lco DIM=2 -nlt GEOMETRY -sql "select layer, linetype, subclasses, ogr_style, blockname, blockangle, blockscale, text from entities" -append -update -skipfailures
set PGCLIENTENCODING=LATIN1&&set DXF_ENCODING=LATIN1&&set DXF_INLINE_BLOCKS=FALSE&&set DXF_MERGE_BLOCK_GEOMETRIES=FALSE&&ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=*** password=****" Water2000.dxf -lco DIM=2 -nlt GEOMETRY -append -update -skipfailures -sql "select layer, linetype, subclasses, ogr_style, blockname, text from blocks"
Here is the shell execute code which is giving me a challenge -
ProgramName :=
'"'+s+'\Quantum GIS Wroclaw\bin'+
'ogr2ogr" "-f" '+
'"PostgreSQL";'+
' PG:"host='+DBHost+' user=postgres dbname='+DBName+' password='+Pass+'" "'+ DXFfile +'" '+
' --config DXF_INLINE_BLOCKS FALSE --config DXF_MERGE_BLOCK_GEOMETRIES FALSE --config DXF_ENCODING=UTF8 '+
' -lco DIM=2 -nlt GEOMETRY -overwrite -skipfailures'+
' -sql "select layer, linetype, subclasses, ogr_style, blockname, blockangle, blockscale, text from entities"'+
'"'+s+'\Quantum GIS Wroclaw\bin'+
'ogr2ogr""-f"'+
' "PostgreSQL";'+
'PG:"host='+DBHost+' user=postgres dbname='+DBName+' password='+Pass+'" "'+ DXFfile +'" '+
' --config DXF_INLINE_BLOCKS FALSE --config DXF_MERGE_BLOCK_GEOMETRIES FALSE --config DXF_ENCODING=UTF8 '+
' -lco DIM=2 -nlt GEOMETRY -overwrite -skipfailures'+
' -sql "select layer, linetype, subclasses, ogr_style, blockname, text from blocks"';
Thanks in advance for any suggestions.
Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20120213/56eb308a/attachment.html
More information about the Delphi
mailing list