<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19046">
</head>
<body>
<div><font size="2" face="Arial"><span class="024213009-19052011">Hi,</span></font></div>
<div><font size="2" face="Arial"><span class="024213009-19052011"></span></font> </div>
<div><font size="2" face="Arial"><span class="024213009-19052011">I am trying to export spatial data from a Postgres/PostGIS table with upper-case field names by calling ogr2ogr from PHP shell_exec(). I am currently working on a Windows XP machine, but also
need to port to LINUX.</span></font></div>
<div><font size="2" face="Arial"><span class="024213009-19052011"></span></font> </div>
<div><font size="2" face="Arial"><span class="024213009-19052011">I know I have to escape double qoutes, but have so far have not worked out how to do this correctly.</span></font></div>
<div><font size="2" face="Arial"><span class="024213009-19052011"></span></font> </div>
<div><font size="2" face="Arial"><span class="024213009-19052011">The following works at the command line but fails when called with PHP shell_exec()</span></font></div>
<br>
<font size="2" face="Arial">"C:\FWTools2.4.7\bin\ogr2ogr" -f "ESRI Shapefile" test.shp PG:"<span class="024213009-19052011"><connect_str></span>" -sql "SELECT * FROM gpdd.location_pt WHERE \"LocationID\" = ANY(Array[1,2,3])"</font>
<div><font size="2" face="Arial"><span class="024213009-19052011"></span></font> </div>
<div><font size="2" face="Arial"><span class="024213009-19052011">I have tried escaping the slashes with one or two preceeding shashes but to no avail.</span></font></div>
<div><font size="2" face="Arial"><span class="024213009-19052011"></span></font> </div>
<div><font size="2" face="Arial"><span class="024213009-19052011">Any suggestions greatly appreciated. Thanks,</span></font></div>
<div><font size="2" face="Arial"><span class="024213009-19052011"></span></font> </div>
<div><font size="2" face="Arial"><span class="024213009-19052011"> - Dave</span></font></div>
<div><font size="2" face="Arial"><span class="024213009-19052011"></span></font> </div>
<div><font size="2" face="Arial"></font> </div>
<!-- Converted from text/plain format -->
<p align="left"><font size="2">David M. Kidd</font></p>
<p align="left"><font size="2">Research Associate<br>
Center for Population Biology<br>
Silwood Park Campus<br>
Imperial College London<br>
0207 594 2470</font></p>
<div> </div>
</body>
</html>