From ajph at geodata.soton.ac.uk Fri May 3 06:43:08 2024 From: ajph at geodata.soton.ac.uk (Andrew Harfoot) Date: Fri, 3 May 2024 14:43:08 +0100 Subject: [MapServer-users] WMS GetFeatureInfo default FEATURE COUNT Message-ID: Hi list, In a WMS GetFeatureInfo request, if the client does not include the FEATURECOUNT parameter then MapServer appears to default to FEATURECOUNT=1. Is there any way to override this default in the server configuration? Thanks, Andy From sethg at geographika.co.uk Fri May 3 06:56:56 2024 From: sethg at geographika.co.uk (Seth G) Date: Fri, 03 May 2024 15:56:56 +0200 Subject: [MapServer-users] WMS GetFeatureInfo default FEATURE COUNT In-Reply-To: References: Message-ID: Hi Andrew, It looks like this is hard-coded to be set to 1 if missing (there is a comment that it is up to the server what to do if FEATURECOUNT is not provided). You could handle this at the web server level with a URL rewrite to add FEATURECOUNT to any GetFeatureInfo request where it is missing. Seth -- web:https://geographika.net & https://mapserverstudio.net twitter: @geographika On Fri, May 3, 2024, at 3:43 PM, Andrew Harfoot via MapServer-users wrote: > Hi list, > > In a WMS GetFeatureInfo request, if the client does not include the > FEATURECOUNT parameter then MapServer appears to default to > FEATURECOUNT=1. Is there any way to override this default in the server > configuration? > > Thanks, > > Andy > > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users From jukka.rahkonen at maanmittauslaitos.fi Fri May 3 07:46:40 2024 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka) Date: Fri, 3 May 2024 14:46:40 +0000 Subject: [MapServer-users] WMS GetFeatureInfo default FEATURE COUNT In-Reply-To: References: Message-ID: Hi, In the WMS standard the FeatureCount parameter is defined to be optional, and the default is one. "Number of features about which to return information (default=1)" What you ask would be against the standard. -Jukka Rahkonen- -----Alkuper?inen viesti----- L?hett?j?: MapServer-users Puolesta Andrew Harfoot via MapServer-users L?hetetty: perjantai 3. toukokuuta 2024 16.43 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: [MapServer-users] WMS GetFeatureInfo default FEATURE COUNT Hi list, In a WMS GetFeatureInfo request, if the client does not include the FEATURECOUNT parameter then MapServer appears to default to FEATURECOUNT=1. Is there any way to override this default in the server configuration? Thanks, Andy _______________________________________________ MapServer-users mailing list MapServer-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users From nando_gcia at hotmail.com Tue May 7 01:43:06 2024 From: nando_gcia at hotmail.com (=?UTF-8?Q?Fernando_S=C3=A1nchez_Garc=C3=ADa?=) Date: Tue, 7 May 2024 10:43:06 +0200 Subject: [MapServer-users] zoomRectangle error image rectangle maxy >= miny Message-ID: Dear users, my name is Fernando and I work at the University of C?rdoba in Spain. I have been using mapserver for several years as a user at the University together with pmapper. Our old virtual machine has Ubuntu Server 18.04 LTS + mapserver 7.2.1 + PHP 5.6.40 + postgres/postgis with pmapper 4.3.2. and locally on my computer I have MS4W 3.2.3 with pmapper 4.3.2. Unfortunately pmapper was discontinued a few years ago and although I don't have much programming knowledge, I have started trying to make some small changes to the pmapper code to adapt it to PHP 7/8 (although I know other more up-to-date alternatives such as Openlayers). I have reached the "Zoom to rectangle" function where Armin implemented it like this: ??? /************************************************ ???? * ZOOM&PAN FUNCTIONS ???? ************************************************/ ??? /** ???? * Zoom to rectangle ???? */ ??? protected function pmap_zoomrect() ??? { ??????? if (isset($_REQUEST["imgbox"])) { ??????????? $imgbox_str = $_REQUEST["imgbox"]; ??????????? //error_log($imgbox_str); ??????????? if ($imgbox_str != "") { ??????????????? $imgbox_arr = explode(" ", $imgbox_str); ??????????????? // New map extent in image pixel ((0,0) top-left) ??????????????? $pix_minx = $imgbox_arr[0]; ??????????????? $pix_miny = $imgbox_arr[1]; ??????????????? $pix_maxx = $imgbox_arr[2]; ??????????????? $pix_maxy = $imgbox_arr[3]; ??????????????? if ($pix_minx == $pix_maxx) $pix_maxx = $pix_maxx + 3;? ## increase max extent if min==max ??????????????? if ($pix_miny == $pix_maxy) $pix_maxy = $pix_maxy - 3;? ## ??????????????? $pixext = ms_newrectObj(); ??????????????? // Modified by Thomas RAFFIN (SIRAP) ??????????????? // If the rectangle is not in the same proportions as the map, ??????????????? // To leave the coeff Y / X unghanged, we need to made $geoNewCoeff = $geo0Coeff... ?? ???? ??? ??? $geo0Coeff = $this->mapheight / $this->mapwidth; ?? ???? ??? ??? $geoNewDeltaX = $pix_maxx - $pix_minx; ?? ???? ??? ??? $geoNewDeltaY = $pix_maxy - $pix_miny; ?? ???? ??? ??? $geoNewCoeff = $geoNewDeltaY / $geoNewDeltaX; ?? ???? ??? ??? if ($geoNewCoeff < $geo0Coeff) { ?? ???? ??? ??? ??? $newDeltaYCorrected = $geo0Coeff * $geoNewDeltaX; ?? ???? ??? ??? ??? $newDeltaYToAdd = ($newDeltaYCorrected - $geoNewDeltaY) / 2; ?? ???? ??? ??? ??? $pix_miny -= $newDeltaYToAdd; ?? ???? ??? ??? ??? $pix_maxy += $newDeltaYToAdd; ?? ???? ??? ??? } else { ?? ???? ??? ??? ??? $newDeltaXCorrected = $geoNewDeltaY / $geo0Coeff; ?? ???? ??? ??? ??? $newDeltaXToAdd = ($newDeltaXCorrected - $geoNewDeltaX) / 2; ?? ???? ??? ??? ??? $pix_minx -= $newDeltaXToAdd; ?? ???? ??? ??? ??? $pix_maxx += $newDeltaXToAdd; ?? ???? ??? ??? } $pixext->setExtent($pix_minx,$pix_miny,$pix_maxx,$pix_maxy); ??????????? } ??????? // Zoom to full extent when starting ??????? } else { ??????????? $pixext = ms_newrectObj(); ??????????? $pixext->setExtent(0, 0, $this->mapwidth, $this->mapheight); ??????? } ??????? $this->map->zoomrectangle($pixext, $this->mapwidth, $this->mapheight, $this->geoext0); ??????? PMCommon::freeMsObj($pixext); ??? } In this function Mapscript zoomrectangle is called, which according to the old PHP Mapscript documentation (https://mapserver.org/mapscript/php/index-5.6.html#mapobj) is like this: void zoomrectangle(rectObj oPixelExt, int nImageWidth, int nImageHeight, rectObj oGeorefExt) ??? Set the map extents to a given extents. ??? Parameters are : ??????????? oPixelExt (rect object) : Pixel Extents, with (0,0) at the top-left The rectangle contains the coordinates of the LL and UR coordinates in pixel. (the maxy in the rect object should be < miny value) ??????????? ------- UR (values in the rect object : maxx, maxy) ??????????? |???? | ??????????? |???? | ??????????? |???? | ??????????? ------ ??????????? LL (values in the rectobject minx, miny) ??????????? Width : width in pixel of the current image. ??????????? Height : Height in pixel of the current image. ??????????? Georef extent (rectObj) : current georef extents. The pmapper log file shows me the following values when I zoom without any problem and the result is satisfactory, that is, it zooms in on my map correctly: P.MAPPER debug info en la funci?n pmap_zoomrect de map.php $pix_minx 551.97186827847 $pix_miny 86.08332824707031 $pix_maxx 632.19478821567 $pix_maxy 120.08332824707031 $this->geoext0->minx -334.31761006289 $this->geoext0->miny -22 $this->geoext0->maxx 525.31761006289 $this->geoext0->maxy 342 My .map file has the following EXTENT -37 -22 228 334 and "wms_srs" "epsg:3857". I have updated to MS4W 4.0.4 which has MapServer and MapScript 7.7.0-dev, PHP to 7.2.31 and SWIG support. According to the current SWIG MapScript API Reference: mapscript.mapObj class mapscript.mapObj(*args) Methods: zoomRectangle(poPixRect: rectObj, width: int, height: int, poGeorefExt: rectObj, poMaxGeorefExt: rectObj) ? int[source] ??? Set the map extents to a given extents. Returns MS_SUCCESS or MS_FAILURE on error and I have adapted the code like this: ??? /************************************************ ???? * ZOOM&PAN FUNCTIONS ???? ************************************************/ ??? /** ???? * Zoom to rectangle ???? */ ??? protected function pmap_zoomrect() ??? { ??????? if (isset($_REQUEST["imgbox"])) { ??????????? $imgbox_str = $_REQUEST["imgbox"]; ??????????? pm_logDebug(3, $imgbox_str, "\$imgbox_str en la funci?n pmap_zoomrect de map.php"); ??????????? //? 642.0833282470703 40.08332824707031 685.0833282470703 68.08332824707031 ??????????? //error_log($imgbox_str); ??????????? if ($imgbox_str != "") { ??????????????? $imgbox_arr = explode(" ", $imgbox_str); ??????????????? // New map extent in image pixel ((0,0) top-left) ??????????????? $pix_minx = $imgbox_arr[0]; ??????????????? $pix_miny = $imgbox_arr[1]; ??????????????? $pix_maxx = $imgbox_arr[2]; ??????????????? $pix_maxy = $imgbox_arr[3]; ??????????????? if ($pix_minx == $pix_maxx) $pix_maxx = $pix_maxx + 3;? ## increase max extent if min==max ??????????????? if ($pix_miny == $pix_maxy) $pix_maxy = $pix_maxy - 3;? ## ??????????????? // BEFORE: ??????????????? // $pixext = ms_newrectObj(); ??????????????? // Modified by Thomas RAFFIN (SIRAP) ??????????????? // If the rectangle is not in the same proportions as the map, ??????????????? // To leave the coeff Y / X unghanged, we need to made $geoNewCoeff = $geo0Coeff... ?? ???? ??? ??? $geo0Coeff = $this->mapheight / $this->mapwidth; ?? ???? ??? ??? $geoNewDeltaX = $pix_maxx - $pix_minx; ?? ???? ??? ??? $geoNewDeltaY = $pix_maxy - $pix_miny; ?? ???? ??? ??? $geoNewCoeff = $geoNewDeltaY / $geoNewDeltaX; ?? ???? ??? ??? if ($geoNewCoeff < $geo0Coeff) { ?? ???? ??? ??? ??? $newDeltaYCorrected = $geo0Coeff * $geoNewDeltaX; ?? ???? ??? ??? ??? $newDeltaYToAdd = ($newDeltaYCorrected - $geoNewDeltaY) / 2; ?? ???? ??? ??? ??? $pix_miny -= $newDeltaYToAdd; ?? ???? ??? ??? ??? $pix_maxy += $newDeltaYToAdd; ?? ???? ??? ??? } else { ?? ???? ??? ??? ??? $newDeltaXCorrected = $geoNewDeltaY / $geo0Coeff; ?? ???? ??? ??? ??? $newDeltaXToAdd = ($newDeltaXCorrected - $geoNewDeltaX) / 2; ?? ???? ??? ??? ??? $pix_minx -= $newDeltaXToAdd; ?? ???? ??? ??? ??? $pix_maxx += $newDeltaXToAdd; ?? ???? ??? ??? } ?? ???? ??? ??? // BEFORE: ??????????????? // $pixext->setExtent($pix_minx,$pix_miny,$pix_maxx,$pix_maxy); ??????????????? // NEW: ??????????????? $pixext = new rectObj($pix_minx, $pix_miny, $pix_maxx, $pix_maxy); ??????????? } ??????? // Zoom to full extent when starting ??????? } else { ??????????? $pixext = ms_newrectObj(); ??????????? $pixext->setExtent(0, 0, $this->mapwidth, $this->mapheight); ??????? } ??????? // BEFORE: ??????? // $this->map->zoomrectangle($pixext, $this->mapwidth, $this->mapheight, $this->geoext0); ?? ???? // NEW: ??????? $maxGeoExt = null; // Null o tu valor predeterminado para la extensi?n geogr?fica m?xima ??????? $this->map->zoomRectangle($pixext, $this->mapwidth, $this->mapheight, $this->geoext0, $maxGeoExt); ??????? PMCommon::freeMsObj($pixext); ??? } but the following error is returned: [06-May-2024 12:49:32 Europe/Paris] PHP Fatal error:? Uncaught Exception: mapscript::mapObj::zoomRectangle(): General error message. image rectangle maxy >= miny in C:\ms4w\apps\sig-uco\htdocs\phpmapscriptng-swig\include\mapscript.php:2908 Stack trace: #0 C:\ms4w\apps\sig-uco\htdocs\phpmapscriptng-swig\include\mapscript.php(2908): mapobj_zoomrectangle(Resource id #10, Object(rectObj), '1503.166666', '351.16666599999...', Object(rectObj), NULL) #1 C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\map\map.php(629): mapObj->zoomRectangle(Object(rectObj), '1503.166666', '351.16666599999...', Object(rectObj), NULL) #2 C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\map\map.php(489): PMap->pmap_zoomrect() #3 C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\map\map.php(74): PMap->pmap_createMap() #4 C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\xajax\x_load.php(78): PMap->pmap_create() #5 {main} ? thrown in C:\ms4w\apps\sig-uco\htdocs\phpmapscriptng-swig\include\mapscript.php on line 2908 I have also updated to MS4W 5.0.0 which has MapServer and MapScript 8.2.0-dev and PHP to 8.2.11 and the error is the same. How should I solve the problem? Thanks. From ajph at geodata.soton.ac.uk Tue May 7 01:57:53 2024 From: ajph at geodata.soton.ac.uk (Andrew Harfoot) Date: Tue, 7 May 2024 09:57:53 +0100 Subject: [MapServer-users] WMS GetFeatureInfo default FEATURE COUNT In-Reply-To: References: Message-ID: Thanks Seth and Jukka for the responses. For the WMS in question to function as intended, the FEATURECOUNT needs to set to greater than 1, so I'll try a rewrite as Seth suggests. Andy On 03/05/2024 14:56, Seth G wrote: > [You don't often get email from sethg at geographika.co.uk. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] > > CAUTION: This e-mail originated outside the University of Southampton. > > Hi Andrew, > > It looks like this is hard-coded to be set to 1 if missing (there is a comment that it is up to the server what to do if FEATURECOUNT is not provided). > You could handle this at the web server level with a URL rewrite to add FEATURECOUNT to any GetFeatureInfo request where it is missing. > > Seth > > -- > web:https://geographika.net & https://mapserverstudio.net > twitter: @geographika > > On Fri, May 3, 2024, at 3:43 PM, Andrew Harfoot via MapServer-users wrote: >> Hi list, >> >> In a WMS GetFeatureInfo request, if the client does not include the >> FEATURECOUNT parameter then MapServer appears to default to >> FEATURECOUNT=1. Is there any way to override this default in the server >> configuration? >> >> Thanks, >> >> Andy >> >> >> _______________________________________________ >> MapServer-users mailing list >> MapServer-users at lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users -- Andy Harfoot Skype: gdi_ajph Teams: ajph at soton.ac.uk Phone: +44 2380 590566 GeoData Institute University of Southampton Southampton SO17 1BJ www.geodata.soton.ac.uk From sethg at geographika.co.uk Tue May 7 07:40:56 2024 From: sethg at geographika.co.uk (Seth G) Date: Tue, 07 May 2024 16:40:56 +0200 Subject: [MapServer-users] zoomRectangle error image rectangle maxy >= miny In-Reply-To: References: Message-ID: <986428e2-f712-4a89-885a-47171dd88013@app.fastmail.com> Hi Fernando, There is a test case for this at: https://github.com/MapServer/MapServer/blob/0cb56232d4ca0e64d747efa1db602ff08e0ea42f/src/mapscript/python/tests/cases/zoom_test.py#L99 This test has the MaxY < MinY. It looks like the rectObj represents an image rather than a map, and so the maxy and miny need to be reversed as in your original PHP code for SWIG MapScript too. The error message is: > Exception: mapscript::mapObj::zoomRectangle(): General error message. > image rectangle maxy >= miny in And is raised at https://github.com/MapServer/MapServer/blob/0cb56232d4ca0e64d747efa1db602ff08e0ea42f/src/mapscript/swiginc/mapzoom.i#L239 There is a comment in the source code where this error is thrown (I think it applies to maxy too): /* This is not a typo: "maxx >= minx". For historical reason, we * keep this as it is. See documentation for more info about this check. */ if (poPixRect->maxy >= poPixRect->miny) { msSetError(MS_MISCERR, "image rectangle maxy >= miny", "mapscript::mapObj::zoomRectangle()"); return MS_FAILURE; } See https://github.com/MapServer/MapServer/issues/3286 So you'll need to reverse the Y values below (likely as it did in the old code). The API docs should also include this note. > $this->geoext0->minx -334.31761006289 > $this->geoext0->miny -22 > $this->geoext0->maxx 525.31761006289 > $this->geoext0->maxy 342 Seth -- web:https://geographika.net & https://mapserverstudio.net twitter: @geographika On Tue, May 7, 2024, at 10:43 AM, Fernando S?nchez Garc?a via MapServer-users wrote: > Dear users, my name is Fernando and I work at the University of C?rdoba > in Spain. I have been using mapserver for several years as a user at the > University together with pmapper. Our old virtual machine has Ubuntu > Server 18.04 LTS + mapserver 7.2.1 + PHP 5.6.40 + postgres/postgis with > pmapper 4.3.2. and locally on my computer I have MS4W 3.2.3 with pmapper > 4.3.2. Unfortunately pmapper was discontinued a few years ago and > although I don't have much programming knowledge, I have started trying > to make some small changes to the pmapper code to adapt it to PHP 7/8 > (although I know other more up-to-date alternatives such as Openlayers). > I have reached the "Zoom to rectangle" function where Armin implemented > it like this: > > > ??? /************************************************ > ???? * ZOOM&PAN FUNCTIONS > ???? ************************************************/ > ??? /** > ???? * Zoom to rectangle > ???? */ > ??? protected function pmap_zoomrect() > ??? { > ??????? if (isset($_REQUEST["imgbox"])) { > ??????????? $imgbox_str = $_REQUEST["imgbox"]; > ??????????? //error_log($imgbox_str); > ??????????? if ($imgbox_str != "") { > ??????????????? $imgbox_arr = explode(" ", $imgbox_str); > ??????????????? // New map extent in image pixel ((0,0) top-left) > ??????????????? $pix_minx = $imgbox_arr[0]; > ??????????????? $pix_miny = $imgbox_arr[1]; > ??????????????? $pix_maxx = $imgbox_arr[2]; > ??????????????? $pix_maxy = $imgbox_arr[3]; > > ??????????????? if ($pix_minx == $pix_maxx) $pix_maxx = $pix_maxx + 3;? > ## increase max extent if min==max > ??????????????? if ($pix_miny == $pix_maxy) $pix_maxy = $pix_maxy - 3;? ## > > ??????????????? $pixext = ms_newrectObj(); > > ??????????????? // Modified by Thomas RAFFIN (SIRAP) > ??????????????? // If the rectangle is not in the same proportions as > the map, > ??????????????? // To leave the coeff Y / X unghanged, we need to made > $geoNewCoeff = $geo0Coeff... > ?? ???? ??? ??? $geo0Coeff = $this->mapheight / $this->mapwidth; > ?? ???? ??? ??? $geoNewDeltaX = $pix_maxx - $pix_minx; > ?? ???? ??? ??? $geoNewDeltaY = $pix_maxy - $pix_miny; > ?? ???? ??? ??? $geoNewCoeff = $geoNewDeltaY / $geoNewDeltaX; > ?? ???? ??? ??? if ($geoNewCoeff < $geo0Coeff) { > ?? ???? ??? ??? ??? $newDeltaYCorrected = $geo0Coeff * $geoNewDeltaX; > ?? ???? ??? ??? ??? $newDeltaYToAdd = ($newDeltaYCorrected - > $geoNewDeltaY) / 2; > ?? ???? ??? ??? ??? $pix_miny -= $newDeltaYToAdd; > ?? ???? ??? ??? ??? $pix_maxy += $newDeltaYToAdd; > ?? ???? ??? ??? } else { > ?? ???? ??? ??? ??? $newDeltaXCorrected = $geoNewDeltaY / $geo0Coeff; > ?? ???? ??? ??? ??? $newDeltaXToAdd = ($newDeltaXCorrected - > $geoNewDeltaX) / 2; > ?? ???? ??? ??? ??? $pix_minx -= $newDeltaXToAdd; > ?? ???? ??? ??? ??? $pix_maxx += $newDeltaXToAdd; > ?? ???? ??? ??? } > > $pixext->setExtent($pix_minx,$pix_miny,$pix_maxx,$pix_maxy); > ??????????? } > > ??????? // Zoom to full extent when starting > ??????? } else { > ??????????? $pixext = ms_newrectObj(); > ??????????? $pixext->setExtent(0, 0, $this->mapwidth, $this->mapheight); > ??????? } > > ??????? $this->map->zoomrectangle($pixext, $this->mapwidth, > $this->mapheight, $this->geoext0); > ??????? PMCommon::freeMsObj($pixext); > ??? } > > In this function Mapscript zoomrectangle is called, which according to > the old PHP Mapscript documentation > (https://mapserver.org/mapscript/php/index-5.6.html#mapobj) is like this: > > void zoomrectangle(rectObj oPixelExt, int nImageWidth, int nImageHeight, > rectObj oGeorefExt) > ??? Set the map extents to a given extents. > ??? Parameters are : > ??????????? oPixelExt (rect object) : Pixel Extents, with (0,0) at the > top-left The rectangle contains the coordinates of the LL and UR > coordinates in pixel. (the maxy in the rect object should be < miny value) > > ??????????? ------- UR (values in the rect object : maxx, maxy) > ??????????? |???? | > ??????????? |???? | > ??????????? |???? | > ??????????? ------ > ??????????? LL (values in the rectobject minx, miny) > > ??????????? Width : width in pixel of the current image. > ??????????? Height : Height in pixel of the current image. > ??????????? Georef extent (rectObj) : current georef extents. > > The pmapper log file shows me the following values when I zoom without > any problem and the result is satisfactory, that is, it zooms in on my > map correctly: > > P.MAPPER debug info en la funci?n pmap_zoomrect de map.php > $pix_minx 551.97186827847 > $pix_miny 86.08332824707031 > $pix_maxx 632.19478821567 > $pix_maxy 120.08332824707031 > $this->geoext0->minx -334.31761006289 > $this->geoext0->miny -22 > $this->geoext0->maxx 525.31761006289 > $this->geoext0->maxy 342 > > My .map file has the following EXTENT -37 -22 228 334 and "wms_srs" > "epsg:3857". > > I have updated to MS4W 4.0.4 which has MapServer and MapScript > 7.7.0-dev, PHP to 7.2.31 and SWIG support. According to the current SWIG > MapScript API Reference: > > mapscript.mapObj > class mapscript.mapObj(*args) > > Methods: > zoomRectangle(poPixRect: rectObj, width: int, height: int, poGeorefExt: > rectObj, poMaxGeorefExt: rectObj) ? int[source] > ??? Set the map extents to a given extents. Returns MS_SUCCESS or > MS_FAILURE on error > > and I have adapted the code like this: > > ??? /************************************************ > ???? * ZOOM&PAN FUNCTIONS > ???? ************************************************/ > ??? /** > ???? * Zoom to rectangle > ???? */ > ??? protected function pmap_zoomrect() > ??? { > ??????? if (isset($_REQUEST["imgbox"])) { > ??????????? $imgbox_str = $_REQUEST["imgbox"]; > > ??????????? pm_logDebug(3, $imgbox_str, "\$imgbox_str en la funci?n > pmap_zoomrect de map.php"); > ??????????? //? 642.0833282470703 40.08332824707031 685.0833282470703 > 68.08332824707031 > > ??????????? //error_log($imgbox_str); > ??????????? if ($imgbox_str != "") { > ??????????????? $imgbox_arr = explode(" ", $imgbox_str); > ??????????????? // New map extent in image pixel ((0,0) top-left) > ??????????????? $pix_minx = $imgbox_arr[0]; > ??????????????? $pix_miny = $imgbox_arr[1]; > ??????????????? $pix_maxx = $imgbox_arr[2]; > ??????????????? $pix_maxy = $imgbox_arr[3]; > > ??????????????? if ($pix_minx == $pix_maxx) $pix_maxx = $pix_maxx + 3;? > ## increase max extent if min==max > ??????????????? if ($pix_miny == $pix_maxy) $pix_maxy = $pix_maxy - 3;? ## > > ??????????????? // BEFORE: > ??????????????? // $pixext = ms_newrectObj(); > > ??????????????? // Modified by Thomas RAFFIN (SIRAP) > ??????????????? // If the rectangle is not in the same proportions as > the map, > ??????????????? // To leave the coeff Y / X unghanged, we need to made > $geoNewCoeff = $geo0Coeff... > ?? ???? ??? ??? $geo0Coeff = $this->mapheight / $this->mapwidth; > ?? ???? ??? ??? $geoNewDeltaX = $pix_maxx - $pix_minx; > ?? ???? ??? ??? $geoNewDeltaY = $pix_maxy - $pix_miny; > ?? ???? ??? ??? $geoNewCoeff = $geoNewDeltaY / $geoNewDeltaX; > ?? ???? ??? ??? if ($geoNewCoeff < $geo0Coeff) { > ?? ???? ??? ??? ??? $newDeltaYCorrected = $geo0Coeff * $geoNewDeltaX; > ?? ???? ??? ??? ??? $newDeltaYToAdd = ($newDeltaYCorrected - > $geoNewDeltaY) / 2; > ?? ???? ??? ??? ??? $pix_miny -= $newDeltaYToAdd; > ?? ???? ??? ??? ??? $pix_maxy += $newDeltaYToAdd; > ?? ???? ??? ??? } else { > ?? ???? ??? ??? ??? $newDeltaXCorrected = $geoNewDeltaY / $geo0Coeff; > ?? ???? ??? ??? ??? $newDeltaXToAdd = ($newDeltaXCorrected - > $geoNewDeltaX) / 2; > ?? ???? ??? ??? ??? $pix_minx -= $newDeltaXToAdd; > ?? ???? ??? ??? ??? $pix_maxx += $newDeltaXToAdd; > ?? ???? ??? ??? } > > ?? ???? ??? ??? // BEFORE: > ??????????????? // > $pixext->setExtent($pix_minx,$pix_miny,$pix_maxx,$pix_maxy); > > ??????????????? // NEW: > ??????????????? $pixext = new rectObj($pix_minx, $pix_miny, $pix_maxx, > $pix_maxy); > ??????????? } > > ??????? // Zoom to full extent when starting > ??????? } else { > ??????????? $pixext = ms_newrectObj(); > ??????????? $pixext->setExtent(0, 0, $this->mapwidth, $this->mapheight); > ??????? } > > ??????? // BEFORE: > ??????? // $this->map->zoomrectangle($pixext, $this->mapwidth, > $this->mapheight, $this->geoext0); > > ?? ???? // NEW: > ??????? $maxGeoExt = null; // Null o tu valor predeterminado para la > extensi?n geogr?fica m?xima > ??????? $this->map->zoomRectangle($pixext, $this->mapwidth, > $this->mapheight, $this->geoext0, $maxGeoExt); > > ??????? PMCommon::freeMsObj($pixext); > ??? } > > but the following error is returned: > > [06-May-2024 12:49:32 Europe/Paris] PHP Fatal error:? Uncaught > Exception: mapscript::mapObj::zoomRectangle(): General error message. > image rectangle maxy >= miny in > C:\ms4w\apps\sig-uco\htdocs\phpmapscriptng-swig\include\mapscript.php:2908 > Stack trace: > #0 > C:\ms4w\apps\sig-uco\htdocs\phpmapscriptng-swig\include\mapscript.php(2908): > mapobj_zoomrectangle(Resource id #10, Object(rectObj), '1503.166666', > '351.16666599999...', Object(rectObj), NULL) > #1 > C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\map\map.php(629): > mapObj->zoomRectangle(Object(rectObj), '1503.166666', > '351.16666599999...', Object(rectObj), NULL) > #2 > C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\map\map.php(489): > PMap->pmap_zoomrect() > #3 > C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\map\map.php(74): > PMap->pmap_createMap() > #4 > C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\xajax\x_load.php(78): > PMap->pmap_create() > #5 {main} > ? thrown in > C:\ms4w\apps\sig-uco\htdocs\phpmapscriptng-swig\include\mapscript.php on > line 2908 > > I have also updated to MS4W 5.0.0 which has MapServer and MapScript > 8.2.0-dev and PHP to 8.2.11 and the error is the same. > > How should I solve the problem? Thanks. > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users From jmckenna at gatewaygeomatics.com Tue May 7 14:09:42 2024 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Tue, 7 May 2024 18:09:42 -0300 Subject: [MapServer-users] Reminder: Please add your site (or OGC services) to the MapServer Gallery In-Reply-To: <26194702-d385-cc0f-7f7a-8c3a1047cd9e@gatewaygeomatics.com> References: <26194702-d385-cc0f-7f7a-8c3a1047cd9e@gatewaygeomatics.com> Message-ID: Hi everyone! A short reminder to please add your MapServer site or MapServer-run data services to the wiki page at https://github.com/MapServer/MapServer/wiki/MapServer-Site-Gallery Thanks for making the MapServer community a vibrant place, -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ From nando_gcia at hotmail.com Wed May 8 00:53:27 2024 From: nando_gcia at hotmail.com (=?UTF-8?Q?Fernando_S=C3=A1nchez_Garc=C3=ADa?=) Date: Wed, 8 May 2024 09:53:27 +0200 Subject: [MapServer-users] zoomRectangle error image rectangle maxy >= miny In-Reply-To: <986428e2-f712-4a89-885a-47171dd88013@app.fastmail.com> References: <986428e2-f712-4a89-885a-47171dd88013@app.fastmail.com> Message-ID: Thanks for everything Seth, it's already solved. The truth is that I had previously tried reversing the values of Y but the result was another error: $pixext = new rectObj($minx, $miny, $maxx, $maxy); "Error: rectObj(): Invalid rectangle. { 'minx': 596.000000 , 'miny': 85.000000 , 'maxx': 745.000000 , 'maxy': 50.000000 }" and it is because the fifth argument "imageunits" of the rectObj function is not optional (as written in the documentation at https://mapserver.org/mapscript/mapscript-api/stub/mapscript.rectObj.html), but which is mandatory. $pixext = new rectObj($minx, $miny, $maxx, $maxy, 1); "Zoom completed successfully." Best regards. El 07/05/2024 a las 16:40, Seth G escribi?: > Hi Fernando, > > There is a test case for this at: > > https://github.com/MapServer/MapServer/blob/0cb56232d4ca0e64d747efa1db602ff08e0ea42f/src/mapscript/python/tests/cases/zoom_test.py#L99 > > This test has the MaxY < MinY. It looks like the rectObj represents an image rather than a map, and so the maxy and miny need to be reversed as in your original PHP code for SWIG MapScript too. > > The error message is: > >> Exception: mapscript::mapObj::zoomRectangle(): General error message. >> image rectangle maxy >= miny in > And is raised athttps://github.com/MapServer/MapServer/blob/0cb56232d4ca0e64d747efa1db602ff08e0ea42f/src/mapscript/swiginc/mapzoom.i#L239 > > There is a comment in the source code where this error is thrown (I think it applies to maxy too): > > /* This is not a typo: "maxx >= minx". For historical reason, we > * keep this as it is. See documentation for more info about this check. */ > if (poPixRect->maxy >= poPixRect->miny) { > msSetError(MS_MISCERR, "image rectangle maxy >= miny", "mapscript::mapObj::zoomRectangle()"); > return MS_FAILURE; > } > > Seehttps://github.com/MapServer/MapServer/issues/3286 > So you'll need to reverse the Y values below (likely as it did in the old code). The API docs should also include this note. > >> $this->geoext0->minx -334.31761006289 >> $this->geoext0->miny -22 >> $this->geoext0->maxx 525.31761006289 >> $this->geoext0->maxy 342 > > Seth > > -- > web:https://geographika.net &https://mapserverstudio.net > twitter: @geographika > > On Tue, May 7, 2024, at 10:43 AM, Fernando S?nchez Garc?a via MapServer-users wrote: >> Dear users, my name is Fernando and I work at the University of C?rdoba >> in Spain. I have been using mapserver for several years as a user at the >> University together with pmapper. Our old virtual machine has Ubuntu >> Server 18.04 LTS + mapserver 7.2.1 + PHP 5.6.40 + postgres/postgis with >> pmapper 4.3.2. and locally on my computer I have MS4W 3.2.3 with pmapper >> 4.3.2. Unfortunately pmapper was discontinued a few years ago and >> although I don't have much programming knowledge, I have started trying >> to make some small changes to the pmapper code to adapt it to PHP 7/8 >> (although I know other more up-to-date alternatives such as Openlayers). >> I have reached the "Zoom to rectangle" function where Armin implemented >> it like this: >> >> >> ??? /************************************************ >> ???? * ZOOM&PAN FUNCTIONS >> ???? ************************************************/ >> ??? /** >> ???? * Zoom to rectangle >> ???? */ >> ??? protected function pmap_zoomrect() >> ??? { >> ??????? if (isset($_REQUEST["imgbox"])) { >> ??????????? $imgbox_str = $_REQUEST["imgbox"]; >> ??????????? //error_log($imgbox_str); >> ??????????? if ($imgbox_str != "") { >> ??????????????? $imgbox_arr = explode(" ", $imgbox_str); >> ??????????????? // New map extent in image pixel ((0,0) top-left) >> ??????????????? $pix_minx = $imgbox_arr[0]; >> ??????????????? $pix_miny = $imgbox_arr[1]; >> ??????????????? $pix_maxx = $imgbox_arr[2]; >> ??????????????? $pix_maxy = $imgbox_arr[3]; >> >> ??????????????? if ($pix_minx == $pix_maxx) $pix_maxx = $pix_maxx + 3; >> ## increase max extent if min==max >> ??????????????? if ($pix_miny == $pix_maxy) $pix_maxy = $pix_maxy - 3;? ## >> >> ??????????????? $pixext = ms_newrectObj(); >> >> ??????????????? // Modified by Thomas RAFFIN (SIRAP) >> ??????????????? // If the rectangle is not in the same proportions as >> the map, >> ??????????????? // To leave the coeff Y / X unghanged, we need to made >> $geoNewCoeff = $geo0Coeff... >> ?? ???? ??? ??? $geo0Coeff = $this->mapheight / $this->mapwidth; >> ?? ???? ??? ??? $geoNewDeltaX = $pix_maxx - $pix_minx; >> ?? ???? ??? ??? $geoNewDeltaY = $pix_maxy - $pix_miny; >> ?? ???? ??? ??? $geoNewCoeff = $geoNewDeltaY / $geoNewDeltaX; >> ?? ???? ??? ??? if ($geoNewCoeff < $geo0Coeff) { >> ?? ???? ??? ??? ??? $newDeltaYCorrected = $geo0Coeff * $geoNewDeltaX; >> ?? ???? ??? ??? ??? $newDeltaYToAdd = ($newDeltaYCorrected - >> $geoNewDeltaY) / 2; >> ?? ???? ??? ??? ??? $pix_miny -= $newDeltaYToAdd; >> ?? ???? ??? ??? ??? $pix_maxy += $newDeltaYToAdd; >> ?? ???? ??? ??? } else { >> ?? ???? ??? ??? ??? $newDeltaXCorrected = $geoNewDeltaY / $geo0Coeff; >> ?? ???? ??? ??? ??? $newDeltaXToAdd = ($newDeltaXCorrected - >> $geoNewDeltaX) / 2; >> ?? ???? ??? ??? ??? $pix_minx -= $newDeltaXToAdd; >> ?? ???? ??? ??? ??? $pix_maxx += $newDeltaXToAdd; >> ?? ???? ??? ??? } >> >> $pixext->setExtent($pix_minx,$pix_miny,$pix_maxx,$pix_maxy); >> ??????????? } >> >> ??????? // Zoom to full extent when starting >> ??????? } else { >> ??????????? $pixext = ms_newrectObj(); >> ??????????? $pixext->setExtent(0, 0, $this->mapwidth, $this->mapheight); >> ??????? } >> >> ??????? $this->map->zoomrectangle($pixext, $this->mapwidth, >> $this->mapheight, $this->geoext0); >> ??????? PMCommon::freeMsObj($pixext); >> ??? } >> >> In this function Mapscript zoomrectangle is called, which according to >> the old PHP Mapscript documentation >> (https://mapserver.org/mapscript/php/index-5.6.html#mapobj) is like this: >> >> void zoomrectangle(rectObj oPixelExt, int nImageWidth, int nImageHeight, >> rectObj oGeorefExt) >> ??? Set the map extents to a given extents. >> ??? Parameters are : >> ??????????? oPixelExt (rect object) : Pixel Extents, with (0,0) at the >> top-left The rectangle contains the coordinates of the LL and UR >> coordinates in pixel. (the maxy in the rect object should be < miny value) >> >> ??????????? ------- UR (values in the rect object : maxx, maxy) >> ??????????? |???? | >> ??????????? |???? | >> ??????????? |???? | >> ??????????? ------ >> ??????????? LL (values in the rectobject minx, miny) >> >> ??????????? Width : width in pixel of the current image. >> ??????????? Height : Height in pixel of the current image. >> ??????????? Georef extent (rectObj) : current georef extents. >> >> The pmapper log file shows me the following values when I zoom without >> any problem and the result is satisfactory, that is, it zooms in on my >> map correctly: >> >> P.MAPPER debug info en la funci?n pmap_zoomrect de map.php >> $pix_minx 551.97186827847 >> $pix_miny 86.08332824707031 >> $pix_maxx 632.19478821567 >> $pix_maxy 120.08332824707031 >> $this->geoext0->minx -334.31761006289 >> $this->geoext0->miny -22 >> $this->geoext0->maxx 525.31761006289 >> $this->geoext0->maxy 342 >> >> My .map file has the following EXTENT -37 -22 228 334 and "wms_srs" >> "epsg:3857". >> >> I have updated to MS4W 4.0.4 which has MapServer and MapScript >> 7.7.0-dev, PHP to 7.2.31 and SWIG support. According to the current SWIG >> MapScript API Reference: >> >> mapscript.mapObj >> class mapscript.mapObj(*args) >> >> Methods: >> zoomRectangle(poPixRect: rectObj, width: int, height: int, poGeorefExt: >> rectObj, poMaxGeorefExt: rectObj) ? int[source] >> ??? Set the map extents to a given extents. Returns MS_SUCCESS or >> MS_FAILURE on error >> >> and I have adapted the code like this: >> >> ??? /************************************************ >> ???? * ZOOM&PAN FUNCTIONS >> ???? ************************************************/ >> ??? /** >> ???? * Zoom to rectangle >> ???? */ >> ??? protected function pmap_zoomrect() >> ??? { >> ??????? if (isset($_REQUEST["imgbox"])) { >> ??????????? $imgbox_str = $_REQUEST["imgbox"]; >> >> ??????????? pm_logDebug(3, $imgbox_str, "\$imgbox_str en la funci?n >> pmap_zoomrect de map.php"); >> ??????????? //? 642.0833282470703 40.08332824707031 685.0833282470703 >> 68.08332824707031 >> >> ??????????? //error_log($imgbox_str); >> ??????????? if ($imgbox_str != "") { >> ??????????????? $imgbox_arr = explode(" ", $imgbox_str); >> ??????????????? // New map extent in image pixel ((0,0) top-left) >> ??????????????? $pix_minx = $imgbox_arr[0]; >> ??????????????? $pix_miny = $imgbox_arr[1]; >> ??????????????? $pix_maxx = $imgbox_arr[2]; >> ??????????????? $pix_maxy = $imgbox_arr[3]; >> >> ??????????????? if ($pix_minx == $pix_maxx) $pix_maxx = $pix_maxx + 3; >> ## increase max extent if min==max >> ??????????????? if ($pix_miny == $pix_maxy) $pix_maxy = $pix_maxy - 3;? ## >> >> ??????????????? // BEFORE: >> ??????????????? // $pixext = ms_newrectObj(); >> >> ??????????????? // Modified by Thomas RAFFIN (SIRAP) >> ??????????????? // If the rectangle is not in the same proportions as >> the map, >> ??????????????? // To leave the coeff Y / X unghanged, we need to made >> $geoNewCoeff = $geo0Coeff... >> ?? ???? ??? ??? $geo0Coeff = $this->mapheight / $this->mapwidth; >> ?? ???? ??? ??? $geoNewDeltaX = $pix_maxx - $pix_minx; >> ?? ???? ??? ??? $geoNewDeltaY = $pix_maxy - $pix_miny; >> ?? ???? ??? ??? $geoNewCoeff = $geoNewDeltaY / $geoNewDeltaX; >> ?? ???? ??? ??? if ($geoNewCoeff < $geo0Coeff) { >> ?? ???? ??? ??? ??? $newDeltaYCorrected = $geo0Coeff * $geoNewDeltaX; >> ?? ???? ??? ??? ??? $newDeltaYToAdd = ($newDeltaYCorrected - >> $geoNewDeltaY) / 2; >> ?? ???? ??? ??? ??? $pix_miny -= $newDeltaYToAdd; >> ?? ???? ??? ??? ??? $pix_maxy += $newDeltaYToAdd; >> ?? ???? ??? ??? } else { >> ?? ???? ??? ??? ??? $newDeltaXCorrected = $geoNewDeltaY / $geo0Coeff; >> ?? ???? ??? ??? ??? $newDeltaXToAdd = ($newDeltaXCorrected - >> $geoNewDeltaX) / 2; >> ?? ???? ??? ??? ??? $pix_minx -= $newDeltaXToAdd; >> ?? ???? ??? ??? ??? $pix_maxx += $newDeltaXToAdd; >> ?? ???? ??? ??? } >> >> ?? ???? ??? ??? // BEFORE: >> ??????????????? // >> $pixext->setExtent($pix_minx,$pix_miny,$pix_maxx,$pix_maxy); >> >> ??????????????? // NEW: >> ??????????????? $pixext = new rectObj($pix_minx, $pix_miny, $pix_maxx, >> $pix_maxy); >> ??????????? } >> >> ??????? // Zoom to full extent when starting >> ??????? } else { >> ??????????? $pixext = ms_newrectObj(); >> ??????????? $pixext->setExtent(0, 0, $this->mapwidth, $this->mapheight); >> ??????? } >> >> ??????? // BEFORE: >> ??????? // $this->map->zoomrectangle($pixext, $this->mapwidth, >> $this->mapheight, $this->geoext0); >> >> ?? ???? // NEW: >> ??????? $maxGeoExt = null; // Null o tu valor predeterminado para la >> extensi?n geogr?fica m?xima >> ??????? $this->map->zoomRectangle($pixext, $this->mapwidth, >> $this->mapheight, $this->geoext0, $maxGeoExt); >> >> ??????? PMCommon::freeMsObj($pixext); >> ??? } >> >> but the following error is returned: >> >> [06-May-2024 12:49:32 Europe/Paris] PHP Fatal error:? Uncaught >> Exception: mapscript::mapObj::zoomRectangle(): General error message. >> image rectangle maxy >= miny in >> C:\ms4w\apps\sig-uco\htdocs\phpmapscriptng-swig\include\mapscript.php:2908 >> Stack trace: >> #0 >> C:\ms4w\apps\sig-uco\htdocs\phpmapscriptng-swig\include\mapscript.php(2908): >> mapobj_zoomrectangle(Resource id #10, Object(rectObj), '1503.166666', >> '351.16666599999...', Object(rectObj), NULL) >> #1 >> C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\map\map.php(629): >> mapObj->zoomRectangle(Object(rectObj), '1503.166666', >> '351.16666599999...', Object(rectObj), NULL) >> #2 >> C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\map\map.php(489): >> PMap->pmap_zoomrect() >> #3 >> C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\map\map.php(74): >> PMap->pmap_createMap() >> #4 >> C:\ms4w\apps\sig-uco\htdocs\pmapper\pmapper-4.3.2\incphp\xajax\x_load.php(78): >> PMap->pmap_create() >> #5 {main} >> ? thrown in >> C:\ms4w\apps\sig-uco\htdocs\phpmapscriptng-swig\include\mapscript.php on >> line 2908 >> >> I have also updated to MS4W 5.0.0 which has MapServer and MapScript >> 8.2.0-dev and PHP to 8.2.11 and the error is the same. >> >> How should I solve the problem? Thanks. >> >> _______________________________________________ >> MapServer-users mailing list >> MapServer-users at lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From klassen.js at gmail.com Tue May 14 14:20:13 2024 From: klassen.js at gmail.com (Jim Klassen) Date: Tue, 14 May 2024 16:20:13 -0500 Subject: [MapServer-users] [ANNOUNCEMENT] Twin Cities Local Chapter (aka TCMUG) Meeting Message-ID: <14a1c48f-dd42-4da4-af82-1b7f554246c3@gmail.com> Forwarding for bobb since he is having email issues... All, Sorry for the late notice.? I've been distracted by other things the last couple of weeks.? So, I'm going to push this month's meeting a week and have it next week on May 15th.? Sorry if this confuses. Our next meeting will be at the Northern TapHouse in Woodbury. Map Time:4:30 - 6:00 See you there. bobb -------------- next part -------------- An HTML attachment was scrubbed... URL: From Rob.Dennett at twdb.texas.gov Fri May 17 06:40:44 2024 From: Rob.Dennett at twdb.texas.gov (Rob Dennett) Date: Fri, 17 May 2024 13:40:44 +0000 Subject: [MapServer-users] Up-to-date docker image for mapserver Message-ID: We're currently using a docker image from camptocamp (https://github.com/camptocamp/docker-mapserver) in an ECS service for our MapServer implementation. However, the 7.6 tag version we're using, along with latest 8.0 tag and even the master bundle MapServer with Apache 2.4.52 at the latest. The most recent version is 2.4.59 and we're trying to update it to resolve issues found in a pen test. Is there a more recent Docker image that people are using? Thanks, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From MarkVolz at co.lyon.mn.us Fri May 17 06:46:01 2024 From: MarkVolz at co.lyon.mn.us (Mark Volz) Date: Fri, 17 May 2024 13:46:01 +0000 Subject: [MapServer-users] Add WMTS layer to Mapserver mapfile Message-ID: Hello, Is it possible to add an external WMTS layer to a mapfile? Thank You -------------- next part -------------- An HTML attachment was scrubbed... URL: From oskar.ravhed at t-kartor.com Sat May 18 00:04:37 2024 From: oskar.ravhed at t-kartor.com (Oskar Ravhed) Date: Sat, 18 May 2024 09:04:37 +0200 Subject: [MapServer-users] Add WMTS layer to Mapserver mapfile In-Reply-To: References: Message-ID: <159e115f-bcc4-497c-9efa-30804176e8e3@t-kartor.com> Download the Wmts getcapabilites as xml file and point to that in the map file On 2024-05-17 15:46, Mark Volz via MapServer-users wrote: > > Hello, > > Is it possible to add an external WMTS layer to a mapfile? > > Thank You > > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From mapserver at geoworld.de Sun May 19 10:05:05 2024 From: mapserver at geoworld.de (Nicol Hermann) Date: Sun, 19 May 2024 19:05:05 +0200 Subject: [MapServer-users] Mapscript access to ShapeObj of GeomTransform operation Message-ID: Hallo all, I'am using Python MapScript to perform a GeomTransform centerline operation. The corresponding line looks like this: layerObj.setGeomTransform( "simplify((centerline([shape])), 100)" ) How do I get access to the calculated shapeObj of the centerline? The feature count of layerObj.numitems is 0 even if the underlaying data layer has two features. Interestingly with map.draw() everything look like expected Thanks for any pointers Nicol From sethg at geographika.co.uk Mon May 20 02:48:26 2024 From: sethg at geographika.co.uk (Seth G) Date: Mon, 20 May 2024 11:48:26 +0200 Subject: [MapServer-users] Mapscript access to ShapeObj of GeomTransform operation In-Reply-To: References: Message-ID: <78516dd7-59c4-4112-b429-60cfdfa239d3@app.fastmail.com> Hi Nicol, The setGeomTransform method simply sets the string expression for the layer - no changes to the geometries occur until rendering (with the draw function), and temporary shapes are created and rendered. If you need to access transformed geometries you'd need to loop through the shapes and use methods on the shapeObj, e.g. https://mapserver.org/mapscript/mapscript-api/stub/mapscript.shapeObj.html#mapscript.shapeObj.simplify The relatively new centerline transformation however is not part of the MapScript API. It could be added (and would be a nice addition). Seth -- web:https://geographika.net & https://mapserverstudio.net twitter: @geographika On Sun, May 19, 2024, at 7:05 PM, Nicol Hermann via MapServer-users wrote: > Hallo all, > > I'am using Python MapScript to perform a GeomTransform centerline > operation. > The corresponding line looks like this: > layerObj.setGeomTransform( "simplify((centerline([shape])), 100)" ) > > How do I get access to the calculated shapeObj of the centerline? > The feature count of > layerObj.numitems > is 0 even if the underlaying data layer has two features. > > Interestingly with map.draw() everything look like expected > > Thanks for any pointers > Nicol > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users From sethg at geographika.co.uk Mon May 20 03:03:07 2024 From: sethg at geographika.co.uk (Seth G) Date: Mon, 20 May 2024 12:03:07 +0200 Subject: [MapServer-users] Up-to-date docker image for mapserver In-Reply-To: References: Message-ID: <4abec9aa-6aef-42dd-93d8-065efec3a80a@app.fastmail.com> Hi Rob, As far as I'm aware, the camptocamp Docker image is the best maintained public Docker image. You could fork this and create a new Docker image with the updated Apache. I believe it would be a case of updating the versions in https://github.com/camptocamp/docker-mapserver/blob/master/ci/dpkg-versions.yaml (and the version being available). You could also create an issue at https://github.com/camptocamp/docker-mapserver/issues detailing the security issues with the current version of Apache used. Seth -- web:https://geographika.net & https://mapserverstudio.net twitter: @geographika On Fri, May 17, 2024, at 3:40 PM, Rob Dennett via MapServer-users wrote: > We're currently using a docker image from camptocamp (https://github.com/camptocamp/docker-mapserver) in an ECS service for our MapServer implementation. However, the 7.6 tag version we're using, along with latest 8.0 tag and even the master bundle MapServer with Apache 2.4.52 at the latest. The most recent version is 2.4.59 and we're trying to update it to resolve issues found in a pen test. Is there a more recent Docker image that people are using? > > Thanks, > Rob > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Rob.Dennett at twdb.texas.gov Mon May 20 08:10:25 2024 From: Rob.Dennett at twdb.texas.gov (Rob Dennett) Date: Mon, 20 May 2024 15:10:25 +0000 Subject: [MapServer-users] Up-to-date docker image for mapserver In-Reply-To: <4abec9aa-6aef-42dd-93d8-065efec3a80a@app.fastmail.com> References: <4abec9aa-6aef-42dd-93d8-065efec3a80a@app.fastmail.com> Message-ID: I just created an issue in the repo since 8.0 is two years old at this point. We already tried making our own fork, but are running into issues. the latest was ERROR: failed to solve: process "/bin/bash -o pipefail -cux if test \"${WITH_ORACLE}\" = \"ON\"; then export ORACLE_HOME=/usr/local/lib; fi; cmake .. -GNinja -DCMAKE_C_FLAGS=\"-O2 -DPROJ_RENAME_SYMBOLS\" -DCMAKE_CXX_FLAGS=\"-O2 -DPROJ_RENAME_SYMBOLS\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_CLIENT_WMS=1 -DWITH_CLIENT_WFS=1 -DWITH_OGCAPI=1 -DWITH_KML=1 -DWITH_SOS=1 -DWITH_XMLMAPFILE=1 -DWITH_CAIRO=1 -DWITH_RSVG=1 -DUSE_PROJ=1 -DUSE_WFS_SVR=1 -DUSE_OGCAPI_SVR=1 -DWITH_ORACLESPATIAL=${WITH_ORACLE}" did not complete successfully: exit code: 1 ________________________________ From: Seth G Sent: Monday, May 20, 2024 5:03 AM To: Rob Dennett ; MapServer Users Subject: Re: [MapServer-users] Up-to-date docker image for mapserver External: Beware of links/attachments. Hi Rob, As far as I'm aware, the camptocamp Docker image is the best maintained public Docker image. You could fork this and create a new Docker image with the updated Apache. I believe it would be a case of updating the versions in https://github.com/camptocamp/docker-mapserver/blob/master/ci/dpkg-versions.yaml (and the version being available). You could also create an issue at https://github.com/camptocamp/docker-mapserver/issues detailing the security issues with the current version of Apache used. Seth -- web:https://geographika.net & https://mapserverstudio.net twitter: @geographika On Fri, May 17, 2024, at 3:40 PM, Rob Dennett via MapServer-users wrote: We're currently using a docker image from camptocamp (https://github.com/camptocamp/docker-mapserver) in an ECS service for our MapServer implementation. However, the 7.6 tag version we're using, along with latest 8.0 tag and even the master bundle MapServer with Apache 2.4.52 at the latest. The most recent version is 2.4.59 and we're trying to update it to resolve issues found in a pen test. Is there a more recent Docker image that people are using? Thanks, Rob _______________________________________________ MapServer-users mailing list MapServer-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmckenna at gatewaygeomatics.com Fri May 24 12:27:27 2024 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Fri, 24 May 2024 16:27:27 -0300 Subject: [MapServer-users] TinyOWS 1.2.1 released Message-ID: <554ca98c-5b31-45c3-90f4-048716cc5d44@gatewaygeomatics.com> The MapServer team is pleased to announce the minor release of TinyOWS 1.2.1, in honor of its visionary, Olivier Courtin. - Changelog: https://mapserver.org/development/changelog/tinyows/changelog-1-2.html#changelog-tinyows-1-2 - Download: https://download.osgeo.org/mapserver/tinyows-1.2.1.tar.gz (TinyOWS 1.2.1 was tested successfully with MS4W 5.0 and PostreSQL 16.3 / PostGIS 3.4.2) Thanks, and thoughts for Olivier... -- The MapServer / TinyOWS Team From pcreso at yahoo.com Mon May 27 17:52:14 2024 From: pcreso at yahoo.com (Brent Wood) Date: Tue, 28 May 2024 00:52:14 +0000 (UTC) Subject: [MapServer-users] mapserver.conf question References: <1462453479.4908002.1716857534659.ref@mail.yahoo.com> Message-ID: <1462453479.4908002.1716857534659@mail.yahoo.com> Hi, I'm coming back to mapserver after many years away & have a question. Probably more later... I'm setting things up & get the error message: msLoadConfig(): Unable to access file. See mapserver.org/mapfile/config.html for more information. I'm running on Linux Mint (Ubuntu) so the default location is presumably /usr/local/etc/mapserver.conf I have copied/renamed the sample file here & given read access to www-data. Still get the error message. The docs suggest using the MAPSERVER_CONFIG_FILE environment variable. I entered the following into the /etc/environment file, which I thought was supposed to work (according to Dr Google), MAPSERVER_CONFIG_FILE="/usr/local/etc/mapserver.conf" I still get the error, and if I open a new shell (as me), the variable is not set, so that isn't working as I expected. Can anyone suggest how/where the environment variable should be set for mapserver to find the file??(or any other way to get this working) I think it would be useful to include this info in the docs, as it is not apparent to me, and perhaps others. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdmailings at duif.net Mon May 27 23:50:57 2024 From: rdmailings at duif.net (Richard Duivenvoorde) Date: Tue, 28 May 2024 08:50:57 +0200 Subject: [MapServer-users] mapserver.conf question In-Reply-To: <1462453479.4908002.1716857534659@mail.yahoo.com> References: <1462453479.4908002.1716857534659.ref@mail.yahoo.com> <1462453479.4908002.1716857534659@mail.yahoo.com> Message-ID: I was in the same position :-) What I did on my laptop (running apache): In apache.conf you can set it by using: SetEnv MAPSERVER_CONFIG_FILE /opt/mapserver/mapserver.conf If you use Nginx though (which apparently lacks env variables) I used: https://gist.github.com/lhammond/f59d8db526101e9896d0c9bdd8f15139 https://mkliver.github.io/blog/mapserver-ubuntu-nginx But maybe others have better solutions... Regards, Richard Duivenvoorde On 5/28/24 02:52, Brent Wood via MapServer-users wrote: > Hi, > > I'm coming back to mapserver after many years away & have a question. Probably more later... > > I'm setting things up & get the error message: > /msLoadConfig(): Unable to access file. See mapserver.org/mapfile/config.html for more information. > / > / > / > I'm running on Linux Mint (Ubuntu) so the default location is presumably /usr/local/etc/mapserver.conf > > I have copied/renamed the sample file here & given read access to www-data. Still get the error message. > > The docs suggest using the MAPSERVER_CONFIG_FILE environment variable. > > I entered the following into the /etc/environment file, which I thought was supposed to work (according to Dr Google), > MAPSERVER_CONFIG_FILE="/usr/local/etc/mapserver.conf" > > I still get the error, and if I open a new shell (as me), the variable is not set, so that isn't working as I expected. > > > Can anyone suggest how/where the environment variable should be set for mapserver to find the file? > (or any other way to get this working) > > I think it would be useful to include this info in the docs, as it is not apparent to me, and perhaps others. > > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users From justb4 at gmail.com Tue May 28 05:37:26 2024 From: justb4 at gmail.com (Just van den Broecke) Date: Tue, 28 May 2024 14:37:26 +0200 Subject: [MapServer-users] mapserver.conf question In-Reply-To: References: <1462453479.4908002.1716857534659.ref@mail.yahoo.com> <1462453479.4908002.1716857534659@mail.yahoo.com> Message-ID: <09f9ee02-3a85-4c2e-9e0a-7932aa8f4deb@gmail.com> Coincidence? Just today I upgraded from MapServer 7.x.y to 8.0.0 in the Docker Image I provide [1] and found that the configuration conventions have changed as per the docs. Indeed MAPSERVER_CONFIG_FILE env var should point to a global config file, which in turn points to .map file(s). There are many ways to set an environment variable dependent on your context, but if it is available where MapServer is invoked, like with CGI that should work. I don't think there is a single solution. /etc/environment is very global unless the machine is dedicated or personal. In my case running MapServer via Docker, which I can recommend, MAPSERVER_CONFIG_FILE can be set with an -e option or as an env var in a Compose file. The Docker Image uses Lighttp to invoke MS with CGI, which IMHO is a more lightweight solution than using Apache or nginx. Especially if you run multiple services behind a single frontend server (I use e.g. Traefik). [1] https://github.com/justb4/docker-mapserver Best, Just van den Broecke On 28/05/2024 08:50, Richard Duivenvoorde via MapServer-users wrote: > I was in the same position :-) > > What I did on my laptop (running apache): > > In apache.conf you can set it by using: > > SetEnv MAPSERVER_CONFIG_FILE /opt/mapserver/mapserver.conf > > If you use Nginx though (which apparently lacks env variables) I used: > > https://gist.github.com/lhammond/f59d8db526101e9896d0c9bdd8f15139 > > https://mkliver.github.io/blog/mapserver-ubuntu-nginx > > But maybe others have better solutions... > > Regards, > > Richard Duivenvoorde > > > > On 5/28/24 02:52, Brent Wood via MapServer-users wrote: >> Hi, >> >> I'm coming back to mapserver after many years away & have a question. >> Probably more later... >> >> I'm setting things up & get the error message: >> /msLoadConfig(): Unable to access file. See >> mapserver.org/mapfile/config.html for more information. >> / >> / >> / >> I'm running on Linux Mint (Ubuntu) so the default location is >> presumably /usr/local/etc/mapserver.conf >> >> I have copied/renamed the sample file here & given read access to >> www-data. Still get the error message. >> >> The docs suggest using the MAPSERVER_CONFIG_FILE environment variable. >> >> I entered the following into the /etc/environment file, which I >> thought was supposed to work (according to Dr Google), >> MAPSERVER_CONFIG_FILE="/usr/local/etc/mapserver.conf" >> >> I still get the error, and if I open a new shell (as me), the variable >> is not set, so that isn't working as I expected. >> >> >> Can anyone suggest how/where the environment variable should be set >> for mapserver to find the file? >> (or any other way to get this working) >> >> I think it would be useful to include this info in the docs, as it is >> not apparent to me, and perhaps others. >> >> >> _______________________________________________ >> MapServer-users mailing list >> MapServer-users at lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users From fernando.m.pimenta at gmail.com Tue May 28 10:08:06 2024 From: fernando.m.pimenta at gmail.com (Fernando Martins Pimenta) Date: Tue, 28 May 2024 14:08:06 -0300 Subject: [MapServer-users] Issue with Google Maps Background in MapStore Message-ID: Hello everyone, I'm encountering an issue with the Google Maps backgrounds in MapStore. When I attempt to print the maps, they do not appear, and the system does not return any error logs. Has anyone else experienced this or have any ideas on what might be causing this issue? Thank you in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From justb4 at gmail.com Tue May 28 10:56:53 2024 From: justb4 at gmail.com (Just van den Broecke) Date: Tue, 28 May 2024 19:56:53 +0200 Subject: [MapServer-users] Issue with Google Maps Background in MapStore In-Reply-To: References: Message-ID: Hi, I think this is the wrong list for your question: MapServer users, there is a MapStore users list: https://groups.google.com/g/mapstore-users Best, Just On 28/05/2024 19:08, Fernando Martins Pimenta via MapServer-users wrote: > Hello everyone, > > I'm encountering an issue with the Google Maps backgrounds in MapStore. > When I attempt to print the maps, they do not appear, and the system > does not return any error logs. > > Has anyone else experienced this or have any ideas on what might be > causing this issue? > > Thank you in advance for your help. > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users From pcreso at yahoo.com Wed May 29 01:35:07 2024 From: pcreso at yahoo.com (Brent Wood) Date: Wed, 29 May 2024 08:35:07 +0000 (UTC) Subject: [MapServer-users] mapserver.conf question In-Reply-To: References: <1462453479.4908002.1716857534659.ref@mail.yahoo.com> <1462453479.4908002.1716857534659@mail.yahoo.com> Message-ID: <2009012620.5504430.1716971707142@mail.yahoo.com> do you mean: /etc/apache2/apache2.conf Thanks.... On Tuesday, May 28, 2024 at 06:51:01 PM GMT+12, Richard Duivenvoorde wrote: I was in the same position :-) What I did on my laptop (running apache): In apache.conf you can set it by using: SetEnv MAPSERVER_CONFIG_FILE /opt/mapserver/mapserver.conf If you use Nginx though (which apparently lacks env variables) I used: https://gist.github.com/lhammond/f59d8db526101e9896d0c9bdd8f15139 https://mkliver.github.io/blog/mapserver-ubuntu-nginx But maybe others have better solutions... Regards, Richard Duivenvoorde On 5/28/24 02:52, Brent Wood via MapServer-users wrote: > Hi, > > I'm coming back to mapserver after many years away & have a question. Probably more later... > > I'm setting things up & get the error message: > /msLoadConfig(): Unable to access file. See mapserver.org/mapfile/config.html for more information. > / > / > / > I'm running on Linux Mint (Ubuntu) so the default location is presumably /usr/local/etc/mapserver.conf > > I have copied/renamed the sample file here & given read access to www-data. Still get the error message. > > The docs suggest using the MAPSERVER_CONFIG_FILE environment variable. > > I entered the following into the /etc/environment file, which I thought was supposed to work (according to Dr Google), > MAPSERVER_CONFIG_FILE="/usr/local/etc/mapserver.conf" > > I still get the error, and if I open a new shell (as me), the variable is not set, so that isn't working as I expected. > > > Can anyone suggest how/where the environment variable should be set for mapserver to find the file? > (or any other way to get this working) > > I think it would be useful to include this info in the docs, as it is not apparent to me, and perhaps others. > > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.greenwood at gmail.com Wed May 29 10:58:46 2024 From: richard.greenwood at gmail.com (Richard Greenwood) Date: Wed, 29 May 2024 11:58:46 -0600 Subject: [MapServer-users] mapserver.conf question In-Reply-To: <2009012620.5504430.1716971707142@mail.yahoo.com> References: <1462453479.4908002.1716857534659.ref@mail.yahoo.com> <1462453479.4908002.1716857534659@mail.yahoo.com> <2009012620.5504430.1716971707142@mail.yahoo.com> Message-ID: If you're running MapServer under Apache as a FastCGI (and hopefully you are because it's much faster than regular CGI) I believe you need: FcgidInitialEnv MAPSERVER_CONFIG_FILE "/path/to/your/mapserver.conf" In your apache2.conf or one of its includes. On Wed, May 29, 2024 at 2:35?AM Brent Wood via MapServer-users < mapserver-users at lists.osgeo.org> wrote: > do you mean: > > /etc/apache2/apache2.conf > > Thanks.... > > On Tuesday, May 28, 2024 at 06:51:01 PM GMT+12, Richard Duivenvoorde < > rdmailings at duif.net> wrote: > > > I was in the same position :-) > > What I did on my laptop (running apache): > > In apache.conf you can set it by using: > > SetEnv MAPSERVER_CONFIG_FILE /opt/mapserver/mapserver.conf > > If you use Nginx though (which apparently lacks env variables) I used: > > https://gist.github.com/lhammond/f59d8db526101e9896d0c9bdd8f15139 > > https://mkliver.github.io/blog/mapserver-ubuntu-nginx > > But maybe others have better solutions... > > Regards, > > Richard Duivenvoorde > > > > On 5/28/24 02:52, Brent Wood via MapServer-users wrote: > > Hi, > > > > I'm coming back to mapserver after many years away & have a question. > Probably more later... > > > > I'm setting things up & get the error message: > > /msLoadConfig(): Unable to access file. See > mapserver.org/mapfile/config.html for more information. > > / > > / > > / > > I'm running on Linux Mint (Ubuntu) so the default location is presumably > /usr/local/etc/mapserver.conf > > > > I have copied/renamed the sample file here & given read access to > www-data. Still get the error message. > > > > The docs suggest using the MAPSERVER_CONFIG_FILE environment variable. > > > > I entered the following into the /etc/environment file, which I thought > was supposed to work (according to Dr Google), > > MAPSERVER_CONFIG_FILE="/usr/local/etc/mapserver.conf" > > > > I still get the error, and if I open a new shell (as me), the variable > is not set, so that isn't working as I expected. > > > > > > Can anyone suggest how/where the environment variable should be set for > mapserver to find the file? > > (or any other way to get this working) > > > > I think it would be useful to include this info in the docs, as it is > not apparent to me, and perhaps others. > > > > > > _______________________________________________ > > MapServer-users mailing list > > MapServer-users at lists.osgeo.org > > https://lists.osgeo.org/mailman/listinfo/mapserver-users > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -- Richard W. Greenwood www.greenwoodmap.com -------------- next part -------------- An HTML attachment was scrubbed... URL: