<div>Greetings!</div>
<div> </div>
<div>I've been struggling with a small problem with ogr2ogr and was wondering if anyone here can provide some pointers. I'm working on a web-based analysis system for environmental health surveillance and one of the aspects of this system is the ability to obtain data from multiple data repositories on the internet. I'm using ogr2ogr to basically convert a set of GML documents into tables in postgresql. I'm using perl to download GML data and then calling ogr2ogr using a system() command. I'm using Windows Vista, Apache and Active perl. Now, I've tested this setup and my scripts on a machine running Windows 2003 server and Windows XP and everything works perfectly. The move to Vista seems to be causing problems *only* when the script is called from a browser (it works perfectly when run from the command line). If it were incompatibility issues with Vista, then the script should fail everywhere - the fact that it fails only when called from a browser is what I'm curious about. Anyway, the relevant portions of the script are as follows:
</div>
<div><br>#!c:\perl\bin\perl.exe -w</div>
<div>
<p># Use LWP::Simple to fetch cafo data from WFS server<br>use LWP::Simple;</p></div>
<div>
<p>MAIN:<br>{<br> # Define variables<br> # Data source<br> my $dsource = '<a href="http://localhost/geoserver/wfs?request=getfeature&typename=envdata:cafos">http://localhost/geoserver/wfs?request=getfeature&typename=envdata:cafos
</a>';<br> <br> # Start script <br> # Define content type<br> print "Content-type: text/html\n\n";<br> <br> # Download data from dsource and store in \uploads\cafo.gml<br> eval{<br> getstore($dsource,'c:\\progra~1\\Apache~1\\Apache2.2\\htdocs\\uploads\\cafo.gml');
<br> };<br> <br> # Print error if any<br> if ($@){<br> print $@;<br> }<br> <br> # create ogr2ogr command <br> my $ogrcmd="c:\\Progra~1\\FWTool~1\.2\\bin\\ogr2ogr.exe -overwrite -s_srs EPSG\:26915 -t_srs EPSG\:4326 -lco geometry_name=the_geom -f \"PostgreSQL\" PG:\"host=localhost user=foo password=bar dbname=test\" c:\\progra~1\\apache~1\\apache2.2\\htdocs\\uploads\\cafo\.gml -nln
public.cafolocations";<br> <br> # execute ogr2ogr</p>
<p>if(my $pid = fork){<br>}<br>elsif (defined $pid){<br> close(STDOUT);<br> exec($ogrcmd);<br> exit(0);<br>} else{<br> die "Fork Error";<br>}</p>
<p># End script <br>}</p></div>
<div>Any comments are appreciated. Thanks very much,</div>
<div> </div>
<div>Chetan</div>
<div><br>-- <br>Chetan Tiwari, Ph.D. (ABD)<br>Dept. of Geography, The Univ. of Iowa<br>316 Jessup Hall, Iowa City, IA 52242<br>Ph. (319) 335-0165 Fax (319) 335-2725 </div>