Re: [mapserver-users] MapServer 6.4.1 OGR output error

2015-02-23 Thread Eichner, Andreas - SID
To me it seems the WFS code uses msReturnTemplateQuery() from maptemplate.c but 
this is not exported to (PHP-)MapScript... I would guess that the only way to 
get OGR output would be to fake a OWS-Request:

?php
$map = ms_newMapObj(./toto.map);

$req = new OWSRequestObj();
$args = Array(service = WFS, request = GetFeature, version = 
1.1.0, typename = Bati);
foreach($args as $param = $value) $req-setParameter($param, $value);
$req-setParameter(outputformat, $_REQUEST[type_fichier]);

// $map-loadOWSParameters($req);
$map-owsDispatch($req);

?

Requires enabling the request type and the output format:
WEB
METADATA
Ows_enable_request *
Wfs_getfeature_formatlist dxf midmif shapezip csv kmz
END
END


HTH

 -Ursprüngliche Nachricht-
 Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-
 boun...@lists.osgeo.org] Im Auftrag von Bruno D
 Gesendet: Freitag, 20. Februar 2015 16:27
 An: mapserver-users@lists.osgeo.org
 Betreff: Re: [mapserver-users] MapServer 6.4.1 OGR output error
 
 Hi Andreas,
 
 Thanks for your answer. I tried using savequeryasgml(), but it creates a
 blank gml file that only contains the following text :
 /?xml version=1.0 encoding=ISO-8859-1?
 msGMLOutput
xmlns:gml=http://www.opengis.net/gml;
xmlns:xlink=http://www.w3.org/1999/xlink;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 /msGMLOutput/
 
 I'll look into that, but as you stated there is almost no documentation...
 
 Could someone who succeeded in outputting a DXF/SHP/... file through OGR
 post a working example ?
 
 Thanks !
 
 Bruno
 
 
 
 --
 View this message in context: http://osgeo-
 org.1560.x6.nabble.com/MapServer-6-4-1-OGR-output-error-
 tp5172655p5188948.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] MapServer 6.4.1 OGR output error

2015-02-23 Thread Bruno D
Thank you so much Andreas, your solution works perfectly ! I would never have
thought of it by myself.

Now all I have to do is understand why the generated zip files seem invalid
(I can see their content with 7zip, but I can't extract them)...

Thanks everyone for your help !




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/MapServer-6-4-1-OGR-output-error-tp5172655p5189444.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] MapServer 6.4.1 OGR output error

2015-02-23 Thread Bruno D
You are too quick to answer ! I was suspecting the header problem, but I was
still looking for the solution.

Once again what you suggested works perfectly !

Thanks a lot for your help !



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/MapServer-6-4-1-OGR-output-error-tp5172655p5189489.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] MapServer 6.4.1 OGR output error

2015-02-23 Thread Eichner, Andreas - SID
Maybe you tried to use the result directly?
The owsDispatch() method creates content _plus_ headers. To get the plain 
content you need to write the output into a buffer, strip off the headers and 
fetch the contents of the buffer:

ms_ioinstallstdouttobuffer();
$map-owsDispatch($req);
ms_iostripstdoutbuffercontentheaders();
$result = ms_iogetstdoutbufferstring();
print_r($result);

To correct my self: the Wfs_getfeature_formatlist is a comma separated list.

 -Ursprüngliche Nachricht-
 Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-
 boun...@lists.osgeo.org] Im Auftrag von Bruno D
 Gesendet: Montag, 23. Februar 2015 15:11
 An: mapserver-users@lists.osgeo.org
 Betreff: Re: [mapserver-users] MapServer 6.4.1 OGR output error
 
 Thank you so much Andreas, your solution works perfectly ! I would never
 have
 thought of it by myself.
 
 Now all I have to do is understand why the generated zip files seem
 invalid
 (I can see their content with 7zip, but I can't extract them)...
 
 Thanks everyone for your help !
 
 
 
 
 --
 View this message in context: http://osgeo-
 org.1560.x6.nabble.com/MapServer-6-4-1-OGR-output-error-
 tp5172655p5189444.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users