[FWTools] calling ogr2ogr from PHP shell_exec with upper-case Postgres field names
Chaitanya kumar CH
chaitanya.ch at gmail.com
Thu May 19 06:53:59 EST 2011
David,
Try the escapeshellcmd php function.
http://www.php.net/manual/en/function.escapeshellcmd.php
On Thu, May 19, 2011 at 3:10 PM, Kidd, David M <d.kidd at imperial.ac.uk>wrote:
> Hi,
>
> 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.
>
> I know I have to escape double qoutes, but have so far have not worked out
> how to do this correctly.
>
> The following works at the command line but fails when called with PHP
> shell_exec()
>
> "C:\FWTools2.4.7\bin\ogr2ogr" -f "ESRI Shapefile" test.shp PG:"
> <connect_str>" -sql "SELECT * FROM gpdd.location_pt WHERE \"LocationID\" =
> ANY(Array[1,2,3])"
>
> I have tried escaping the slashes with one or two preceeding shashes but to
> no avail.
>
> Any suggestions greatly appreciated. Thanks,
>
> - Dave
>
>
>
> David M. Kidd
>
> Research Associate
> Center for Population Biology
> Silwood Park Campus
> Imperial College London
> 0207 594 2470
>
>
> _______________________________________________
> FWTools mailing list
> FWTools at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/fwtools
> http://fwtools.maptools.org/
>
>
--
Best regards,
Chaitanya kumar CH.
/tʃaɪθənjə/ /kʊmɑr/
+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20110519/b8f171ac/attachment.htm
More information about the FWTools
mailing list