[mapserver-users] Problem with wfs.php

Richard LEHAUT richard.lehaut at gmail.com
Tue Oct 12 10:59:49 EDT 2010


Hi,
*I followed your instructions, I try use "curl-setopt-array"  with
"curl_multi_init".  *

*function curl_get_multi_content($list_layer) {
    $curl_init = array();

    foreach($list_layer as $i => $layer) {
        unset($options);
        $options = array
            (
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_CONNECTTIMEOUT => 120,
            CURLOPT_TIMEOUT        => 120,
            CURLOPT_POST           => 1,
            CURLOPT_POSTFIELDS     => $layer['data'].$layer['filter'],
            );

        $curl_init[$i]    = curl_init($layer['url']);
        curl_setopt_array($curl_init[$i],$options);
    }

    $curl_multi = curl_multi_init();

    foreach($list_layer as $i => $layer) {
        curl_multi_add_handle($curl_multi, $curl_init[$i]);
    }
    do {
        curl_multi_exec($curl_multi, $running);
    } while($running > 0);

    foreach($list_layer as $i => $layer) {
        echo curl_multi_getcontent($curl_init[$i]);
        $list_layer[$i] =
$layer+Array('info'=>get_info_xml(curl_multi_getcontent($curl_init[$i]),
$layer['name']));
        curl_close($curl_init[$i]);
    }
    return $list_layer;
}*

*With my server, result is correct. I've a error with server Carmen :*
ZNIEFF_de_type_1=======>
Warning: file_get_contents(
http://ws.carmen.developpement-durable.gouv.fr/cgi-bin/mapserv?service_idx=8&map=%2Fmnt%2Fdata_carmen%2FBN%2FPublication%2Fwms_nature.map&VERSION=1.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=ZNIEFF_de_type_1&FILTER=%3CFilter%3E%3CIntersect%3E%3CPropertyName%3EGeometry%3C%2FPropertyName%3E%3Cgml%3APolygon%3E%3Cgml%3AouterBoundaryIs%3E%3Cgml%3ALinearRing%3E%3Cgml%3Acoordinates%3E%28526467%2C6821671%20526471%2C6821675%20526480%2C6821677%20526482%2C6821676%20526491%2C6821679%20526490%2C6821682%20526546%2C6821697%20526615%2C6821701%20526616%2C6821699%20526627%2C6821699%20526628%2C6821702%20526708%2C6821705%20526804%2C6821709%20526821%2C6821701%20526886%2C6821665%20526916%2C6821658%20526933%2C6821616%20526961%2C6821574%20526969%2C6821565%20526982%2C6821513%20526833%2C6821533%20526833%2C6821517%20526813%2C6821513%20526801%2C6821508%20526749%2C6821480%20526732%2C6821469%20526718%2C6821484%20526688%2C6821481%20526616%2C6821481%20526620%2C6821448%20526584%2C6821438%20526547%2Cin
/applications/www/carmen/WFS/wfs.php on line 123

Warning: Cannot modify header information - headers already sent by (output
started at /applications/www/carmen/WFS/wfs.php:123) in
/applications/www/carmen/WFS/wfs.php on line 91.

*It's the same message of the first error (number of  ligne changed), but
the function working properly on my server!!!!

Thanks for your help.*

Richard LEHAUT/Tiolebucheron

2010/10/11 Yves Jacolin <yves.jacolin at camptocamp.com>

> Hi,
>
> Don't use file_get_contents but cURL rather:
> http://www.php.net/manual/fr/function.curl-setopt-array.php
>
> Regards,
>
> Y.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20101012/e118171e/attachment.html


More information about the mapserver-users mailing list