[mapserver-users] php/mapscript and OWS
Yewondwossen Assefa
yassefa at dmsolutions.ca
Thu Apr 10 10:28:36 PDT 2008
Robert,
what does you php script looks like? Quick test I did with a png
output and works looks like this:
request :
http://localhost/msapps/wxs/test.php?SERVICE=WMS&VeRsIoN=1.1.1&Request=GetMap&LAYERS=WorldGen_Outline&FORMAT=png&WIDTH=400&HEIGHT=300&SRS=EPSG:4326&FORMAT=png&WIDTH=400&HEIGHT=300&STYLES=&BBOX=-180.0,-90.0,180.0,90.0&SLD=http://localhost/msapps/world_testdata/tests/sld_tests/sld_line_multi_filter.xml
test.php
<?php
dl("php_mapscript.dll");
$request = ms_newowsrequestobj();
$request->loadparams();
ms_ioinstallstdouttobuffer();
$oMap = ms_newMapobj("f:/msapps/world_testdata/map/world_testdata.map");
$oMap->owsdispatch($request);
$contenttype = ms_iostripstdoutbuffercontenttype();
//if ($contenttype == 'image/png')
header('Content-type: image/png');
ms_iogetStdoutBufferBytes();
ms_ioresethandlers();
?>
Best Regards
ROBERT HOLLINGSWORTH wrote:
> Hello,
> I've loaded latest MS4W 2.x (therefore PHP 5.x)
> and am trying to verify Mapscript's
> OwsRequestObj and $mapobj->owsdispatch()
> on a fairly ordinary shp-based mapfile
> that works well where mapserv.exe is
> the WMS server.
>
> The requestobj seems healthy and
> owsdispatch seems successful on WMS
> GetCapabilities. On a GetMap,
> owsdispatch is returning MS_SUCCESS,
> but all the image output formats are
> coming thru damaged or truncated in
> some way. When running GetMap
> in a browser, there are corruption
> messages for PNG and GIF,
> while JPG displays as a very "disturbed"
> image that gdalinfo indicates is currupted.
>
> The docs suggest that owsdispatch() should
> be able to dump the image to the client without
> further manipulation, so I don't know what I
> might be missing.
>
> Or if my environment is somehow tainted from
> older MS4Ws (on PHP 4). I uninstalled the old
> apache that I was using and installed the new
> MS4W in c:\ to be as generic as possible.
>
> Any ideas out there?
>
> thanks,
> Robert H.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
--
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst
Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/
Phone: (613) 565-5056 (ext 14)
Fax: (613) 565-0925
----------------------------------------------------------------
More information about the MapServer-users
mailing list