[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 09:04:19 PST 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> </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> </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>  =
NAME=20
trimphoto<BR>  TYPE RASTER<BR>  STATUS ON<BR>  =
CONNECTIONTYPE=20
WMS<BR>   CONNECTION "<A=20
href=3D"http://slkapps2.env.gov.bc.ca:80/servlet/com.esri.wms.Esrimap?WMT=
VER=3D1.0.0&ServiceName=3Dwms26910&LAYERS=3DTRIM%20Orthomosaic&am=
p;FORMAT=3DPNG&TRANSPARENT=3DTRUE">http://slkapps2.env.gov.bc.ca:80/s=
ervlet/com.esri.wms.Esrimap?WMTVER=3D1.0.0&ServiceName=3Dwms26910&amp=
;LAYERS=3DTRIM%20Orthomosaic&FORMAT=3DPNG&TRANSPARENT=3DTRUE</A>"=
<BR> =20
METADATA<BR>    WMS_SRS =
"EPSG:26910"<BR>   =20
WMS_TITLE "TRIM photo"<BR>    "wms_connectiontimeout" =
"60"</DIV>
<DIV> </DIV>
<DIV>  END<BR>END</DIV>
<DIV> </DIV>
<DIV> </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> </DIV>
<DIV>// set all layers to off<BR>for ($counter =3D 0; $counter <=20
$number_of_layers_in_mapfile ; $counter++)<BR>{<BR> $layer =3D=20
$map->getLayer($counter);<BR> $layer->set(status, =
0);<BR>}</DIV>
<DIV> </DIV>
<DIV><BR>// set only the selected layers to be on</DIV>
<DIV>for ($counter =3D 0; $counter < $size_of_listarray;=20
$counter++)<BR>{<BR></DIV>
<DIV> // get layer<BR> $layer =3D=20
$map->getLayerbyName($listarray[$counter]);<BR> $layer->set(st=
atus,=20
1);<BR>}</DIV>
<DIV> </DIV>
<DIV><BR>// render the image to png<BR>print "rendering image ...=20
<br>\n";<BR>$image=3D$map->draw();<BR>print "finished rendering =
image ...=20
<br>\n";<BR>$image_url=3D$image->saveWebImage();</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Errors from my pdf generator function:</DIV>
<DIV> </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> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Questions:</DIV>
<DIV> </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> </DIV>
<DIV>2. Is there another set of functions to process WMS layers and add =
them to=20
the resulting PNG file?</DIV>
<DIV> </DIV>
<DIV> </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