<!DOCTYPE html><html><head><title></title><style type="text/css">

p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Hi Marcin,<br></div><div><br></div><div>Sorry I thought you wanted to do this within MapScript without a web server. <br></div><div>If you want to simply make WMS requests to any WMS server over HTTP I'd recommend the Python library OWSLib, see for example <a href="https://geopython.github.io/OWSLib/notebooks/examples/wms.html">https://geopython.github.io/OWSLib/notebooks/examples/wms.html</a><br></div><div><br></div><div>Seth<br></div><div><br></div><div id="sig62266145"><div class="signature">--<br></div><div class="signature">web:<a href="https://geographika.net">https://geographika.net</a><br></div><div class="signature">twitter: @geographika<br></div></div><div><br></div><div>On Tue, Jan 24, 2023, at 12:02 PM, Marcin Niemyjski wrote:<br></div><blockquote type="cite" id="qt" style=""><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);" class="qt-elementToProof">Seth,<br></div><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);" class="qt-elementToProof"><br></div><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);" class="qt-elementToProof">do I understand it correctly? I need to provide WMS's mapfile to perform request? I assume that I should be mainly interested in code part between 16 and 36 line.<br></div><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);" class="qt-elementToProof"><br></div><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);" class="qt-elementToProof">Thank you for quick response,<br></div><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);" class="qt-elementToProof">Marcin<br></div><div class="qt-elementToProof"><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div id="qt-Signature"><div><table style="margin-top:30px;margin-bottom:30px;width:95%;" id="qt-tableSelected0"><tbody><tr height="45"><td><br></td></tr><tr><td><br></td></tr><tr><td><br></td></tr><tr><td><br></td></tr></tbody></table><table id="qt-pbpsiglinktable"><tbody><tr><td><a href="https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature"><img src="cid:fb72e1ec-b687-422e-ad49-e0dca75a8c35"></a><br></td><td><br></td><td><a href="https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature" style="text-decoration-line:none;text-decoration-style:solid;text-decoration-color:currentcolor;text-decoration-thickness:auto;color:rgb(0, 120, 212);">Book time to meet with me</a><br></td><td><br><table></table></td></tr></tbody></table></div></div></div><div id="qt-appendonsend"><br></div><div><hr style="display:inline-block;width:98%;"><br></div><div id="qt-divRplyFwdMsg" dir="ltr"><div><span class="font" style="font-family:Calibri, sans-serif;"><span class="color" style="color:rgb(0, 0, 0);"><b>From:</b> Seth G <sethg@geographika.co.uk><br> <b>Sent:</b> Tuesday, January 24, 2023 11:39 AM<br> <b>To:</b> Marcin Niemyjski <mniemyjski@cloudferro.com>; MapServer Users <mapserver-users@lists.osgeo.org><br> <b>Subject:</b> Re: [MapServer-users] GetMap request inside python script; measuring speed of WMS?</span></span></div><div> <br></div></div><div><div>Hi Marcin,<br></div><div><br></div><div>Have a look at the example Python script at <a href="https://github.com/MapServer/MapServer/blob/main/mapscript/python/examples/wxs.py"> https://github.com/MapServer/MapServer/blob/main/mapscript/python/examples/wxs.py</a> - this shows creating and calling a WMS request.<br></div><div><br></div><div>Seth<br></div><div><br></div><div id="qt-x_sig62266145"><div class="qt-x_signature">--<br></div><div class="qt-x_signature">web:<a href="https://geographika.net">https://geographika.net</a><br></div><div class="qt-x_signature">twitter: @geographika<br></div></div><div><br></div><div>On Tue, Jan 24, 2023, at 11:36 AM, Marcin Niemyjski via MapServer-users wrote:<br></div><blockquote type="cite" id="qt-x_qt" style=""><div class="qt-x_qt-elementToProof" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);">Hello,<br></div><div class="qt-x_qt-elementToProof" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);"><br></div><div class="qt-x_qt-elementToProof" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);">I want to measure how long does it takes for my WMS to response to GetMap request. I have prepared list of extents in form of python list for example:<br></div><div class="qt-x_qt-elementToProof qt-x_qt-ContentPasted0 qt-x_qt-ContentPasted1" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);">['38.04778703973034,-17.714089101743628,39.04778703973034,-16.714089101743628', '38.04778703973034,-17.714089101743628,39.04778703973034,-16.714089101743628'...]<br></div><div class="qt-x_qt-elementToProof qt-x_qt-ContentPasted0 qt-x_qt-ContentPasted1" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);"><br></div><div class="qt-x_qt-elementToProof qt-x_qt-ContentPasted0 qt-x_qt-ContentPasted1" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);">I'm aiming into itterating over this list and passing it's elements into GetMap request inside python script and then request GetMap and measure how long does it takes to perfome it.<br></div><div class="qt-x_qt-elementToProof qt-x_qt-ContentPasted0 qt-x_qt-ContentPasted1" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);"><br></div><div class="qt-x_qt-elementToProof qt-x_qt-ContentPasted0 qt-x_qt-ContentPasted1" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);">Here starts my question: How to do GetMap request inside python script, is it possible? The question is not about creating the url but about function wich does request.<br></div><div class="qt-x_qt-elementToProof qt-x_qt-ContentPasted0 qt-x_qt-ContentPasted1" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);">Maybe somebody can recommend me some other way of measuring speed of WMS?<br></div><div class="qt-x_qt-elementToProof qt-x_qt-ContentPasted0 qt-x_qt-ContentPasted1" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);"><br></div><div class="qt-x_qt-elementToProof qt-x_qt-ContentPasted0 qt-x_qt-ContentPasted1" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);">I would like show my k8s cluster service as use-case at FOSS4G 2023 and i need some statistics for presentation <span id="qt-x_qt-🙂">🙂</span><br></div><div class="qt-x_qt-elementToProof qt-x_qt-ContentPasted0 qt-x_qt-ContentPasted1" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);"><br></div><div class="qt-x_qt-elementToProof qt-x_qt-ContentPasted0 qt-x_qt-ContentPasted1" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);">Best,<br></div><div class="qt-x_qt-elementToProof qt-x_qt-ContentPasted0 qt-x_qt-ContentPasted1" style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);background-color:rgb(255, 255, 255);">Marcin<br></div><div class="qt-x_qt-elementToProof"><div id="qt-x_qt-Signature"><div><table id="qt-x_qt-tableSelected0" style="margin-top:30px;margin-bottom:30px;width:95%;"><tbody><tr height="45"><td><br></td></tr><tr><td><br></td></tr><tr><td><br></td></tr><tr><td><br></td></tr></tbody></table><table id="qt-x_qt-pbpsiglinktable"><tbody><tr><td><a href="https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature"><img src="cid:f896bb67-9d7c-4fef-a779-e7ab8c29f1e6"></a><br></td><td><br></td><td><a href="https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature" style="text-decoration-line:none;text-decoration-style:solid;text-decoration-color:currentcolor;color:rgb(0, 120, 212);">Book time
 to meet with me</a><br></td><td><br><table></table></td></tr></tbody></table></div></div></div><div>_______________________________________________<br></div><div>MapServer-users mailing list<br></div><div><a href="mailto:MapServer-users@lists.osgeo.org">MapServer-users@lists.osgeo.org</a><br></div><div><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div><div><br></div></blockquote><div><br></div></div></blockquote><div><br></div></body></html>