[Mapserver-users] help with http://slkapps2.env.gov.bc.ca:80/servlet/com.esri.wms.esrimap wms server and php mapscript questions

Stephen Clark stephen.clark at focus.ca
Wed Nov 12 12:04:19 EST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_004C_01C3A8FB.F4C47800
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all,

I have been trying to render the raster that is returned from this wms =
server to a PDF file.

Here is my layer:

### WMS BC GOV -- Trim Orthophotomosaic --=20
LAYER
  NAME trimphoto
  TYPE RASTER
  STATUS ON
  CONNECTIONTYPE WMS
   CONNECTION =
"http://slkapps2.env.gov.bc.ca:80/servlet/com.esri.wms.Esrimap?WMTVER=3D1=
.0.0&ServiceName=3Dwms26910&LAYERS=3DTRIM%20Orthomosaic&FORMAT=3DPNG&TRAN=
SPARENT=3DTRUE"
  METADATA
    WMS_SRS "EPSG:26910"
    WMS_TITLE "TRIM photo"
    "wms_connectiontimeout" "60"

  END
END


In my php mapscript file I use the following code to render the WMS =
layer as an image to then add to my PDF file.

// set all layers to off
for ($counter =3D 0; $counter < $number_of_layers_in_mapfile ; =
$counter++)
{
 $layer =3D $map->getLayer($counter);
 $layer->set(status, 0);
}


// set only the selected layers to be on
for ($counter =3D 0; $counter < $size_of_listarray; $counter++)
{

 // get layer
 $layer =3D $map->getLayerbyName($listarray[$counter]);
 $layer->set(status, 1);
}


// render the image to png
print "rendering image ... <br>\n";
$image=3D$map->draw();
print "finished rendering image ... <br>\n";
$image_url=3D$image->saveWebImage();


Errors from my pdf generator function:

rendering image ...=20

Warning: [MapServer Error]: msDrawMap(): Failed to draw layer named =
'trimphoto'. in C:\Program Files\Apache =
Group\Apache2\htdocs\nebcdemo-11_make_quick_pdf02.php on line 180

Warning: [MapServer Error]: msDrawRaster(): Unrecognized or unsupported =
image format in C:\Program Files\Apache =
Group\Apache2\htdocs\nebcdemo-11_make_quick_pdf02.php on line 180

Warning: [MapServer Error]: drawEPP(): EPPL7 support is not available. =
in C:\Program Files\Apache =
Group\Apache2\htdocs\nebcdemo-11_make_quick_pdf02.php on line 180
finished rendering image ...=20

Fatal error: Call to a member function on a non-object in C:\Program =
Files\Apache Group\Apache2\htdocs\nebcdemo-11_make_quick_pdf02.php on =
line 182




Questions:

1. If the time required to get the PNG image from the wms server is =
fairly long, will that create the error I posted.

2. Is there another set of functions to process WMS layers and add them =
to the resulting PNG file?


thanks for you time
Stephen
------=_NextPart_000_004C_01C3A8FB.F4C47800
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1264" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have been trying to render the raster =
that is=20
returned from this wms server to a PDF file.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Here is my layer:</FONT></DIV><FONT =
face=3DArial=20
size=3D2>
<DIV><BR>### WMS BC GOV -- Trim Orthophotomosaic -- <BR>LAYER<BR>&nbsp; =
NAME=20
trimphoto<BR>&nbsp; TYPE RASTER<BR>&nbsp; STATUS ON<BR>&nbsp; =
CONNECTIONTYPE=20
WMS<BR>&nbsp;&nbsp; CONNECTION "<A=20
href=3D"http://slkapps2.env.gov.bc.ca:80/servlet/com.esri.wms.Esrimap?WMT=
VER=3D1.0.0&amp;ServiceName=3Dwms26910&amp;LAYERS=3DTRIM%20Orthomosaic&am=
p;FORMAT=3DPNG&amp;TRANSPARENT=3DTRUE">http://slkapps2.env.gov.bc.ca:80/s=
ervlet/com.esri.wms.Esrimap?WMTVER=3D1.0.0&amp;ServiceName=3Dwms26910&amp=
;LAYERS=3DTRIM%20Orthomosaic&amp;FORMAT=3DPNG&amp;TRANSPARENT=3DTRUE</A>"=
<BR>&nbsp;=20
METADATA<BR>&nbsp;&nbsp;&nbsp; WMS_SRS =
"EPSG:26910"<BR>&nbsp;&nbsp;&nbsp;=20
WMS_TITLE "TRIM photo"<BR>&nbsp;&nbsp;&nbsp; "wms_connectiontimeout" =
"60"</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; END<BR>END</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>In my php mapscript file I use the following code to render the WMS =
layer=20
as an image to then add to my PDF file.</DIV>
<DIV>&nbsp;</DIV>
<DIV>// set all layers to off<BR>for ($counter =3D 0; $counter &lt;=20
$number_of_layers_in_mapfile ; $counter++)<BR>{<BR>&nbsp;$layer =3D=20
$map-&gt;getLayer($counter);<BR>&nbsp;$layer-&gt;set(status, =
0);<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>// set only the selected layers to be on</DIV>
<DIV>for ($counter =3D 0; $counter &lt; $size_of_listarray;=20
$counter++)<BR>{<BR></DIV>
<DIV>&nbsp;// get layer<BR>&nbsp;$layer =3D=20
$map-&gt;getLayerbyName($listarray[$counter]);<BR>&nbsp;$layer-&gt;set(st=
atus,=20
1);<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>// render the image to png<BR>print "rendering image ...=20
&lt;br&gt;\n";<BR>$image=3D$map-&gt;draw();<BR>print "finished rendering =
image ...=20
&lt;br&gt;\n";<BR>$image_url=3D$image-&gt;saveWebImage();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Errors from my pdf generator function:</DIV>
<DIV>&nbsp;</DIV>
<DIV>rendering image ... <BR><BR><B>Warning</B>: [MapServer Error]: =
msDrawMap():=20
Failed to draw layer named 'trimphoto'. in <B>C:\Program Files\Apache=20
Group\Apache2\htdocs\nebcdemo-11_make_quick_pdf02.php</B> on line=20
<B>180</B><BR><BR><B>Warning</B>: [MapServer Error]: msDrawRaster():=20
Unrecognized or unsupported image format in <B>C:\Program Files\Apache=20
Group\Apache2\htdocs\nebcdemo-11_make_quick_pdf02.php</B> on line=20
<B>180</B><BR><BR><B>Warning</B>: [MapServer Error]: drawEPP(): EPPL7 =
support is=20
not available. in <B>C:\Program Files\Apache=20
Group\Apache2\htdocs\nebcdemo-11_make_quick_pdf02.php</B> on line=20
<B>180</B><BR>finished rendering image ... <BR><BR><B>Fatal error</B>: =
Call to a=20
member function on a non-object in <B>C:\Program Files\Apache=20
Group\Apache2\htdocs\nebcdemo-11_make_quick_pdf02.php</B> on line=20
<B>182</B><BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Questions:</DIV>
<DIV>&nbsp;</DIV>
<DIV>1. If the time required to get the PNG image from the wms server is =
fairly=20
long, will that create the error I posted.</DIV>
<DIV>&nbsp;</DIV>
<DIV>2. Is there another set of functions to process WMS layers and add =
them to=20
the resulting PNG file?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>thanks for you time</DIV>
<DIV>Stephen</FONT></DIV></BODY></HTML>

------=_NextPart_000_004C_01C3A8FB.F4C47800--




More information about the mapserver-users mailing list