From bahbouba.909 at gmail.com Sat Oct 1 09:24:43 2022 From: bahbouba.909 at gmail.com (Boubacar Bah) Date: Sat, 1 Oct 2022 18:24:43 +0200 Subject: [MapServer-users] Asking Help Message-ID: Hello, I really need your help. By the way, I'm on an entity editing application. the problem is that the edition is going perfectly but the storage to the postgesql database does not take place. here is the link to the source code: https://pastebin.com/VZP9Y5EQ if someone can help me find the error of the transition to the data abse. thank you in advance NB: I use Tinyows with the wfs-t openlayer, Mapserver, and postgresql -------------- next part -------------- An HTML attachment was scrubbed... URL: From antonis at antonischristofides.com Sun Oct 2 04:51:39 2022 From: antonis at antonischristofides.com (Antonis Christofides) Date: Sun, 2 Oct 2022 14:51:39 +0300 Subject: [MapServer-users] WMS: Not all features show, depending on how I zoom and pan In-Reply-To: <895e9d3d-cc0e-4a4f-adcd-a76ba66db6c2@app.fastmail.com> References: <3be4f242-4b24-5584-9e07-be3537a686c0@antonischristofides.com> <895e9d3d-cc0e-4a4f-adcd-a76ba66db6c2@app.fastmail.com> Message-ID: <6c5bfd74-fa67-9668-2957-cc32b63826d5@antonischristofides.com> An HTML attachment was scrubbed... URL: From public at postholer.com Sun Oct 2 07:53:00 2022 From: public at postholer.com (Scott) Date: Sun, 2 Oct 2022 07:53:00 -0700 Subject: [MapServer-users] WMS: Not all features show, depending on how I zoom and pan In-Reply-To: <6c5bfd74-fa67-9668-2957-cc32b63826d5@antonischristofides.com> References: <3be4f242-4b24-5584-9e07-be3537a686c0@antonischristofides.com> <895e9d3d-cc0e-4a4f-adcd-a76ba66db6c2@app.fastmail.com> <6c5bfd74-fa67-9668-2957-cc32b63826d5@antonischristofides.com> Message-ID: <1ef014b2-e17e-889d-9bb4-86015422e565@postholer.com> It would be interesting if you could change your 'irrigation-network.gml' into a different format, say .shp, something like: ogr2ogr irrigation-network.shp irrigation-network.gml Then try that as a data source in your layer and see if your results differ. This would might help us distinguish between a driver issue and a mapserver issue. On 10/2/22 04:51, Antonis Christofides wrote: > Hello Seth, > > Thanks for replying. I experimented and found out there's no difference > if I use something minimal such as what you suggested. What does make a > difference is the CRS: if I tell QGIS to use EPSG:2100 (Greek grid?the > CRS the data files use), then everything works fine. If I use 4326 or > 3857, then the problem appears. Therefore it appears that the problem is > with reprojecting (as the stackexchange user "nmtoken" had suspected). > Leaflet seems to be requesting 3857. > > What would be the right course of action here? Should I tell Leaflet to > do the reprojection instead? Should I investigate further why mapserver > has trouble reprojecting (and how would I do that)? Should I reproject > my data files (GML) offline and store them in 3857 instead of 2100? Is > there any common/best practice regarding this? > > Thanks! > > Antonis > > > > On 28/09/2022 17.47, Seth G wrote: >> Hi, >> >> Is there any change if you update the layer to have a single class >> with a simple line (no EXPRESSION, LABEL, MAXSCALEDENOM)? >> >> E.g. >> >> ??????? CLASS >> ??????????? STYLE >> ??????????????? COLOR 0 0 255 >> ??????????????? WIDTH 6 >> ??????????? END >> >> Seth >> >> -- >> web:https://geographika.net >> twitter: @geographika >> >> On Wed, Sep 28, 2022, at 1:03 PM, Antonis Christofides wrote: >>> >>> Hello, >>> >>> I have a problem that has already been discussed in stackexchange >>> (https://gis.stackexchange.com/questions/440902/mapserver-wms-not-all-features-show-depending-on-how-i-zoom-and-pan ), but without solution so far. >>> >>> I'm repeating the full text here, but if there's any problem with the >>> images it might be better to go to stackexchange to read it. >>> >>> Here is how QGIS shows an irrigation network, received by MapServer >>> via WMS and superimposed on OpenStreetMap: >>> >>> enter image description here >>> >>> Here is the same thing, but slightly panned to the right: >>> >>> enter image description here >>> >>> Several items are obviously missing. In fact there are items missing >>> in the top picture as well. Different items become visible as I zoom >>> and pan differently. >>> >>> Since this pretty much tells the whole story, I'm not going into more >>> details. MapServer version is 7.6.2 (prepackaged for Debian). The >>> base URL is >>> https://poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/aira-poros/mapserver/extralayers.map . Finally, below I paste the interesting parts of the mapfile. >>> >>> Thanks! >>> >>> Antonis >>> >>> >>> >>> >>> |MAP NAME "aira-poros" STATUS ON SIZE 9040 7731 EXTENT 103986.57 >>> 3850796.18 1007945.14 4623933.00 UNITS meters PROJECTION >>> "init=epsg:2100" END CONFIG MS_ERRORFILE >>> "/var/log/mapserver/extralayers.log" # [Omitting some OUTPUTFORMAT >>> sections] WEB IMAGEPATH "/var/cache/mapserver/" IMAGEURL >>> "/mapserver_tmp/" METADATA "wms_title" "Aira Poros" >>> "wms_onlineresource" >>> "https://poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/aira-poros/mapserver/extralayers.map&" "wms_srs" "EPSG:4326 EPSG:2100 EPSG:3857" "wms_enable_request" "*" "wms_feature_info_mime_type" "text/html" "wfs_title" "Aira Poros" "wfs_onlineresource" "https://poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/aira-poros/mapserver/extralayers.map&" "wfs_srs" "EPSG:2100 EPSG:4326 EPSG:3857" "wfs_enable_request" "*" END END LAYER NAME "irrigation-network" TYPE LINE CONNECTIONTYPE OGR CONNECTION "irrigation-network.gml" METADATA "wms_title" "Irrigation network" "wfs_title" "Irrigation network" "gml_include_items" "all" "gml_featureid" "id" END STATUS ON PROJECTION "init=epsg:2100" END CLASSITEM 'category' CLASS EXPRESSION '1' STYLE COLOR 0 0 255 OPACITY 50 WIDTH 6 END LABEL COLOR 0 0 255 ANGLE FOLLOW OFFSET 5 99 MAXSCALEDENOM 10000 TEXT "[irri_code]" END LABEL COLOR 0 0 255 ANGLE FOLLOW OFFSET -8 99 MAXSCALEDENOM 10000 EXPRESSION (NOT('[Diameter]' = '')) TEXT "D=[Diameter] mm" END END # [Omitting three more classes] END # [Omitting four more layers] END| >>> _______________________________________________ >>> 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 mapserverlearn at outlook.com Tue Oct 4 12:33:22 2022 From: mapserverlearn at outlook.com (b g) Date: Tue, 4 Oct 2022 19:33:22 +0000 Subject: [MapServer-users] Swig Mapscript Still Fails to Build with PHP 8 In-Reply-To: References: <8ede69cd-1045-4080-ff45-100ae42f1bb5@gatewaygeomatics.com> <7d501b9d-8708-9796-d97f-dea589888270@gatewaygeomatics.com> Message-ID: Hello Jeff, In response to my last message I had an update. As it turns out, I mistakenly overwrote some code in my php.ini file that was referencing the 7.6.4 MapServer file in the "extension_dir =" setting. It is now set to the current version and everything is working now. Thank you so much again for all your help! - bg ________________________________ From: MapServer-users on behalf of b g Sent: Wednesday, September 28, 2022 3:34 PM To: mapserver-users at lists.osgeo.org Subject: [MapServer-users] Swig Mapscript Still Fails to Build with PHP 8 Jeff, I think I figured out what I was missing earlier regarding the build. Those lines you provided me for the Swig setup provided a successful build for cmake to compile. As of right now, I have: mapserv -v MapServer version 8.0.0 php -v PHP 8.0.23 With a warning PHP Warning: PHP Startup: Unable to load dynamic library 'php_mapscriptng.so' (tried: /usr/local/lib/php/pecl/20190902/php_mapscriptng.so (dlopen(/usr/local/lib/php/pecl/20190902/php_mapscriptng.so, 9): image not found), /usr/local/lib/php/pecl/20190902/php_mapscriptng.so.so (dlopen(/usr/local/lib/php/pecl/20190902/php_mapscriptng.so.so, 9): image not found)) in Unknown on line 0 and swig -version SWIG Version 4.1.0 However, I think I'm still missing something (possibly related to the PHP warning above). The page is unable load due to -- I'm guessing the Swig Mapscript library being unable to be referenced. I looked in the README files provided within the MapServer directory and within the README.rst it says: "The main MapScript SWIG interface file is ``mapscript/mapscript.i``. This file includes specific class interface files from ``mapscript/swiginc`` and language specific code from the language directories." So I added that in an include statement at the top of the PHP index file but it still doesn't work. Is the mapscript.i file what is supposed to replace the mapscript.php file? I know you are on the Windows side of things so hopefully if you don't know the answer to this question then maybe someone else will. And thank you for the link to the wiki page. I have a very detailed guide (that I have been polishing as I go along) that I will add to that page for other mac users. Thanks, bg -------------- next part -------------- An HTML attachment was scrubbed... URL: From timothy.kempisty at noaa.gov Thu Oct 6 10:46:45 2022 From: timothy.kempisty at noaa.gov (Tim Kempisty) Date: Thu, 6 Oct 2022 13:46:45 -0400 Subject: [MapServer-users] mapserver 8 - CGI map_object substitutions broken? Message-ID: <0C60A50E-A670-4D83-98BD-67C1833EA7D3@noaa.gov> Good afternoon, all. I am migrating a project from MS7 to the new Mapserver 8.0.0, and I've stumbled upon evidence that map_object notation support for CGI variable substitution may be broken. Here's the relevant doc for CGI Controls: https://mapserver.org/cgi/controls.html Scoll down to the heading: "Changing map file parameters via a form or a URL" We have been using the map_object notation method to set custom image sizes and font sizes. Excuse the messy query string. The important parts are "&map_size" and "&map.layer[...]" /var/www/cgi-bin/mapserv.cgi -nh "QUERY_STRING=mode=map&map=/usr/local/mapfiles/kempisty/nbm_view/foo.map&layer=genNoDec&model=blend&ver=v4.0§or=conus&element=maxt&issuancetime=2022-10-06T14:00&validtime=2022-10-08T06:00&mapext=-3270279.3477121103%20-163255.0404466032%202666810.2533767014%203144901.0582670807&map_size=1215+677&map.layer[genNoDec].class[0].label[0]=SIZE+8" > /var/www/html/kempisty/foo7.png MS7 gives a map size 1215x677 with labels rendered in 8 point font, as expected. The same command, using mapserver 8 instead of 7, gives an image size 2345x1597 (map size as defined in the mapfile) with labels rendered in 13 point font (also as defined in the mapfile). Using MS8... if I send &mapsize=1215+677 instead of &map_size=1215+677 ... I will get the image at the correct size. So the predefined CGI control variables still work. It suggests to me, it is only the map_object notation method that is broken. Has that been disabled in MS8, or is it now subject to a new configuration requirement that I'm not aware of? Relevant string isolated for reference: &map_size=1215+677&map.layer[genNoDec].class[0].label[0]=SIZE+8" I'm open to other methods of changing font size on the fly. We did it this way because %var% runtime substitutions aren't supported for CLASS: LABEL: SIZE. -Tim Kempisty -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdlime at gmail.com Thu Oct 6 12:49:32 2022 From: sdlime at gmail.com (Steve Lime) Date: Thu, 6 Oct 2022 14:49:32 -0500 Subject: [MapServer-users] mapserver 8 - CGI map_object substitutions broken? In-Reply-To: <0C60A50E-A670-4D83-98BD-67C1833EA7D3@noaa.gov> References: <0C60A50E-A670-4D83-98BD-67C1833EA7D3@noaa.gov> Message-ID: Hi Tim: I was wondering if I'd see any messages on that topic. Short story is that the functionality was removed in MS8. I never liked the all-or-nothing aspect of it and was working on a method to control which objects would be allowed to be updated. The solutions I came up with were convoluted and were going to add a lot of complexity to the codebase for little value. That functionality is poorly documented and by itself overly complicates the code. So after a note to mapserver-users trying to judge how much it was used - with limited replies - it was decided to remove it. I'm dealing with my own upgrade issues as a result, but it's worth it in the end IMHO. If necessary, it's better to revisit with another method - ideally something along the lines of runsubs. The challenge is specifying when to apply them and how to validate values. Strings are easy, but numeric/color values aren't so we'd need to do something like add runtime bindings (similar to attribute bindings) so you'd write SIZE %mysize% instead. One advantage being you could reuse the variable across layers. So, what are the options right now? It sort of depends on your needs. Do you need to only support a couple of sizes for a class or do you truly need *any* size? Options include: - multiple mapfiles - probably using includes to limit redundancy - class groups - if you're using a db backend I think attribute bindings could work paired with runsubs DATA "shape FROM (select *, %textsize% AS textsize FROM ...) VALIDATION "textsize_default" "13" "textsize" "^8|10|12|14$" END CLASS LABEL SIZE [textsize] # I think attribute binding works here END END - MapScript - load the mapfile, do the changes you need, render the map Happy to discuss further and perhaps other folks have ideas. --Steve On Thu, Oct 6, 2022 at 12:47 PM Tim Kempisty via MapServer-users < mapserver-users at lists.osgeo.org> wrote: > Good afternoon, all. > > I am migrating a project from MS7 to the new Mapserver 8.0.0, and I've > stumbled upon evidence that map_object notation support for CGI variable > substitution may be broken. > > Here's the relevant doc for CGI Controls: > > https://mapserver.org/cgi/controls.html > > Scoll down to the heading: "Changing map file parameters via a form or a > URL" > We have been using the map_object notation method to set custom image > sizes and font sizes. > > Excuse the messy query string. The important parts are "&map_size" and > "&map.layer[...]" > > /var/www/cgi-bin/mapserv.cgi -nh > "QUERY_STRING=mode=map&map=/usr/local/mapfiles/kempisty/nbm_view/foo.map&layer=genNoDec&model=blend&ver=v4.0§or=conus&element=maxt&issuancetime=2022-10-06T14:00&validtime=2022-10-08T06:00&mapext=-3270279.3477121103%20-163255.0404466032%202666810.2533767014%203144901.0582670807&map_size=1215+677&map.layer[genNoDec].class[0].label[0]=SIZE+8" > > /var/www/html/kempisty/foo7.png > > MS7 gives a map size 1215x677 with labels rendered in 8 point font, as > expected. The same command, using mapserver 8 instead of 7, gives an > image size 2345x1597 (map size as defined in the mapfile) with labels > rendered in 13 point font (also as defined in the mapfile). > > Using MS8... if I send &mapsize=1215+677 instead of &map_size=1215+677 ... > I will get the image at the correct size. So the predefined CGI control > variables still work. It suggests to me, it is only the map_object > notation method that is broken. Has that been disabled in MS8, or is it > now subject to a new configuration requirement that I'm not aware of? > > Relevant string isolated for reference: > &map_size=1215+677&map.layer[genNoDec].class[0].label[0]=SIZE+8" > > I'm open to other methods of changing font size on the fly. We did it > this way because %var% runtime substitutions aren't supported for CLASS: > LABEL: SIZE. > > -Tim Kempisty > > _______________________________________________ > 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 timothy.kempisty at noaa.gov Fri Oct 7 08:34:09 2022 From: timothy.kempisty at noaa.gov (Tim Kempisty) Date: Fri, 7 Oct 2022 11:34:09 -0400 Subject: [MapServer-users] mapserver 8 - CGI map_object substitutions broken? In-Reply-To: References: <0C60A50E-A670-4D83-98BD-67C1833EA7D3@noaa.gov> Message-ID: <2E505B9C-A80B-43CD-A4C0-F24222D5CFF3@noaa.gov> Well that's... not shocking. I'm imagining the regex that might sanitize a URL with all that syntax in it... uuuuughh... *crumplecrumplecrumple* ~toss~ As for my own work... I realized yesterday late that I was going to have to find an alternative anyway. All these maps need to go into Mapcache. Turning that map_object notation into an intuitive mapcache dimension is a big ol Nope. I can likely pass in a parameter on the URL (&fontsize=10) and then use multiple classes in the vein of CLASS: EXPRESSION (%fontsize% = 10). Voila. Easy mapcache dimension, easy sanitizing, supports a reasonable number of font sizes. So I guess the item for the maintainers to fix is actually the documentation ( https://mapserver.org/cgi/controls.html ) which still makes it look like you can use map_object notation on the URL in MS8. Thanks for the info! -Tim > On Oct 6, 2022, at 3:49 PM, Steve Lime wrote: > > Hi Tim: I was wondering if I'd see any messages on that topic. Short story is that the functionality was removed in MS8. I never liked the all-or-nothing aspect of it and was working on a method to control which objects would be allowed to be updated. The solutions I came up with were convoluted and were going to add a lot of complexity to the codebase for little value. That functionality is poorly documented and by itself overly complicates the code. So after a note to mapserver-users trying to judge how much it was used - with limited replies - it was decided to remove it. I'm dealing with my own upgrade issues as a result, but it's worth it in the end IMHO. > > If necessary, it's better to revisit with another method - ideally something along the lines of runsubs. The challenge is specifying when to apply them and how to validate values. Strings are easy, but numeric/color values aren't so we'd need to do something like add runtime bindings (similar to attribute bindings) so you'd write SIZE %mysize% instead. One advantage being you could reuse the variable across layers. > > So, what are the options right now? It sort of depends on your needs. Do you need to only support a couple of sizes for a class or do you truly need *any* size? Options include: > multiple mapfiles - probably using includes to limit redundancy > class groups > if you're using a db backend I think attribute bindings could work paired with runsubs > DATA "shape FROM (select *, %textsize% AS textsize FROM ...) > VALIDATION > "textsize_default" "13" > "textsize" "^8|10|12|14$" > END > CLASS > LABEL > SIZE [textsize] # I think attribute binding works here > END > END > MapScript - load the mapfile, do the changes you need, render the map > Happy to discuss further and perhaps other folks have ideas. > > --Steve > > On Thu, Oct 6, 2022 at 12:47 PM Tim Kempisty via MapServer-users > wrote: > Good afternoon, all. > > I am migrating a project from MS7 to the new Mapserver 8.0.0, and I've stumbled upon evidence that map_object notation support for CGI variable substitution may be broken. > > Here's the relevant doc for CGI Controls: > > https://mapserver.org/cgi/controls.html > > Scoll down to the heading: "Changing map file parameters via a form or a URL" > We have been using the map_object notation method to set custom image sizes and font sizes. > > Excuse the messy query string. The important parts are "&map_size" and "&map.layer[...]" > > /var/www/cgi-bin/mapserv.cgi -nh "QUERY_STRING=mode=map&map=/usr/local/mapfiles/kempisty/nbm_view/foo.map&layer=genNoDec&model=blend&ver=v4.0§or=conus&element=maxt&issuancetime=2022-10-06T14:00&validtime=2022-10-08T06:00&mapext=-3270279.3477121103%20-163255.0404466032%202666810.2533767014%203144901.0582670807&map_size=1215+677&map.layer[genNoDec].class[0].label[0]=SIZE+8" > /var/www/html/kempisty/foo7.png > > MS7 gives a map size 1215x677 with labels rendered in 8 point font, as expected. The same command, using mapserver 8 instead of 7, gives an image size 2345x1597 (map size as defined in the mapfile) with labels rendered in 13 point font (also as defined in the mapfile). > > Using MS8... if I send &mapsize=1215+677 instead of &map_size=1215+677 ... I will get the image at the correct size. So the predefined CGI control variables still work. It suggests to me, it is only the map_object notation method that is broken. Has that been disabled in MS8, or is it now subject to a new configuration requirement that I'm not aware of? > > Relevant string isolated for reference: > &map_size=1215+677&map.layer[genNoDec].class[0].label[0]=SIZE+8" > > I'm open to other methods of changing font size on the fly. We did it this way because %var% runtime substitutions aren't supported for CLASS: LABEL: SIZE. > > -Tim Kempisty > > _______________________________________________ > 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 steve.lime at state.mn.us Fri Oct 7 10:52:08 2022 From: steve.lime at state.mn.us (Lime, Steve D (MNIT)) Date: Fri, 7 Oct 2022 17:52:08 +0000 Subject: [MapServer-users] mapserver 8 - CGI map_object substitutions broken? In-Reply-To: <2E505B9C-A80B-43CD-A4C0-F24222D5CFF3@noaa.gov> References: <0C60A50E-A670-4D83-98BD-67C1833EA7D3@noaa.gov> <2E505B9C-A80B-43CD-A4C0-F24222D5CFF3@noaa.gov> Message-ID: Easy solution - cool. You can do that with straight runsubs and relatively easy validation. Here's a nice document on the topic https://www.regextutorial.org/regex-for-numbers-and-ranges.php. I updated an existing ticket to clean that documentation up and remove some other cruft towards the bottom of that documentation. From: MapServer-users On Behalf Of Tim Kempisty via MapServer-users Sent: Friday, October 7, 2022 10:34 AM To: Steve Lime Cc: mapserver-users at lists.osgeo.org Subject: Re: [MapServer-users] mapserver 8 - CGI map_object substitutions broken? This message may be from an external email source. Do not select links or open attachments unless verified. Report all suspicious emails to Minnesota IT Services Security Operations Center. ________________________________ Well that's... not shocking. I'm imagining the regex that might sanitize a URL with all that syntax in it... uuuuughh... *crumplecrumplecrumple* ~toss~ As for my own work... I realized yesterday late that I was going to have to find an alternative anyway. All these maps need to go into Mapcache. Turning that map_object notation into an intuitive mapcache dimension is a big ol Nope. I can likely pass in a parameter on the URL (&fontsize=10) and then use multiple classes in the vein of CLASS: EXPRESSION (%fontsize% = 10). Voila. Easy mapcache dimension, easy sanitizing, supports a reasonable number of font sizes. So I guess the item for the maintainers to fix is actually the documentation ( https://mapserver.org/cgi/controls.html ) which still makes it look like you can use map_object notation on the URL in MS8. Thanks for the info! -Tim On Oct 6, 2022, at 3:49 PM, Steve Lime > wrote: Hi Tim: I was wondering if I'd see any messages on that topic. Short story is that the functionality was removed in MS8. I never liked the all-or-nothing aspect of it and was working on a method to control which objects would be allowed to be updated. The solutions I came up with were convoluted and were going to add a lot of complexity to the codebase for little value. That functionality is poorly documented and by itself overly complicates the code. So after a note to mapserver-users trying to judge how much it was used - with limited replies - it was decided to remove it. I'm dealing with my own upgrade issues as a result, but it's worth it in the end IMHO. If necessary, it's better to revisit with another method - ideally something along the lines of runsubs. The challenge is specifying when to apply them and how to validate values. Strings are easy, but numeric/color values aren't so we'd need to do something like add runtime bindings (similar to attribute bindings) so you'd write SIZE %mysize% instead. One advantage being you could reuse the variable across layers. So, what are the options right now? It sort of depends on your needs. Do you need to only support a couple of sizes for a class or do you truly need *any* size? Options include: * multiple mapfiles - probably using includes to limit redundancy * class groups * if you're using a db backend I think attribute bindings could work paired with runsubs DATA "shape FROM (select *, %textsize% AS textsize FROM ...) VALIDATION "textsize_default" "13" "textsize" "^8|10|12|14$" END CLASS LABEL SIZE [textsize] # I think attribute binding works here END END * MapScript - load the mapfile, do the changes you need, render the map Happy to discuss further and perhaps other folks have ideas. --Steve On Thu, Oct 6, 2022 at 12:47 PM Tim Kempisty via MapServer-users > wrote: Good afternoon, all. I am migrating a project from MS7 to the new Mapserver 8.0.0, and I've stumbled upon evidence that map_object notation support for CGI variable substitution may be broken. Here's the relevant doc for CGI Controls: https://mapserver.org/cgi/controls.html Scoll down to the heading: "Changing map file parameters via a form or a URL" We have been using the map_object notation method to set custom image sizes and font sizes. Excuse the messy query string. The important parts are "&map_size" and "&map.layer[...]" /var/www/cgi-bin/mapserv.cgi -nh "QUERY_STRING=mode=map&map=/usr/local/mapfiles/kempisty/nbm_view/foo.map&layer=genNoDec&model=blend&ver=v4.0§or=conus&element=maxt&issuancetime=2022-10-06T14:00&validtime=2022-10-08T06:00&mapext=-3270279.3477121103%20-163255.0404466032%202666810.2533767014%203144901.0582670807&map_size=1215+677&map.layer[genNoDec].class[0].label[0]=SIZE+8" > /var/www/html/kempisty/foo7.png MS7 gives a map size 1215x677 with labels rendered in 8 point font, as expected. The same command, using mapserver 8 instead of 7, gives an image size 2345x1597 (map size as defined in the mapfile) with labels rendered in 13 point font (also as defined in the mapfile). Using MS8... if I send &mapsize=1215+677 instead of &map_size=1215+677 ... I will get the image at the correct size. So the predefined CGI control variables still work. It suggests to me, it is only the map_object notation method that is broken. Has that been disabled in MS8, or is it now subject to a new configuration requirement that I'm not aware of? Relevant string isolated for reference: &map_size=1215+677&map.layer[genNoDec].class[0].label[0]=SIZE+8" I'm open to other methods of changing font size on the fly. We did it this way because %var% runtime substitutions aren't supported for CLASS: LABEL: SIZE. -Tim Kempisty _______________________________________________ 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 bob.basques at ci.stpaul.mn.us Mon Oct 10 11:38:43 2022 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Mon, 10 Oct 2022 18:38:43 +0000 Subject: [MapServer-users] OSGeo Twin Cities Local Chapter Meeting Message-ID: All, Another face to face meeting, at Bad Weather Brewery on West 7th Street. Saint Paul Mn. I know some folks will be up at GIS/LIS, but for those that stick around town . . . When: Wed. Oct 12th, 4:30 pm Where: 414 7th St W, St Paul, MN 55102 - Bad Weather Brewery See you there. Bobb My machine - - - PW19-S295-C024 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob.basques at ci.stpaul.mn.us Tue Oct 11 13:41:14 2022 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Tue, 11 Oct 2022 20:41:14 +0000 Subject: [MapServer-users] [REMINDER] OSGeo Twin Cities Local Chapter Meeting Message-ID: <44545AB6-93DB-48B3-8972-50DD2D735F4C@ci.stpaul.mn.us> All, Another face to face meeting, at Bad Weather Brewery on West 7th Street. Saint Paul Mn. I know some folks will be up at GIS/LIS, but for those that stick around town . . . When: Wed. Oct 12th, 4:30 pm Where: 414 7th St W, St Paul, MN 55102 - Bad Weather Brewery See you there. Bobb My machine - - - PW19-S295-C024 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mniemyjski at cloudferro.com Wed Oct 12 00:48:33 2022 From: mniemyjski at cloudferro.com (Marcin Niemyjski) Date: Wed, 12 Oct 2022 07:48:33 +0000 Subject: [MapServer-users] The way WMS is displayed depends on Zoom Level Message-ID: Hello, I have created mapfile based on raster data from Sentinel 1, but the way rendered data is displayed varies in dependent of zoom level. What I'am talking about: https://ibb.co/X8pTKst https://ibb.co/QF4fX48 https://ibb.co/n1tZSQZ Of course I would like to achive the effect visible on the last screenshot for all of the zoom levels. How I defined Class for raster layers in mapfile: CLASSITEM "[pixel]" CLASS ??????STYLE ????????????RANGEITEM "pixel" ????????????COLORRANGE 0 0 0 255 255 255 ????????????DATARANGE 0.02 1.05 ??????END END I would be greatful for any tips how to manage this problem (: best regards, Marcin -------------- next part -------------- An HTML attachment was scrubbed... URL: From mniemyjski at cloudferro.com Wed Oct 12 00:49:31 2022 From: mniemyjski at cloudferro.com (Marcin Niemyjski) Date: Wed, 12 Oct 2022 07:49:31 +0000 Subject: [MapServer-users] WMS in 16bit depth? Message-ID: Hello, Is it possible to exhibit WMS in 16bit depth? The goal is to provide more depth in the scale. Could I ask for a hint? Best regards, Marcin -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at home.gofferje.net Wed Oct 12 04:55:29 2022 From: lists at home.gofferje.net (Stefan Gofferje) Date: Wed, 12 Oct 2022 14:55:29 +0300 Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure Message-ID: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> Hi all, Life (and COVID) hit, so I never got anywhere with updating my weather website and taking mapserver into use there. Currently I have another project - due to the geopolitical situation: I'm working on a mobile system to provide emergency/off-grid "tactical" communication and data. It's centered on a Raspberry Pi and includes things like Meshtastic and others. One of the things I would like to add is a WMS/WFS server to provide map data via local Wifi AP to connected devices. Topographical (and other) maps of whole Finland are available under CC4 from the Finnish Land Survey through the KAPSI non-profit. The maps are in 12kx12k PNGs in a folder structure by UTM grid. See here: http://kartat.kapsi.fi/files/peruskarttarasteri_jhs180/taustavari_korkeuskayrilla/1m/etrs89/png/ The data can by rsync'd down. I'm not clear how I would configure mapserver for that. Do I have to create one map with extent and such for each PNG tile or can I point mapserver to the root directory of the data and tell it to go through it recursively and get the data from the PGW sidecar files? -Stefan -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ https://www.gofferje.net | https://www.saakeskus.fi From schroeter at netgis.de Wed Oct 12 06:37:44 2022 From: schroeter at netgis.de (Sven Schroeter) Date: Wed, 12 Oct 2022 14:37:44 +0100 Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure In-Reply-To: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> References: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> Message-ID: <52b67c8a-5055-38c0-4b1e-db659954bccc@netgis.de> Hi Stefan, I don't know if I understood you correctly, but I think the solution for you would be an image catalog, right? Then you would have only one layer for the UTM maps. In the mapfile it would look like this, in the .dbf in the column "location" would be the paths to the png data. LAYER ??? NAME "utm_data" ??? STATUS ON ?? ?MAXSCALE 8000 ??? TILEINDEX "filesindex_png.shp" ??? TILEITEM "location" ??? TYPE RASTER ??? PROCESSING "Resample=average" ?? ?CLASS ?? ?name "utm_data" ?? ?END END Greetings Sven Am 12.10.2022 um 12:55 schrieb Stefan Gofferje: > Hi all, > > Life (and COVID) hit, so I never got anywhere with updating my weather > website and taking mapserver into use there. > > Currently I have another project - due to the geopolitical situation: > I'm working on a mobile system to provide emergency/off-grid > "tactical" communication and data. It's centered on a Raspberry Pi and > includes things like Meshtastic and others. One of the things I would > like to add is a WMS/WFS server to provide map data via local Wifi AP > to connected devices. > > Topographical (and other) maps of whole Finland are available under > CC4 from the Finnish Land Survey through the KAPSI non-profit. The > maps are in 12kx12k PNGs in a folder structure by UTM grid. See here: > http://kartat.kapsi.fi/files/peruskarttarasteri_jhs180/taustavari_korkeuskayrilla/1m/etrs89/png/ > > The data can by rsync'd down. > I'm not clear how I would configure mapserver for that. Do I have to > create one map with extent and such for each PNG tile or can I point > mapserver to the root directory? of the data and tell it to go through > it recursively and get the data from the PGW sidecar files? > > -Stefan -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob.basques at ci.stpaul.mn.us Wed Oct 12 07:35:39 2022 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Wed, 12 Oct 2022 14:35:39 +0000 Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure In-Reply-To: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> References: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> Message-ID: Hi Stefan, This might help you get started: https://github.com/klassenjs/rpi-workshop/blob/master/Workshop.org We've got 7 of these used in the filed now as standalone Webservers, with Wifi access. No internet required. You just turn it on. You can add in a Battery and/or connect directly to a 12v power source like the ignition switch for power from a vehicle, and it's always on. Real low power and depending on how big a card you use, a lot of data. Our survey version has over 250k geolocated document scans available. This is a map based system, but it a whole Server Stack configuration, so should give you a good head start. We ran this as a workshop at a OSGeo conference a few years back. Bobb My machine - - - PW19-S295-C024 > > > -----Original Message----- > > > From: MapServer-users > > > On Behalf Of Stefan Gofferje > > > Sent: Wednesday, October 12, 2022 6:55 AM > > > To: mapserver-users at lists.osgeo.org > > > Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - > > > raster/PNG source in folder structure > > > > > > Think Before You Click: This email originated outside our organization. > > > > > > > > > Hi all, > > > > > > Life (and COVID) hit, so I never got anywhere with updating my weather > > > website and taking mapserver into use there. > > > > > > Currently I have another project - due to the geopolitical situation: > > > I'm working on a mobile system to provide emergency/off-grid "tactical" > > > communication and data. It's centered on a Raspberry Pi and includes > > > things like Meshtastic and others. One of the things I would like to add is > > > a WMS/WFS server to provide map data via local Wifi AP to connected > > > devices. > > > > > > Topographical (and other) maps of whole Finland are available under CC4 > > > from the Finnish Land Survey through the KAPSI non-profit. The maps > > > are in 12kx12k PNGs in a folder structure by UTM grid. See here: > > > http://kartat.kapsi.fi/files/peruskarttarasteri_jhs180/taustavari_korkeus > > > kayrilla/1m/etrs89/png/ > > > The data can by rsync'd down. > > > I'm not clear how I would configure mapserver for that. Do I have to > > > create one map with extent and such for each PNG tile or can I point > > > mapserver to the root directory of the data and tell it to go through it > > > recursively and get the data from the PGW sidecar files? > > > > > > -Stefan > > > > > > -- > > > (o_ Stefan Gofferje | SCLT, MCP, CCSA > > > //\ Reg'd Linux User #247167 | VCP #2263 > > > V_/_ https://www.gofferje.net | https://www.saakeskus.fi > > > > > > _______________________________________________ > > > MapServer-users mailing list > > > MapServer-users at lists.osgeo.org > > > https://lists.osgeo.org/mailman/listinfo/mapserver-users From sethg at geographika.co.uk Wed Oct 12 07:26:23 2022 From: sethg at geographika.co.uk (Seth G) Date: Wed, 12 Oct 2022 16:26:23 +0200 Subject: [MapServer-users] WMS in 16bit depth? In-Reply-To: References: Message-ID: <91ffa8d2-de64-486d-aa1c-64c051e974ce@app.fastmail.com> Hi Marcin, Are you trying to display raster images with more colours? You can play around with the OUTPUTFORMAT options - see details at https://mapserver.org/mapfile/outputformat.html IMAGEMODE might be what you are looking for? I've normally used these to reduce image sizes where possible. Seth -- web:https://geographika.net twitter: @geographika On Wed, Oct 12, 2022, at 9:49 AM, Marcin Niemyjski via MapServer-users wrote: > Hello, > > Is it possible to exhibit WMS in 16bit depth? The goal is to provide more depth in the scale. Could I ask for a hint? > > Best regards, > Marcin > _______________________________________________ > 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 lists at home.gofferje.net Wed Oct 12 08:53:27 2022 From: lists at home.gofferje.net (Stefan Gofferje) Date: Wed, 12 Oct 2022 18:53:27 +0300 Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure In-Reply-To: References: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> Message-ID: <0a33e219-acf4-861b-a9c8-f9b3eb613460@home.gofferje.net> Hi, On 10/12/22 17:35, Basques, Bob (CI-StPaul) wrote: > This might help you get started: > > https://github.com/klassenjs/rpi-workshop/blob/master/Workshop.org > > We've got 7 of these used in the filed now as standalone Webservers, with Wifi access. No internet required. You just turn it on. You can add in a Battery and/or connect directly to a 12v power source like the ignition switch for power from a vehicle, and it's always on. > > Real low power and depending on how big a card you use, a lot of data. Our survey version has over 250k geolocated document scans available. > > This is a map based system, but it a whole Server Stack configuration, so should give you a good head start. > > We ran this as a workshop at a OSGeo conference a few years back. Cool! Not very much detail about mapserver, though. I'm planning to throw my stuff to Github too, once I got a little further. I'm a little bit more on the complicated side with 4G/5G and potential other IP over radio being in the mix. Also looking at batman-adv for meshing and testing some ideas for voice/radio over IP. I found a very nice CM4 baseboard which is tiny and still has space for an 42mm NVME SSD, so atm I'm planning for 256G storage in addition to the EMMC. -S -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ https://www.gofferje.net | https://www.saakeskus.fi From lists at home.gofferje.net Wed Oct 12 08:57:35 2022 From: lists at home.gofferje.net (Stefan Gofferje) Date: Wed, 12 Oct 2022 18:57:35 +0300 Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure In-Reply-To: <52b67c8a-5055-38c0-4b1e-db659954bccc@netgis.de> References: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> <52b67c8a-5055-38c0-4b1e-db659954bccc@netgis.de> Message-ID: <81a032f4-9c07-db61-116e-d5ba9b708da2@home.gofferje.net> Hi, On 10/12/22 16:37, Sven Schroeter wrote: > I don't know if I understood you correctly, but I think the solution for > you would be an image catalog, right? > Then you would have only one layer for the UTM maps. > In the mapfile it would look like this, in the .dbf in the column > "location" would be the paths to the png data. > > LAYER > ??? NAME "utm_data" > ??? STATUS ON > ?? ?MAXSCALE 8000 > ??? TILEINDEX "filesindex_png.shp" > ??? TILEITEM "location" > ??? TYPE RASTER > ??? PROCESSING "Resample=average" > ?? ?CLASS > ?? ?name "utm_data" > ?? ?END > END Like here: https://mapserver.org/input/raster.html#rasters-and-tile-indexing ? I'm still a total newbie to mapserver and haven't had much time to tinker with it yet, unfortunately. But that looks easy enough. So, basically, I 'find' all pngs/pgws, move them from the subfolders into one folder and run gdaltindex over the folder. And that creates a shapefile which I use as data source? Let's try that. -S -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ https://www.gofferje.net | https://www.saakeskus.fi From bob.basques at ci.stpaul.mn.us Wed Oct 12 09:02:19 2022 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Wed, 12 Oct 2022 16:02:19 +0000 Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure In-Reply-To: <0a33e219-acf4-861b-a9c8-f9b3eb613460@home.gofferje.net> References: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> <0a33e219-acf4-861b-a9c8-f9b3eb613460@home.gofferje.net> Message-ID: Mapserver is in there, but in it's basic configuration. Maybe I can get the author to chime in on any new capabilities with the newer RPis, he's still up on them more than I am. Bobb My machine - - - PW19-S295-C024 > > > -----Original Message----- > > > From: Stefan Gofferje > > > Sent: Wednesday, October 12, 2022 10:53 AM > > > To: Basques, Bob (CI-StPaul) ; > > > mapserver-users at lists.osgeo.org > > > Subject: Re: [MapServer-users] "Emergency" map server on Raspberry Pi > > > - raster/PNG source in folder structure > > > > > > Think Before You Click: This email originated outside our organization. > > > > > > > > > Hi, > > > > > > On 10/12/22 17:35, Basques, Bob (CI-StPaul) wrote: > > > > This might help you get started: > > > > > > > > https://github.com/klassenjs/rpi- > > > workshop/blob/master/Workshop.org > > > > > > > > We've got 7 of these used in the filed now as standalone Webservers, > > > with Wifi access. No internet required. You just turn it on. You can add > > > in a Battery and/or connect directly to a 12v power source like the > > > ignition switch for power from a vehicle, and it's always on. > > > > > > > > Real low power and depending on how big a card you use, a lot of data. > > > Our survey version has over 250k geolocated document scans available. > > > > > > > > This is a map based system, but it a whole Server Stack configuration, > > > so should give you a good head start. > > > > > > > > We ran this as a workshop at a OSGeo conference a few years back. > > > > > > Cool! Not very much detail about mapserver, though. I'm planning to > > > throw my stuff to Github too, once I got a little further. I'm a little bit > > > more on the complicated side with 4G/5G and potential other IP over > > > radio being in the mix. Also looking at batman-adv for meshing and > > > testing some ideas for voice/radio over IP. I found a very nice CM4 > > > baseboard which is tiny and still has space for an 42mm NVME SSD, so > > > atm I'm planning for 256G storage in addition to the EMMC. > > > > > > -S > > > > > > -- > > > (o_ Stefan Gofferje | SCLT, MCP, CCSA > > > //\ Reg'd Linux User #247167 | VCP #2263 > > > V_/_ https://www.gofferje.net | https://www.saakeskus.fi From lists at home.gofferje.net Wed Oct 12 09:05:28 2022 From: lists at home.gofferje.net (Stefan Gofferje) Date: Wed, 12 Oct 2022 19:05:28 +0300 Subject: [MapServer-users] Zoom levels and scales: Best practices, rules of thumb? Message-ID: <2a8c0b74-9a21-b981-1c31-684d63c257cd@home.gofferje.net> Hi again, apologies for newbie questions but until now I have been only *using *maps, not really creating many. Are there any rules of thumb, best practices or other guidelines for what zoom levels to configure for raster maps? I have raster data for topo maps which are marked as being scale 1:50k, 1:100k, 1:250k and 1:500k. I also have raster data for plain maps at 1:5k, 1:10k, 1:20k, 1:40k, 1:80k, 1:160k, 1:320k and 1:800k. What would be a good layer/zoom level setup for those? -S -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ https://www.gofferje.net | https://www.saakeskus.fi From schroeter at netgis.de Wed Oct 12 09:09:57 2022 From: schroeter at netgis.de (Sven Schroeter) Date: Wed, 12 Oct 2022 17:09:57 +0100 Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure In-Reply-To: <81a032f4-9c07-db61-116e-d5ba9b708da2@home.gofferje.net> References: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> <52b67c8a-5055-38c0-4b1e-db659954bccc@netgis.de> <81a032f4-9c07-db61-116e-d5ba9b708da2@home.gofferje.net> Message-ID: <1e8a70af-b8fb-b1fd-b90b-53d5e1b0d054@netgis.de> that's exactly what I thought;-) You can also do this with QGIS Am 12.10.2022 um 16:57 schrieb Stefan Gofferje: > Hi, > > > On 10/12/22 16:37, Sven Schroeter wrote: >> I don't know if I understood you correctly, but I think the solution >> for you would be an image catalog, right? >> Then you would have only one layer for the UTM maps. >> In the mapfile it would look like this, in the .dbf in the column >> "location" would be the paths to the png data. >> >> LAYER >> ???? NAME "utm_data" >> ???? STATUS ON >> ??? ?MAXSCALE 8000 >> ???? TILEINDEX "filesindex_png.shp" >> ???? TILEITEM "location" >> ???? TYPE RASTER >> ???? PROCESSING "Resample=average" >> ??? ?CLASS >> ??? ?name "utm_data" >> ??? ?END >> END > Like here: > https://mapserver.org/input/raster.html#rasters-and-tile-indexing ? > I'm still a total newbie to mapserver and haven't had much time to > tinker with it yet, unfortunately. But that looks easy enough. > So, basically, I 'find' all pngs/pgws, move them from the subfolders > into one folder and run gdaltindex over the folder. And that creates a > shapefile which I use as data source? Let's try that. > > -S > From bob.basques at ci.stpaul.mn.us Wed Oct 12 09:13:03 2022 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Wed, 12 Oct 2022 16:13:03 +0000 Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure In-Reply-To: <0a33e219-acf4-861b-a9c8-f9b3eb613460@home.gofferje.net> References: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> <0a33e219-acf4-861b-a9c8-f9b3eb613460@home.gofferje.net> Message-ID: You'll need to set up an index to all those PNG/PGW files. I've done this with a SHP file in the past as Sven described. There is more than on way to do this though. Let me know if you need a MapServer example, I can dig one out for you. Bobb My machine - - - PW19-S295-C024 > > > -----Original Message----- > > > From: Stefan Gofferje > > > Sent: Wednesday, October 12, 2022 10:53 AM > > > To: Basques, Bob (CI-StPaul) ; > > > mapserver-users at lists.osgeo.org > > > Subject: Re: [MapServer-users] "Emergency" map server on Raspberry Pi > > > - raster/PNG source in folder structure > > > > > > Think Before You Click: This email originated outside our organization. > > > > > > > > > Hi, > > > > > > On 10/12/22 17:35, Basques, Bob (CI-StPaul) wrote: > > > > This might help you get started: > > > > > > > > https://github.com/klassenjs/rpi- > > > workshop/blob/master/Workshop.org > > > > > > > > We've got 7 of these used in the filed now as standalone Webservers, > > > with Wifi access. No internet required. You just turn it on. You can add > > > in a Battery and/or connect directly to a 12v power source like the > > > ignition switch for power from a vehicle, and it's always on. > > > > > > > > Real low power and depending on how big a card you use, a lot of data. > > > Our survey version has over 250k geolocated document scans available. > > > > > > > > This is a map based system, but it a whole Server Stack configuration, > > > so should give you a good head start. > > > > > > > > We ran this as a workshop at a OSGeo conference a few years back. > > > > > > Cool! Not very much detail about mapserver, though. I'm planning to > > > throw my stuff to Github too, once I got a little further. I'm a little bit > > > more on the complicated side with 4G/5G and potential other IP over > > > radio being in the mix. Also looking at batman-adv for meshing and > > > testing some ideas for voice/radio over IP. I found a very nice CM4 > > > baseboard which is tiny and still has space for an 42mm NVME SSD, so > > > atm I'm planning for 256G storage in addition to the EMMC. > > > > > > -S > > > > > > -- > > > (o_ Stefan Gofferje | SCLT, MCP, CCSA > > > //\ Reg'd Linux User #247167 | VCP #2263 > > > V_/_ https://www.gofferje.net | https://www.saakeskus.fi From ijturton at gmail.com Wed Oct 12 09:18:23 2022 From: ijturton at gmail.com (Ian Turton) Date: Wed, 12 Oct 2022 17:18:23 +0100 Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure In-Reply-To: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> References: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> Message-ID: I gave a talk about something similar a few years back at FOSS4G - the video is at https://vimeo.com/248675454 I used a Raspberry Pi, GeoServer and MapProxy but I can't see why MapServer would not work. It's perfectly feasible, though a little slow. A newer Pi4 would probably be fine though, especially with a SSD for the data and cache Ian On Wed, 12 Oct 2022 at 13:06, Stefan Gofferje wrote: > Hi all, > > Life (and COVID) hit, so I never got anywhere with updating my weather > website and taking mapserver into use there. > > Currently I have another project - due to the geopolitical situation: > I'm working on a mobile system to provide emergency/off-grid "tactical" > communication and data. It's centered on a Raspberry Pi and includes > things like Meshtastic and others. One of the things I would like to add > is a WMS/WFS server to provide map data via local Wifi AP to connected > devices. > > Topographical (and other) maps of whole Finland are available under CC4 > from the Finnish Land Survey through the KAPSI non-profit. The maps are > in 12kx12k PNGs in a folder structure by UTM grid. See here: > > http://kartat.kapsi.fi/files/peruskarttarasteri_jhs180/taustavari_korkeuskayrilla/1m/etrs89/png/ > The data can by rsync'd down. > I'm not clear how I would configure mapserver for that. Do I have to > create one map with extent and such for each PNG tile or can I point > mapserver to the root directory of the data and tell it to go through > it recursively and get the data from the PGW sidecar files? > > -Stefan > > -- > (o_ Stefan Gofferje | SCLT, MCP, CCSA > //\ Reg'd Linux User #247167 | VCP #2263 > V_/_ https://www.gofferje.net | https://www.saakeskus.fi > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -- Ian Turton -------------- next part -------------- An HTML attachment was scrubbed... URL: From public at postholer.com Wed Oct 12 10:11:37 2022 From: public at postholer.com (Scott) Date: Wed, 12 Oct 2022 10:11:37 -0700 Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure In-Reply-To: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> References: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> Message-ID: <04fc480a-d2f3-4d38-3aad-1d2cd9b76fbd@postholer.com> This is an ideal scenario for serverless. Put your vector data in FlatGeoBuf (.fgb) format and your highest res tiles as a COG tif. You can have those files on a local device or in the cloud. Use leaflet with flatgeobuf, georaster-layer-for-leaflet and some modest javascript. You're making this waaaay too difficult. On 10/12/22 04:55, Stefan Gofferje wrote: > Hi all, > > Life (and COVID) hit, so I never got anywhere with updating my weather > website and taking mapserver into use there. > > Currently I have another project - due to the geopolitical situation: > I'm working on a mobile system to provide emergency/off-grid "tactical" > communication and data. It's centered on a Raspberry Pi and includes > things like Meshtastic and others. One of the things I would like to add > is a WMS/WFS server to provide map data via local Wifi AP to connected > devices. > > Topographical (and other) maps of whole Finland are available under CC4 > from the Finnish Land Survey through the KAPSI non-profit. The maps are > in 12kx12k PNGs in a folder structure by UTM grid. See here: > http://kartat.kapsi.fi/files/peruskarttarasteri_jhs180/taustavari_korkeuskayrilla/1m/etrs89/png/ > The data can by rsync'd down. > I'm not clear how I would configure mapserver for that. Do I have to > create one map with extent and such for each PNG tile or can I point > mapserver to the root directory? of the data and tell it to go through > it recursively and get the data from the PGW sidecar files? > > -Stefan > From lists at home.gofferje.net Wed Oct 12 10:59:16 2022 From: lists at home.gofferje.net (Stefan Gofferje) Date: Wed, 12 Oct 2022 20:59:16 +0300 Subject: [MapServer-users] "Emergency" map server on Raspberry Pi - raster/PNG source in folder structure In-Reply-To: <04fc480a-d2f3-4d38-3aad-1d2cd9b76fbd@postholer.com> References: <8fa4a768-c75f-4a7c-d0c7-26befb053816@home.gofferje.net> <04fc480a-d2f3-4d38-3aad-1d2cd9b76fbd@postholer.com> Message-ID: <3451184.ElGaqSPkdT@andromeda.gofferje.net> Hi, On Wednesday, 12 October 2022 20:11:37 EEST Scott wrote: > This is an ideal scenario for serverless. > > Put your vector data in FlatGeoBuf (.fgb) format and your highest res > tiles as a COG tif. You can have those files on a local device or in the > cloud. > > Use leaflet with flatgeobuf, georaster-layer-for-leaflet and some modest > javascript. > > You're making this waaaay too difficult. No. - Distributing about 75GB of raster data to different devices, keeping it current, etc., is a nightmare. - Over half of the devices using the map data are mobile devices which neither have the necessary storage capacity, nor the flexibility to freely install stuff. - Leaflet is all well and good but there are applications already in use. Developing a leaflet-based application to replace all currently used geospatial applications is not an option. - Cloud is not an option because the primary purpose of the solution is to be public-infrastructure-independent and for emergency/off-grid use. The requirement is a local WMS/WFS server and mapserver is the minimum and apparently the easiest solution for that. -Stefan -- Sent from mobile From lists at home.gofferje.net Thu Oct 13 00:21:05 2022 From: lists at home.gofferje.net (Stefan Gofferje) Date: Thu, 13 Oct 2022 10:21:05 +0300 Subject: [MapServer-users] Projection confusion and output image format Message-ID: Good morning all! thanks to some extra free time and some good pointers from this list, I got my mapserver up and running from zero within 6 or so hours yesterday. What's left is some detail work, writing some scripts, creating a docker file and so on. And... projection confusion... So my data is in EPSG:3067. At the moment, I have it configured so in MAP and in LAYER: PROJECTION "init=epsg:3067" END I also have the wms config set to EPSG:3067 only: "wms_srs" "EPSG:3067" EXTENT in MAP is set to: EXTENT 20000.000000 6594000.000000 740000.000000 7794000.000000 So, if I want to offer EPSG:3857 in addition to EPSG:3067 what do I change? The other thing is that in MAP I have set IMAGETYPE PNG8 mostly to speed things up and reduce file size. However, in a GetCapabilities reply, I get image/png; mode=8bit image/png image/jpeg image/vnd.jpeg-png image/vnd.jpeg-png8 application/x-pdf image/svg+xml image/tiff application/vnd.google-earth.kml+xml application/vnd.google-earth.kmz application/vnd.mapbox-vector-tile application/x-protobuf application/json ... WHat am I missing here? -Stefan -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ https://www.gofferje.net | https://www.saakeskus.fi From jukka.rahkonen at maanmittauslaitos.fi Thu Oct 13 00:34:29 2022 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka) Date: Thu, 13 Oct 2022 07:34:29 +0000 Subject: [MapServer-users] Projection confusion and output image format In-Reply-To: References: Message-ID: Hi, About adding new SRS into WMS give a list like here for the Web Mercator and the Finnish GK zones "wms_srs" "EPSG:3067 EPSG:3857 EPSG:3873 EPSG:3874 EPSG:3875 EPSG:3876 EPSG:3877 EPSG:3878 EPSG:3879 EPSG:3880 EPSG:3881 EPSG:3882 EPSG:3883 EPSG:3884 EPSG:3885 EPSG:4326 EPSG:3045" Mapserver has a set of default outputformats and normally they all appear in the GetCapabilities. For giving your own list use wms_getmap_formatlist Description: (Optional) A comma-separated list of valid formats for a WMS GetMap request as documented in https://mapserver.gis.umn.edu/ogc/wms_server.html. -Jukka Rahkonen- -----Alkuper?inen viesti----- L?hett?j?: MapServer-users Puolesta Stefan Gofferje L?hetetty: torstai 13. lokakuuta 2022 10.21 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: [MapServer-users] Projection confusion and output image format Good morning all! thanks to some extra free time and some good pointers from this list, I got my mapserver up and running from zero within 6 or so hours yesterday. What's left is some detail work, writing some scripts, creating a docker file and so on. And... projection confusion... So my data is in EPSG:3067. At the moment, I have it configured so in MAP and in LAYER: PROJECTION "init=epsg:3067" END I also have the wms config set to EPSG:3067 only: "wms_srs" "EPSG:3067" EXTENT in MAP is set to: EXTENT 20000.000000 6594000.000000 740000.000000 7794000.000000 So, if I want to offer EPSG:3857 in addition to EPSG:3067 what do I change? The other thing is that in MAP I have set IMAGETYPE PNG8 mostly to speed things up and reduce file size. However, in a GetCapabilities reply, I get image/png; mode=8bit image/png image/jpeg image/vnd.jpeg-png image/vnd.jpeg-png8 application/x-pdf image/svg+xml image/tiff application/vnd.google-earth.kml+xml application/vnd.google-earth.kmz application/vnd.mapbox-vector-tile application/x-protobuf application/json ... WHat am I missing here? -Stefan -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.gofferje.net%2F&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C854929e934b349c7575008daaceb8906%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638012424873234098%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=D%2BIHtncNkd%2FhNh%2FvBZ4eRJp7FqMlUL2JgjhTawX1tyM%3D&reserved=0 | https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.saakeskus.fi%2F&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C854929e934b349c7575008daaceb8906%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638012424873234098%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=mrKcqosVlAXFCRuqUq17%2BavecPoahq59a3x272inS08%3D&reserved=0 _______________________________________________ MapServer-users mailing list MapServer-users at lists.osgeo.org https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fmapserver-users&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7C854929e934b349c7575008daaceb8906%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638012424873390379%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=79Trwkvfi12x6Lp7cpWXmeeGkDFsoCQnyQopd9A%2F9QU%3D&reserved=0 From lists at home.gofferje.net Thu Oct 13 00:50:14 2022 From: lists at home.gofferje.net (Stefan Gofferje) Date: Thu, 13 Oct 2022 10:50:14 +0300 Subject: [MapServer-users] Projection confusion and output image format In-Reply-To: References: Message-ID: Good morning Jukka, On 10/13/22 10:34, Rahkonen Jukka wrote: > About adding new SRS into WMS give a list like here for the Web Mercator and the Finnish GK zones > "wms_srs" "EPSG:3067 EPSG:3857 EPSG:3873 EPSG:3874 EPSG:3875 EPSG:3876 EPSG:3877 EPSG:3878 EPSG:3879 EPSG:3880 EPSG:3881 EPSG:3882 EPSG:3883 EPSG:3884 EPSG:3885 EPSG:4326 EPSG:3045" > > Mapserver has a set of default outputformats and normally they all appear in the GetCapabilities. For giving your own list use > wms_getmap_formatlist Description: (Optional) A comma-separated list of valid formats for a WMS GetMap request as documented in https://mapserver.gis.umn.edu/ogc/wms_server.html. So just to be sure: "wms_srs" is not only setting metadata but actually also configuring what reprojections mapserver will do? -Stefan -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ https://www.gofferje.net | https://www.saakeskus.fi From jukka.rahkonen at maanmittauslaitos.fi Thu Oct 13 01:03:21 2022 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka) Date: Thu, 13 Oct 2022 08:03:21 +0000 Subject: [MapServer-users] Projection confusion and output image format In-Reply-To: References: Message-ID: Hi, You will see the srs metadata in GetCapabilities, WMS clients can build a menu according to the list, and Mapserver will reproject the maps. At least if you make a list that makes sense, it is not possible to transform EPSG:3067 into all coordinate systems of the World. -Jukka- -----Alkuper?inen viesti----- L?hett?j?: Stefan Gofferje > So just to be sure: "wms_srs" is not only setting metadata but actually also configuring what reprojections mapserver will do? -Stefan -- From mniemyjski at cloudferro.com Thu Oct 13 01:38:54 2022 From: mniemyjski at cloudferro.com (Marcin Niemyjski) Date: Thu, 13 Oct 2022 08:38:54 +0000 Subject: [MapServer-users] Serving data from private S3 bucket Message-ID: Hello, I'am looking for a way to server data straight from a private S3 object storage. So far, I've been using public object storage and /vsicurl/ to connect by generated https to files but for some of my projects I wouldn't like users to have access to data before rendering it to wms and I definitely don't want to put aws_access key etc. in mapfile. So basically, the goal is to provide WMS from S3 and to keep source data unaccusable at the same time. Do you have any idea how can I deal with this issue? Best regards, Marcin -------------- next part -------------- An HTML attachment was scrubbed... URL: From even.rouault at spatialys.com Thu Oct 13 06:04:31 2022 From: even.rouault at spatialys.com (Even Rouault) Date: Thu, 13 Oct 2022 15:04:31 +0200 Subject: [MapServer-users] Serving data from private S3 bucket In-Reply-To: References: Message-ID: <97bf8462-2d78-52f3-ae2f-17383c379ef4@spatialys.com> Marcin, See https://gdal.org/user/virtual_file_systems.html#vsis3-aws-s3-files in particular the points about? ~/.aws/config and ~/.aws/credentials files Even Le 13/10/2022 ? 10:38, Marcin Niemyjski via MapServer-users a ?crit?: > Hello, > > I'am looking for a way to server data straight from a private S3 > object storage. So far, I've been using public object storage and > /vsicurl/ to connect by generated https to files but for some of my > projects I wouldn't like users to have access to data before rendering > it to wms and I definitely don't want to put aws_access key etc. in > mapfile. > > So basically, the goal is to provide WMS from S3 and to keep source > data unaccusable at the same time. > > Do you have any idea how can I deal with this issue? > > Best regards, > Marcin > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users -- http://www.spatialys.com My software is free, but my time generally not. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at home.gofferje.net Thu Oct 13 10:21:55 2022 From: lists at home.gofferje.net (Stefan Gofferje) Date: Thu, 13 Oct 2022 20:21:55 +0300 Subject: [MapServer-users] My first mapserver project - a short review Message-ID: <9511179.NyiUUSuA9g@andromeda.gofferje.net> Hi all, so I just basically completed my first little mapserver project - an "off- grid/emergency" mapserver for a Raspberry Pi. Although I played with mapserver for a moment about 1.5 years ago, I would say that I entered into the project with zero knowledge of mapserver, mapcache and only general user-level knowledge of GIS in general. I am a Linux geek, though... I was able to get my target functionality - serving a multi-resolution topographic map of Finland from Finnish Land survey data via WMS in about 12 hours over 2 days focused tinkering. Not sure if that's generally fast or slow but I'm pretty happy with how it went. I relied mostly on Google searches, of course on the documentation and I got some really good ("jackpot") pointers from the community on this list. Only thing missing now is a script for automatic pulling, sorting into folders, gdaltindex'ing and ogrinfo'ing of the raw data. Once I have that ready, I'm planning to post either to my blog or maybe put it to Github. Following are just some random thoughts which I thought my interest the community or the developers. Why did I selected mapserver originally? Because GeoServer is Java and I don't like Java. That actually was my original primary reason :D. After getting into mapserver, though, I have a few more reasons to like it, the primary being the structure of the map files and the fact that it hot reloads map files without a restart. I can come up with a thousand new use cases and ideas for mapserver for me just because of the map files and how easy they can be created programmaticly. What do I think of mapserver now? I love it! First: map files (see above). The map file structure makes sense to me as a non-GIS-expert and with a few exceptions (projections... ... ...) is pretty logical. Then the relatively low memory footprint (I run way too many containers on my poor little tinker server at home...). Also, performance is quite good on my hardware for my use case so far. Documentation... Oh well... The documentation is - well - thorough... But it's not "fast". Basically, if you don't know anything about mapserver, you kinda have to read and understand the whole documentation before you can get a mapserver started. You gotta become an expert first and then you can run the server. I personally like to get started with new things so, that I start something small which I then slowly expand or use as a base for new, bigger ideas. That way, my knowledge grows slower but I have something working pretty quickly. Luckily, mapserver seems to have a huge user base and there's a ton of blog posts, tutorials and examples out there, so together with that, the documentation used for filling the gaps which the community documents leave, it worked well for me. I would though like to suggest a few "Quick start guides" for common use cases, such as a WMS server, which can get a newbie up and running faster. Which leads me to the community... Guys, you're fantastic! I think, in my 35 years of using Linux, I have never gotten replies to questions on a mailing list as fast as here. And good replies! And all those blog posts and little snippets out there... Awesome! Seriously, just the community makes me want to come up with some new use cases :D. So much for now... See you all soon on my next mapserver project :D -Stefan -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ https://www.gofferje.net | https://www.saakeskus.fi From lists at home.gofferje.net Thu Oct 13 10:22:53 2022 From: lists at home.gofferje.net (Stefan Gofferje) Date: Thu, 13 Oct 2022 20:22:53 +0300 Subject: [MapServer-users] Zoom levels and scales: Best practices, rules of thumb? In-Reply-To: <2a8c0b74-9a21-b981-1c31-684d63c257cd@home.gofferje.net> References: <2a8c0b74-9a21-b981-1c31-684d63c257cd@home.gofferje.net> Message-ID: <4724737.QJadu78ljV@andromeda.gofferje.net> Never mind, figured it out :) -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ https://www.gofferje.net | https://www.saakeskus.fi On Wednesday, 12 October 2022 19:05:28 EEST Stefan Gofferje wrote: > Hi again, > > apologies for newbie questions but until now I have been only *using > *maps, not really creating many. > > Are there any rules of thumb, best practices or other guidelines for > what zoom levels to configure for raster maps? > > I have raster data for topo maps which are marked as being scale 1:50k, > 1:100k, 1:250k and 1:500k. > > I also have raster data for plain maps at 1:5k, 1:10k, 1:20k, 1:40k, > 1:80k, 1:160k, 1:320k and 1:800k. > > What would be a good layer/zoom level setup for those? > > -S From dmorissette at mapgears.com Thu Oct 13 14:18:58 2022 From: dmorissette at mapgears.com (Daniel Morissette) Date: Thu, 13 Oct 2022 17:18:58 -0400 Subject: [MapServer-users] My first mapserver project - a short review In-Reply-To: <9511179.NyiUUSuA9g@andromeda.gofferje.net> References: <9511179.NyiUUSuA9g@andromeda.gofferje.net> Message-ID: <79244de0-ab94-74fe-789f-1e3884360d3f@mapgears.com> Hi Stefan, Great to hear this kind of feedback! I had to chime in because what you wrote sounds so much like my own first experience with MapServer and you reminded me of my first post to this list... 22 years ago! Great to see that ease of use and performance are still two key differentiators that are still true 22 years later! https://lists.osgeo.org/pipermail/mapserver-users/2000-January/027641.html """ Subject: Wow! [...] > > I am new to this list and to MapServer, but I thought I should write a > note just to say that I've been quite impressed with MapServer until > now! > > Within a couple of hours, I was able to build/install MapServer, get the > demo running, learn the way map files work and... use it to reproduce > the most part of a web mapping application that we had previously built > using a very expensive web mapping package (I won't give names!!!). And > the "worst" in all that is that the MapServer version is at least 10 > times faster than the original... Wow! I can already see lots of > potential uses for it! [...] """ Daniel On 2022-10-13 13:21, Stefan Gofferje wrote: > Hi all, > > so I just basically completed my first little mapserver project - an "off- > grid/emergency" mapserver for a Raspberry Pi. > > Although I played with mapserver for a moment about 1.5 years ago, I would say > that I entered into the project with zero knowledge of mapserver, mapcache and > only general user-level knowledge of GIS in general. I am a Linux geek, > though... > > I was able to get my target functionality - serving a multi-resolution > topographic map of Finland from Finnish Land survey data via WMS in about 12 > hours over 2 days focused tinkering. Not sure if that's generally fast or slow > but I'm pretty happy with how it went. I relied mostly on Google searches, of > course on the documentation and I got some really good ("jackpot") pointers > from the community on this list. Only thing missing now is a script for > automatic pulling, sorting into folders, gdaltindex'ing and ogrinfo'ing of the > raw data. Once I have that ready, I'm planning to post either to my blog or > maybe put it to Github. > > Following are just some random thoughts which I thought my interest the > community or the developers. > > Why did I selected mapserver originally? > Because GeoServer is Java and I don't like Java. That actually was my original > primary reason :D. After getting into mapserver, though, I have a few more > reasons to like it, the primary being the structure of the map files and the > fact that it hot reloads map files without a restart. I can come up with a > thousand new use cases and ideas for mapserver for me just because of the map > files and how easy they can be created programmaticly. > > What do I think of mapserver now? > I love it! First: map files (see above). The map file structure makes sense to > me as a non-GIS-expert and with a few exceptions (projections... ... ...) is > pretty logical. Then the relatively low memory footprint (I run way too many > containers on my poor little tinker server at home...). Also, performance is > quite good on my hardware for my use case so far. > > Documentation... > Oh well... The documentation is - well - thorough... But it's not "fast". > Basically, if you don't know anything about mapserver, you kinda have to read > and understand the whole documentation before you can get a mapserver started. > You gotta become an expert first and then you can run the server. I personally > like to get started with new things so, that I start something small which I > then slowly expand or use as a base for new, bigger ideas. That way, my > knowledge grows slower but I have something working pretty quickly. Luckily, > mapserver seems to have a huge user base and there's a ton of blog posts, > tutorials and examples out there, so together with that, the documentation > used for filling the gaps which the community documents leave, it worked well > for me. > I would though like to suggest a few "Quick start guides" for common use > cases, such as a WMS server, which can get a newbie up and running faster. > > Which leads me to the community... > Guys, you're fantastic! I think, in my 35 years of using Linux, I have never > gotten replies to questions on a mailing list as fast as here. And good > replies! And all those blog posts and little snippets out there... Awesome! > Seriously, just the community makes me want to come up with some new use cases > :D. > > So much for now... See you all soon on my next mapserver project :D > > -Stefan > -- Daniel Morissette Mapgears Inc T: +1 418-696-5056 #201 From lists at home.gofferje.net Fri Oct 14 00:39:35 2022 From: lists at home.gofferje.net (Stefan Gofferje) Date: Fri, 14 Oct 2022 10:39:35 +0300 Subject: [MapServer-users] Tutorials for creating time dimension images and good web frontends for dynamically changing map projects? Message-ID: Good morning all! After the relative ease of my first mapserver project, I'm now motivated and keen on getting another project running. Since about a year (plus minnus), I'm every day checking for Sentinel I and II data covering the area where I live. If there is anything, I download the data and run some scripts which do automatic processing and generating of composites, like SAR VV/VH or NDVI, NDCI, etc. The ready images are then posted to a Telegram channel. At the moment, there's still a number of manual steps (search data, decide what to download, trigger download, trigger processing and trigger Telegram push) and the existing scripts are Bash scripts calling GDAL tools. My first step now is to learn Python and move everything from Bash to Python and automate it, ideally so far that the whole process can run in a Docker container as a cron job. Then I was thinking, instead of pushing images to Telegram, I could use mapserver to serve the images to some web frontend. The map files are very easily created programmatically, so that should be easy. I'm missing a few things for that, though: While going through mapserver's docs, I noticed that it can handle time dimensions for imagery. That sounds like something worth exploring. The docs describe the use of a shape file but unfortunately, I have no clue how to to *create* that programmatically. Regarding the frontend, I could just put up a single page leaflet app. That would be easy enough. But I'm wondering if there's already some cool solutions out there. So, If anybody has a link or pointer for me on the programmatic creation of shape files for time-indexed imagery and/or interesting web frontend projects, I would be very grateful! -Stefan -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ https://www.gofferje.net | https://www.saakeskus.fi From schroeter at netgis.de Fri Oct 14 02:15:37 2022 From: schroeter at netgis.de (Sven Schroeter) Date: Fri, 14 Oct 2022 10:15:37 +0100 Subject: [MapServer-users] Tutorials for creating time dimension images and good web frontends for dynamically changing map projects? In-Reply-To: References: Message-ID: here are some quick ideas which tools could be interesting in this context: If you want to start with python (or php) then I would think about using mapserver based on mapscript. https://mapserver.org/mapscript/index.html You can use ogr2ogr to easily create shapefiles. For meteorological analysis the time parameter for WMS services is useful. For leaflet there is a plugin: https://github.com/socib/Leaflet.TimeDimension Happy mapserving Sven Am 14.10.2022 um 08:39 schrieb Stefan Gofferje: > Good morning all! > > After the relative ease of my first mapserver project, I'm now > motivated and keen on getting another project running. > > Since about a year (plus minnus), I'm every day checking for Sentinel > I and II data covering the area where I live. If there is anything, I > download the data and run some scripts which do automatic processing > and generating of composites, like SAR VV/VH or NDVI, NDCI, etc. > The ready images are then posted to a Telegram channel. > > At the moment, there's still a number of manual steps (search data, > decide what to download, trigger download, trigger processing and > trigger Telegram push) and the existing scripts are Bash scripts > calling GDAL tools. > > My first step now is to learn Python and move everything from Bash to > Python and automate it, ideally so far that the whole process can run > in a Docker container as a cron job. > > Then I was thinking, instead of pushing images to Telegram, I could > use mapserver to serve the images to some web frontend. The map files > are very easily created programmatically, so that should be easy. I'm > missing a few things for that, though: > While going through mapserver's docs, I noticed that it can handle > time dimensions for imagery. That sounds like something worth > exploring. The docs describe the use of a shape file but > unfortunately, I have no clue how to to *create* that programmatically. > > Regarding the frontend, I could just put up a single page leaflet app. > That would be easy enough. But I'm wondering if there's already some > cool solutions out there. > > So, If anybody has a link or pointer for me on the programmatic > creation of shape files for time-indexed imagery and/or interesting > web frontend projects, I would be very grateful! > > -Stefan > From lists at home.gofferje.net Sat Oct 15 00:34:21 2022 From: lists at home.gofferje.net (Stefan Gofferje) Date: Sat, 15 Oct 2022 10:34:21 +0300 Subject: [MapServer-users] Tutorials for creating time dimension images and good web frontends for dynamically changing map projects? (Solution for first problem) In-Reply-To: References: Message-ID: <24787965-5905-332d-6351-1f47daca1d1d@home.gofferje.net> On 10/14/22 10:39, Stefan Gofferje wrote: > After the relative ease of my first mapserver project, I'm now motivated > and keen on getting another project running. > > Since about a year (plus minnus), I'm every day checking for Sentinel I > and II data covering the area where I live. If there is anything, I > download the data and run some scripts which do automatic processing and > generating of composites, like SAR VV/VH or NDVI, NDCI, etc. > The ready images are then posted to a Telegram channel. > > At the moment, there's still a number of manual steps (search data, > decide what to download, trigger download, trigger processing and > trigger Telegram push) and the existing scripts are Bash scripts calling > GDAL tools. > > My first step now is to learn Python and move everything from Bash to > Python and automate it, ideally so far that the whole process can run in > a Docker container as a cron job. > > Then I was thinking, instead of pushing images to Telegram, I could use > mapserver to serve the images to some web frontend. The map files are > very easily created programmatically, so that should be easy. I'm > missing a few things for that, though: > While going through mapserver's docs, I noticed that it can handle time > dimensions for imagery. That sounds like something worth exploring. The > docs describe the use of a shape file but unfortunately, I have no clue > how to to *create* that programmatically. > > Regarding the frontend, I could just put up a single page leaflet app. > That would be easy enough. But I'm wondering if there's already some > cool solutions out there. > > So, If anybody has a link or pointer for me on the programmatic creation > of shape files for time-indexed imagery and/or interesting web frontend > projects, I would be very grateful! In case it is of use for anybody, here is the solution I came up with last night: 1.) Add a time index metadatum to the output file (gdaltranslate/gdal_edit -mo TIMEINDEX="yyyy-mm-ddThhmmZ" 2.) Hack together a Python script: #!/usr/bin/python3 import os, sys from osgeo import gdal import geopandas as gpd from shapely.geometry import box import warnings warnings.filterwarnings("ignore") StartDir = str(sys.argv[1]) def getBounds(path): raster = gdal.Open(path) ulx, xres, xskew, uly, yskew, yres = raster.GetGeoTransform() lrx = ulx + (raster.RasterXSize * xres) lry = uly + (raster.RasterYSize * yres) return box(lrx, lry, ulx, uly) df = gpd.GeoDataFrame(columns=['location', 'geometry','timestamp']) for dir, subdir, files in os.walk(StartDir): for fname in files: if fname.endswith(".tif"): fullname = os.path.join(dir+"/", fname) print (fullname) ds=gdal.Open(fullname) metadata=ds.GetMetadata() ds=None print(metadata) df = df.append({'location': fname, 'geometry': getBounds(fullname),'timestamp': metadata['TIMESTAMP']}, ignore_index=True) # df = gpd.pd.concat(df,{'location': fname, 'geometry': getBounds(os.path.join(dir+"/", fname))}, ignore_index=True) df.to_file("tile-index.shp") NOTE: suppressing all warnings is temporary until I figured out how to move from df.append to pd.concat. -Stefan -- (o_ Stefan Gofferje | SCLT, MCP, CCSA //\ Reg'd Linux User #247167 | VCP #2263 V_/_ https://www.gofferje.net | https://www.saakeskus.fi From trygve at aspenes.priv.no Wed Oct 19 11:48:14 2022 From: trygve at aspenes.priv.no (Trygve Aspenes) Date: Wed, 19 Oct 2022 20:48:14 +0200 Subject: [MapServer-users] Possible to pass sql dialect when querying a flatgeobuf? Message-ID: <52d141a373839726d0ba4122cf77a28c@aspenes.priv.no> Hi I have a flatgeobuf file ( or files) and need to filter by time using the time from the query. When I test on command line using ogrinfo I get something like this: ogrinfo -dialect SQLITE -sql "select * from li_flatgeobuf_demo where unixepoch(TimeStamp) between unixepoch('2013-06-20T17:00:29Z') and unixepoch('2013-06-20T17:00:29Z')+300" /data/mapserver/tile-index/* INFO: Open of `/data/mapserver/tile-index/points-20130620070000.fgb' using driver `FlatGeobuf' successful. layer names ignored in combination with -sql. Layer name: SELECT Geometry: Point Feature Count: 17 Extent: (7.254900, -6.423300) - (58.263300, 51.656400) Layer SRS WKT: GEOGCRS["WGS 84", ENSEMBLE["World Geodetic System 1984 ensemble", MEMBER["World Geodetic System 1984 (Transit)"], MEMBER["World Geodetic System 1984 (G730)"], MEMBER["World Geodetic System 1984 (G873)"], MEMBER["World Geodetic System 1984 (G1150)"], MEMBER["World Geodetic System 1984 (G1674)"], MEMBER["World Geodetic System 1984 (G1762)"], MEMBER["World Geodetic System 1984 (G2139)"], ELLIPSOID["WGS 84",6378137,298.257223563, LENGTHUNIT["metre",1]], ENSEMBLEACCURACY[2.0]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433]], CS[ellipsoidal,2], AXIS["geodetic latitude (Lat)",north, ORDER[1], ANGLEUNIT["degree",0.0174532925199433]], AXIS["geodetic longitude (Lon)",east, ORDER[2], ANGLEUNIT["degree",0.0174532925199433]], USAGE[ SCOPE["Horizontal component of 3D system."], AREA["World."], BBOX[-90,-180,90,180]], ID["EPSG",4326]] Data axis to CRS axis mapping: 2,1 Geometry Column = GEOMETRY TimeStamp: String (0.0) OGRFeature(SELECT):0 TimeStamp (String) = 2013-06-20T17:00:29Z POINT (11.3157 -5.3703) The trick is to use the SQLITE dialect. https://lists.osgeo.org/pipermail/gdal-dev/2022-October/056318.html But in my mapfile I have something like this: CONNECTIONTYPE OGR CONNECTION "/data/mapserver/" DATA "select * from flatgeobuf_demo where unixepoch(TimeStamp) between unixepoch('%time%')-300 and unixepoch('%time%')" But this does not work and I assume this is because OGR does not use the SQLITE dialect. So my question is: Is it possible the tell OGR to use the SQLITE dialect? My mapserver log is (from a docker container with mapserver v 7.6.x and GDAL 3.5.1) [Wed Oct 19 18:40:28 2022].5067, 12230.1280: GDAL: GDALOpen(/data/mapserver/, this=0x56387af83b60) succeeds as FlatGeobuf. [Wed Oct 19 18:40:28 2022].5068, 12230.1281: GDAL: GDALClose(/data/mapserver/, this=0x56387af83b60) 172.17.0.1 - - [19/Oct/2022:18:40:28 +0000] "GET /cgi-bin/mapserv?map=/mapfile/mapfile.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=-20037508.34278924391,-39783385.7486210987,20037508.34278925508,44927335.42709603906&CRS=EPSG:3857&WIDTH=291&HEIGHT=614&LAYERS=li_flatgeobuf_demo&STYLES=&TIME=2013-06-20T17:00:00Z&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE HTTP/1.1" 200 802 "-" "curl/7.83.1" returning from a curl: curl 'http://localhost:8080/cgi-bin/mapserv?map=/mapfile/mapfile.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=-20037508.34278924391,-39783385.7486210987,20037508.34278925508,44927335.42709603906&CRS=EPSG:3857&WIDTH=291&HEIGHT=614&LAYERS=li_flatgeobuf_demo&STYLES=&TIME=2013-06-20T17:00:00Z&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE' msDrawMap(): Image handling error. Failed to draw layer named 'li_flatgeobuf_demo'. msOGRFileOpen(): OGR error. ExecuteSQL() failed. Check server logs. Trygve Aspenes From even.rouault at spatialys.com Wed Oct 19 12:35:26 2022 From: even.rouault at spatialys.com (Even Rouault) Date: Wed, 19 Oct 2022 21:35:26 +0200 Subject: [MapServer-users] Possible to pass sql dialect when querying a flatgeobuf? In-Reply-To: <52d141a373839726d0ba4122cf77a28c@aspenes.priv.no> References: <52d141a373839726d0ba4122cf77a28c@aspenes.priv.no> Message-ID: Trygve, you may want to change - line https://github.com/MapServer/MapServer/blob/698a4407265cce9db322a34e21e279e57e9746f8/mapogr.cpp#L1265 from hLayer = OGR_DS_ExecuteSQL( hDS, pszLayerDef, NULL, NULL ); to hLayer = OGR_DS_ExecuteSQL( hDS, pszLayerDef, NULL, "SQLITE" ); and - line https://github.com/MapServer/MapServer/blob/698a4407265cce9db322a34e21e279e57e9746f8/mapogr.cpp#L2569 from psInfo->hLayer = OGR_DS_ExecuteSQL( psInfo->hDS, select, hGeom, NULL ); to psInfo->hLayer = OGR_DS_ExecuteSQL( psInfo->hDS, select, hGeom, "SQLITE" ); A processing option should be added to control this behavior in a clean way. The alternative is to convert your flatgeobuf file to Spatialite or GPKG, which natively speak the SQLITE dialect. Even Le 19/10/2022 ? 20:48, Trygve Aspenes a ?crit?: > Hi > I have a flatgeobuf file ( or files) and need to filter by time using > the time from the query. > > When I test on command line using ogrinfo I get something like this: > ogrinfo -dialect SQLITE -sql "select * from li_flatgeobuf_demo where > unixepoch(TimeStamp) between unixepoch('2013-06-20T17:00:29Z') and > unixepoch('2013-06-20T17:00:29Z')+300" /data/mapserver/tile-index/* > INFO: Open of `/data/mapserver/tile-index/points-20130620070000.fgb' > ????? using driver `FlatGeobuf' successful. > layer names ignored in combination with -sql. > > Layer name: SELECT > Geometry: Point > Feature Count: 17 > Extent: (7.254900, -6.423300) - (58.263300, 51.656400) > Layer SRS WKT: > GEOGCRS["WGS 84", > ??? ENSEMBLE["World Geodetic System 1984 ensemble", > ??????? MEMBER["World Geodetic System 1984 (Transit)"], > ??????? MEMBER["World Geodetic System 1984 (G730)"], > ??????? MEMBER["World Geodetic System 1984 (G873)"], > ??????? MEMBER["World Geodetic System 1984 (G1150)"], > ??????? MEMBER["World Geodetic System 1984 (G1674)"], > ??????? MEMBER["World Geodetic System 1984 (G1762)"], > ??????? MEMBER["World Geodetic System 1984 (G2139)"], > ??????? ELLIPSOID["WGS 84",6378137,298.257223563, > ??????????? LENGTHUNIT["metre",1]], > ??????? ENSEMBLEACCURACY[2.0]], > ??? PRIMEM["Greenwich",0, > ??????? ANGLEUNIT["degree",0.0174532925199433]], > ??? CS[ellipsoidal,2], > ??????? AXIS["geodetic latitude (Lat)",north, > ??????????? ORDER[1], > ??????????? ANGLEUNIT["degree",0.0174532925199433]], > ??????? AXIS["geodetic longitude (Lon)",east, > ??????????? ORDER[2], > ??????????? ANGLEUNIT["degree",0.0174532925199433]], > ??? USAGE[ > ??????? SCOPE["Horizontal component of 3D system."], > ??????? AREA["World."], > ??????? BBOX[-90,-180,90,180]], > ??? ID["EPSG",4326]] > Data axis to CRS axis mapping: 2,1 > Geometry Column = GEOMETRY > TimeStamp: String (0.0) > OGRFeature(SELECT):0 > ? TimeStamp (String) = 2013-06-20T17:00:29Z > ? POINT (11.3157 -5.3703) > > The trick is to use the SQLITE dialect. > https://lists.osgeo.org/pipermail/gdal-dev/2022-October/056318.html > > But in my mapfile I have something like this: > > ??????? CONNECTIONTYPE OGR > ??????? CONNECTION "/data/mapserver/" > ??????? DATA "select * from flatgeobuf_demo where unixepoch(TimeStamp) > between unixepoch('%time%')-300 and unixepoch('%time%')" > > But this does not work and I assume this is because OGR does not use > the SQLITE dialect. > > So my question is: Is it possible the tell OGR to use the SQLITE dialect? > > My mapserver log is (from a docker container with mapserver? v 7.6.x > and GDAL 3.5.1) > [Wed Oct 19 18:40:28 2022].5067, 12230.1280: GDAL: > GDALOpen(/data/mapserver/, this=0x56387af83b60) succeeds as FlatGeobuf. > [Wed Oct 19 18:40:28 2022].5068, 12230.1281: GDAL: > GDALClose(/data/mapserver/, this=0x56387af83b60) > 172.17.0.1 - - [19/Oct/2022:18:40:28 +0000] "GET > /cgi-bin/mapserv?map=/mapfile/mapfile.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=-20037508.34278924391,-39783385.7486210987,20037508.34278925508,44927335.42709603906&CRS=EPSG:3857&WIDTH=291&HEIGHT=614&LAYERS=li_flatgeobuf_demo&STYLES=&TIME=2013-06-20T17:00:00Z&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE > HTTP/1.1" 200 802 "-" "curl/7.83.1" > > returning from a curl: > curl > 'http://localhost:8080/cgi-bin/mapserv?map=/mapfile/mapfile.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=-20037508.34278924391,-39783385.7486210987,20037508.34278925508,44927335.42709603906&CRS=EPSG:3857&WIDTH=291&HEIGHT=614&LAYERS=li_flatgeobuf_demo&STYLES=&TIME=2013-06-20T17:00:00Z&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE' > > xmlns="http://www.opengis.net/ogc" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.opengis.net/ogc > http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd"> > > msDrawMap(): Image handling error. Failed to draw layer named > 'li_flatgeobuf_demo'. > msOGRFileOpen(): OGR error. ExecuteSQL() failed. Check server logs. > > > > > Trygve Aspenes > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users -- http://www.spatialys.com My software is free, but my time generally not. -------------- next part -------------- An HTML attachment was scrubbed... URL: From trygve at aspenes.priv.no Wed Oct 19 22:28:53 2022 From: trygve at aspenes.priv.no (Trygve Aspenes) Date: Thu, 20 Oct 2022 07:28:53 +0200 Subject: [MapServer-users] Possible to pass sql dialect when querying a flatgeobuf? In-Reply-To: References: <52d141a373839726d0ba4122cf77a28c@aspenes.priv.no> Message-ID: <9deb1dc5930f68027b5a8466d22b8585@aspenes.priv.no> Even, wow, thanks. I did had a look in the mapogr.cpp file and guessed some changes needed to be added. But the code is far too complicated for me to follow. I don't have a setup now to compile the mapserver, so I better try out Spatialite or GPKG. However I googled a bit and found a hint using virtual layer like this: CONNECTION " /data/mapserver/ select * from li_flatgeobuf_demo where unixepoch(TimeStamp) between unixepoch('%time%')-300 and unixepoch('%time%') " With this, mapserver works, at least no error messages are returned. But I only get an empty image in return. If a create a separate .ovf file to use with ogrinfo I get the same (working but no data returned): ogrinfo /flatgeobuf.ovf li_flatgeobuf_demo INFO: Open of `/flatgeobuf.ovf' using driver `OGR_VRT' successful. Layer name: li_flatgeobuf_demo Geometry: Point Feature Count: 0 Layer SRS WKT: GEOGCRS["WGS 84", ENSEMBLE["World Geodetic System 1984 ensemble", MEMBER["World Geodetic System 1984 (Transit)"], MEMBER["World Geodetic System 1984 (G730)"], MEMBER["World Geodetic System 1984 (G873)"], MEMBER["World Geodetic System 1984 (G1150)"], MEMBER["World Geodetic System 1984 (G1674)"], MEMBER["World Geodetic System 1984 (G1762)"], MEMBER["World Geodetic System 1984 (G2139)"], ELLIPSOID["WGS 84",6378137,298.257223563, LENGTHUNIT["metre",1]], ENSEMBLEACCURACY[2.0]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433]], CS[ellipsoidal,2], AXIS["geodetic latitude (Lat)",north, ORDER[1], ANGLEUNIT["degree",0.0174532925199433]], AXIS["geodetic longitude (Lon)",east, ORDER[2], ANGLEUNIT["degree",0.0174532925199433]], USAGE[ SCOPE["Horizontal component of 3D system."], AREA["World."], BBOX[-90,-180,90,180]], ID["EPSG",4326]] Data axis to CRS axis mapping: 2,1 Geometry Column = GEOMETRY TimeStamp: String (0.0) with ovf file like this: /data/mapserver/ select * from li_flatgeobuf_demo where unixepoch(TimeStamp) between unixepoch('2013-06-20T07:00:00Z')-30 and unixepoch('2013-06-20T07:00:00Z')+60 Well almost there, but nope. Thanks for your time Trygve Aspenes Den 2022-10-19 21:35, skrev Even Rouault: > Trygve, > > you may want to change > > - line > https://github.com/MapServer/MapServer/blob/698a4407265cce9db322a34e21e279e57e9746f8/mapogr.cpp#L1265 > > > from > > hLayer = OGR_DS_ExecuteSQL( hDS, pszLayerDef, NULL, NULL ); > > to > > hLayer = OGR_DS_ExecuteSQL( hDS, pszLayerDef, NULL, "SQLITE" ); > > and > > - line > https://github.com/MapServer/MapServer/blob/698a4407265cce9db322a34e21e279e57e9746f8/mapogr.cpp#L2569 > > > from > > psInfo->hLayer = OGR_DS_ExecuteSQL( psInfo->hDS, select, hGeom, NULL > ); > > to > > psInfo->hLayer = OGR_DS_ExecuteSQL( psInfo->hDS, select, hGeom, > "SQLITE" ); > > A processing option should be added to control this behavior in a > clean way. > > The alternative is to convert your flatgeobuf file to Spatialite or > GPKG, which natively speak the SQLITE dialect. > > Even > > Le 19/10/2022 ? 20:48, Trygve Aspenes a ?crit : > >> Hi >> I have a flatgeobuf file ( or files) and need to filter by time >> using the time from the query. >> >> When I test on command line using ogrinfo I get something like this: >> >> ogrinfo -dialect SQLITE -sql "select * from li_flatgeobuf_demo where >> unixepoch(TimeStamp) between unixepoch('2013-06-20T17:00:29Z') and >> unixepoch('2013-06-20T17:00:29Z')+300" /data/mapserver/tile-index/* >> INFO: Open of `/data/mapserver/tile-index/points-20130620070000.fgb' >> >> using driver `FlatGeobuf' successful. >> layer names ignored in combination with -sql. >> >> Layer name: SELECT >> Geometry: Point >> Feature Count: 17 >> Extent: (7.254900, -6.423300) - (58.263300, 51.656400) >> Layer SRS WKT: >> GEOGCRS["WGS 84", >> ENSEMBLE["World Geodetic System 1984 ensemble", >> MEMBER["World Geodetic System 1984 (Transit)"], >> MEMBER["World Geodetic System 1984 (G730)"], >> MEMBER["World Geodetic System 1984 (G873)"], >> MEMBER["World Geodetic System 1984 (G1150)"], >> MEMBER["World Geodetic System 1984 (G1674)"], >> MEMBER["World Geodetic System 1984 (G1762)"], >> MEMBER["World Geodetic System 1984 (G2139)"], >> ELLIPSOID["WGS 84",6378137,298.257223563, >> LENGTHUNIT["metre",1]], >> ENSEMBLEACCURACY[2.0]], >> PRIMEM["Greenwich",0, >> ANGLEUNIT["degree",0.0174532925199433]], >> CS[ellipsoidal,2], >> AXIS["geodetic latitude (Lat)",north, >> ORDER[1], >> ANGLEUNIT["degree",0.0174532925199433]], >> AXIS["geodetic longitude (Lon)",east, >> ORDER[2], >> ANGLEUNIT["degree",0.0174532925199433]], >> USAGE[ >> SCOPE["Horizontal component of 3D system."], >> AREA["World."], >> BBOX[-90,-180,90,180]], >> ID["EPSG",4326]] >> Data axis to CRS axis mapping: 2,1 >> Geometry Column = GEOMETRY >> TimeStamp: String (0.0) >> OGRFeature(SELECT):0 >> TimeStamp (String) = 2013-06-20T17:00:29Z >> POINT (11.3157 -5.3703) >> >> The trick is to use the SQLITE dialect. >> https://lists.osgeo.org/pipermail/gdal-dev/2022-October/056318.html >> >> But in my mapfile I have something like this: >> >> CONNECTIONTYPE OGR >> CONNECTION "/data/mapserver/" >> DATA "select * from flatgeobuf_demo where >> unixepoch(TimeStamp) between unixepoch('%time%')-300 and >> unixepoch('%time%')" >> >> But this does not work and I assume this is because OGR does not use >> the SQLITE dialect. >> >> So my question is: Is it possible the tell OGR to use the SQLITE >> dialect? >> >> My mapserver log is (from a docker container with mapserver v 7.6.x >> and GDAL 3.5.1) >> [Wed Oct 19 18:40:28 2022].5067, 12230.1280: GDAL: >> GDALOpen(/data/mapserver/, this=0x56387af83b60) succeeds as >> FlatGeobuf. >> [Wed Oct 19 18:40:28 2022].5068, 12230.1281: GDAL: >> GDALClose(/data/mapserver/, this=0x56387af83b60) >> 172.17.0.1 - - [19/Oct/2022:18:40:28 +0000] "GET >> > /cgi-bin/mapserv?map=/mapfile/mapfile.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=-20037508.34278924391,-39783385.7486210987,20037508.34278925508,44927335.42709603906&CRS=EPSG:3857&WIDTH=291&HEIGHT=614&LAYERS=li_flatgeobuf_demo&STYLES=&TIME=2013-06-20T17:00:00Z&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE >> HTTP/1.1" 200 802 "-" "curl/7.83.1" >> >> returning from a curl: >> curl >> > 'http://localhost:8080/cgi-bin/mapserv?map=/mapfile/mapfile.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=-20037508.34278924391,-39783385.7486210987,20037508.34278925508,44927335.42709603906&CRS=EPSG:3857&WIDTH=291&HEIGHT=614&LAYERS=li_flatgeobuf_demo&STYLES=&TIME=2013-06-20T17:00:00Z&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE' >> >> > xmlns="http://www.opengis.net/ogc" [1] >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [2] >> xsi:schemaLocation="http://www.opengis.net/ogc >> http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd" [3]> >> >> msDrawMap(): Image handling error. Failed to draw layer named >> 'li_flatgeobuf_demo'. >> msOGRFileOpen(): OGR error. ExecuteSQL() failed. Check server logs. >> >> >> >> Trygve Aspenes >> _______________________________________________ >> MapServer-users mailing list >> MapServer-users at lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users > > -- > http://www.spatialys.com > My software is free, but my time generally not. > > > Links: > ------ > [1] http://www.opengis.net/ogc > [2] http://www.w3.org/2001/XMLSchema-instance > [3] > http://www.opengis.net/ogchttp://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd From mniemyjski at cloudferro.com Thu Oct 20 04:58:49 2022 From: mniemyjski at cloudferro.com (Marcin Niemyjski) Date: Thu, 20 Oct 2022 11:58:49 +0000 Subject: [MapServer-users] Mapserver on Docker - Mapfiles in S3 Bucket Message-ID: Hello, I'm using camptocamp/mapserver on docker and I wanted to know If it is possible to store mapfiles on S3 Bucket to which docker has access. For Example: I can access Mapserver on docker via url: http://12.345.678.9:8080/?map=/etc/mapserver/MarcinTest.map What I want is: http://12.345.678.9:8080/?map=/vsis3/Bucket/key/MarcinTest.map Th goal is to don't have to keep mapfiles localy. I hope somebody will have a workaround. As always thank you for your help, Marcin -------------- next part -------------- An HTML attachment was scrubbed... URL: From lars.fricke at skendata.de Thu Oct 20 23:37:32 2022 From: lars.fricke at skendata.de (Lars Fricke) Date: Fri, 21 Oct 2022 08:37:32 +0200 Subject: [MapServer-users] Mapserver on Docker - Mapfiles in S3 Bucket In-Reply-To: References: Message-ID: <4b4b0633-d1fd-c621-2558-4329295ed6e4@skendata.de> An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_0x667E0B7B73E250FB.asc Type: application/pgp-keys Size: 2460 bytes Desc: OpenPGP public key URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 665 bytes Desc: OpenPGP digital signature URL: From mniemyjski at cloudferro.com Mon Oct 24 02:12:45 2022 From: mniemyjski at cloudferro.com (Marcin Niemyjski) Date: Mon, 24 Oct 2022 09:12:45 +0000 Subject: [MapServer-users] Redirecting to s3 via apache2 redirect/alias/proxy Message-ID: Hello, coming back to you with one more question about s3, namely: As I wrote before - I want to keep my mapfiles on buckets but I also want to access them without need to mount buckets to VMs, so I've came up with this: https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_p https://mapserver.org/ogc/wms_server.html#changing-the-online-resource-url generaly I want to do this: ProxyPass /martest/ https://s3.amazon.com/Bucket/Key ProxyPassReverse /martest/ https://s3.amazon.com/Bucket/Key or RewriteEngine on RewriteRule /martest/ https://s3.amazon.com/Bucket/ so, while using WMS online resource url https://www.lpis.pl/cgi-bin/mapserv?map=/martest/jrc.map i would connect to mapfile on s3. But it doesn't seem to be working. Is this even possible to connect mapserver and s3 this way? As always thank you for your help and time, Marcin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Mon Oct 24 02:34:26 2022 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka) Date: Mon, 24 Oct 2022 09:34:26 +0000 Subject: [MapServer-users] Redirecting to s3 via apache2 redirect/alias/proxy In-Reply-To: References: Message-ID: Hi, I am not sure how well redirect plays together with MS_MAP_PATTERN https://www.mapserver.org/optimization/limit_mapfile_access.html#limit-mapfile-access but maybe you could test it by redirecting locally and trying to access a mapfile from a directory that does not match with MS_MAP_PATTERN. If that requires Apache admin rights then maybe it does not bring back https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32062. If having mapfiles in s3 feels like an option that Mapserver should support then perhaps RFC 56 https://www.mapserver.org/development/rfc/ms-rfc-56.html#rfc56 should be reviewed. -Jukka Rahkonen- L?hett?j?: MapServer-users Puolesta Marcin Niemyjski via MapServer-users L?hetetty: maanantai 24. lokakuuta 2022 12.13 Vastaanottaja: Marcin Niemyjski via MapServer-users Aihe: [MapServer-users] Redirecting to s3 via apache2 redirect/alias/proxy Hello, coming back to you with one more question about s3, namely: As I wrote before - I want to keep my mapfiles on buckets but I also want to access them without need to mount buckets to VMs, so I've came up with this: https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_p https://mapserver.org/ogc/wms_server.html#changing-the-online-resource-url generaly I want to do this: ProxyPass /martest/ https://s3.amazon.com/Bucket/Key ProxyPassReverse /martest/ https://s3.amazon.com/Bucket/Key or RewriteEngine on RewriteRule /martest/ https://s3.amazon.com/Bucket/ so, while using WMS online resource url https://www.lpis.pl/cgi-bin/mapserv?map=/martest/jrc.map i would connect to mapfile on s3. But it doesn't seem to be working. Is this even possible to connect mapserver and s3 this way? As always thank you for your help and time, Marcin -------------- next part -------------- An HTML attachment was scrubbed... URL: From lars.fricke at skendata.de Mon Oct 24 02:37:18 2022 From: lars.fricke at skendata.de (Lars Fricke) Date: Mon, 24 Oct 2022 11:37:18 +0200 Subject: [MapServer-users] Redirecting to s3 via apache2 redirect/alias/proxy In-Reply-To: References: Message-ID: <11caafef-2dad-c1d0-84c9-b659e1931839@skendata.de> An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_0x667E0B7B73E250FB.asc Type: application/pgp-keys Size: 2460 bytes Desc: OpenPGP public key URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 665 bytes Desc: OpenPGP digital signature URL: From mniemyjski at cloudferro.com Mon Oct 24 03:32:50 2022 From: mniemyjski at cloudferro.com (Marcin Niemyjski) Date: Mon, 24 Oct 2022 10:32:50 +0000 Subject: [MapServer-users] Redirecting to s3 via apache2 redirect/alias/proxy In-Reply-To: <11caafef-2dad-c1d0-84c9-b659e1931839@skendata.de> References: <11caafef-2dad-c1d0-84c9-b659e1931839@skendata.de> Message-ID: Jukka, Lars thanks for quick response. Sorry for making a mistake and replying to you directly. Lars Yes, my apache has all required modules active and the bucket I'm using is a public bucket. To be honest I'm not fully understand the mechanism of Apache, I'll go back and try using structure from docs. I do not understand the reasoning behind using Environment variable in this case. From my experience environmental variable for example, can be used to point file in which erros would be written. Could you please tell me more precisely how to use it in my case? Using env. variable for me wouldn't work because I'm using more than one mapfile (I'm displaying everyday S-2 scenes for Poland and Ukraine). The goal is to use mapserver hosted from docker, to which would be connected (apache redirect?) s3 bucket with mapfiles, so serving wms would be fully independent process without need to mount bucket. I think I'll try this way: https://stackoverflow.com/questions/9929487/using-apache-mod-alias-in-vhost-to-link-assets-from-external-server Thank you both, Marcin ________________________________ From: MapServer-users on behalf of Lars Fricke Sent: Monday, October 24, 2022 11:37 AM To: mapserver-users at lists.osgeo.org Subject: Re: [MapServer-users] Redirecting to s3 via apache2 redirect/alias/proxy Three things come to my mind: 1) Did you check if your Apache or NGINX respectively has the module installed and active? 2) You do not have credentials in your second S3 URL example. This may be an issue. 3) The structure in the doc's is different: ``` RewriteEngine on RewriteRule wmsmap?(.*) /cgi-bin/mapserv?map=/home/www/mapserverstuff/mymapfile.map&$1 ``` I don't use this method myself but you may want to try using exactly the same replacement structure? As said before, you could als use an Environment variable. Cheers Lars Am 24.10.22 um 11:12 schrieb Marcin Niemyjski via MapServer-users: Hello, coming back to you with one more question about s3, namely: As I wrote before - I want to keep my mapfiles on buckets but I also want to access them without need to mount buckets to VMs, so I've came up with this: https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_p https://mapserver.org/ogc/wms_server.html#changing-the-online-resource-url generaly I want to do this: ProxyPass /martest/ https://s3.amazon.com/Bucket/Key ProxyPassReverse /martest/ https://s3.amazon.com/Bucket/Key or RewriteEngine on RewriteRule /martest/ https://s3.amazon.com/Bucket/ so, while using WMS online resource url https://www.lpis.pl/cgi-bin/mapserv?map=/martest/jrc.map i would connect to mapfile on s3. But it doesn't seem to be working. Is this even possible to connect mapserver and s3 this way? As always thank you for your help and time, Marcin _______________________________________________ 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 mathias.cunault at inrap.fr Wed Oct 26 03:30:02 2022 From: mathias.cunault at inrap.fr (mathias cunault) Date: Wed, 26 Oct 2022 12:30:02 +0200 Subject: [MapServer-users] How to fetch a wfs layer in openLayers Message-ID: Mapserver 7.6.0 & OL6 My goal is to find a feature in a WFS layer and zoom on it using openLayers. Following this example https://openlayers.org/en/latest/examples/vector-wfs-getfeature.html, I am trying to do the same with Mapserver. I am not very familiar with Javascript so I feel uncomfortable in this exercise. I wrote : const featureRequest = new ol.format.WFS().writeGetFeature({ srsName: 'EPSG:3857', featureNS: 'http://openstreemap.org', featurePrefix: 'osm', featureTypes: ['emprise_3857'], outputFormat: 'application/json', filter: new ol.format.filter.equalTo('numoa', '25366'), }) console.log(featureRequest) fetch(`http://blabla/cgi-bin/mapserv.exe?MAP=c:/.../naasp_ol.map`, { method: 'POST', body: new XMLSerializer().serializeToString(featureRequest), }) .then(function (rep) { return rep.json(); }) .then(function (json) { const features = new ol.format.GeoJSON().readFeatures(json) new ol.source.Vector.addFeatures(features) map.getView().fit(new ol.source.Vector.getExent()) }) But the chrome console says that there is an issue with the promise that it is not a valid JSON. Is it coming from the fetch I wrote in a bad way or a problem with application/json ? Indeed I read in Mapserver doc that only mapserver 8+ could handle application/json (from what I understood) Maybe it is both? I feel a bit lost. I tried to find more examples and doc on the net, but nothing clear for me. Maybe you can help? Thanks *----------* *Mathias Cunault* *r?f?rent SIG / Admin Caviar* *Inrap Tours - 148 av. Maginot37000 TOURS06 32 05 98 96* abonnez-vous ? la lettre d'information de l'Inrap : http://ww w.inrap.fr/newsletter.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From mniemyjski at cloudferro.com Thu Oct 27 02:52:30 2022 From: mniemyjski at cloudferro.com (Marcin Niemyjski) Date: Thu, 27 Oct 2022 09:52:30 +0000 Subject: [MapServer-users] Mapserver reverse proxy Message-ID: Hello, coming back to you with another question - continuation of my issue about keeping mapfiles on s3 while using docker. I managed to create a reverse proxy which redirects to the s3 bucket (by editing apache .conf file) and it works. The problem is: when i try to use it on wms resource url in form: https://www.lpis.pl/cgi-bin/mapserv?map=/martest/jrc.ma (/martest is a proxy pass which I use) the part after ?map= is operated by mapserver and reverse proxy doesn't work so I get error: msLoadMap(): Unable to access file. (/martest/jrc.map) is there any workaround? As always thank you, Marcin -------------- next part -------------- An HTML attachment was scrubbed... URL: From timothy.kempisty at noaa.gov Thu Oct 27 08:31:52 2022 From: timothy.kempisty at noaa.gov (Timothy Kempisty - NOAA Federal) Date: Thu, 27 Oct 2022 11:31:52 -0400 Subject: [MapServer-users] Redirecting to s3 via apache2 redirect/alias/proxy In-Reply-To: References: <11caafef-2dad-c1d0-84c9-b659e1931839@skendata.de> Message-ID: Your original message described an attempt to use /vsis3/ , which is a GDAL feature that lets it read datasets from S3. Mapserver uses those GDAL hooks to read datasets and rasters, but it does not use GDAL to read mapfiles. To my knowledge, Mapserver itself doesn't speak s3 natively. Mapserver has no way of getting its mapfile from an s3 URL... or any URL, for that matter. The only way I can think of to get mapfiles from s3 is to use something like s3fs-fuse. That would mount the s3 bucket as a filesystem on the VM. Then mapserver would read it like a normal local file. But you said you didn't want to do it that way. I think you're chasing something that isn't possible. Even if it were possible, I wouldn't necessarily advise it. It seems like it would be a security nightmare. Also, mapfiles aren't usually that big. When you spin up a new VM, why not just download a copy of the mapfiles locally? Huge rasters can live on S3, and that's fine. The DATA line can use /vsis3/ to get the raster. But mapfiles? I'd question how much would be gained at the cost of latency and security risks. -Tim On Mon, Oct 24, 2022 at 6:33 AM Marcin Niemyjski via MapServer-users < mapserver-users at lists.osgeo.org> wrote: > Jukka, Lars > > thanks for quick response. > > Sorry for making a mistake and replying to you directly. > > Lars > Yes, my apache has all required modules active and the bucket I'm using is > a public bucket. To be honest I'm not fully understand the mechanism of > Apache, I'll go back and try using structure from docs. I do not understand > the reasoning behind using Environment variable in this case. From my > experience environmental variable for example, can be used to point file in > which erros would be written. Could you please tell me more precisely how > to use it in my case? > > Using env. variable for me wouldn't work because I'm using more than one > mapfile (I'm displaying everyday S-2 scenes for Poland and Ukraine). The > goal is to use mapserver hosted from docker, to which would be connected > (apache redirect?) s3 bucket with mapfiles, so serving wms would be fully > independent process without need to mount bucket. > > I think I'll try this way: > > https://stackoverflow.com/questions/9929487/using-apache-mod-alias-in-vhost-to-link-assets-from-external-server > > Thank you both, > Marcin > ------------------------------ > *From:* MapServer-users on > behalf of Lars Fricke > *Sent:* Monday, October 24, 2022 11:37 AM > *To:* mapserver-users at lists.osgeo.org > *Subject:* Re: [MapServer-users] Redirecting to s3 via apache2 > redirect/alias/proxy > > Three things come to my mind: > 1) Did you check if your Apache or NGINX respectively has the module > installed and active? > 2) You do not have credentials in your second S3 URL example. This may be > an issue. > 3) The structure in the doc's is different: > ``` > RewriteEngine on > RewriteRule wmsmap?(.*) > /cgi-bin/mapserv?map=/home/www/mapserverstuff/mymapfile.map&$1 > ``` > I don't use this method myself but you may want to try using exactly the > same replacement structure? > As said before, you could als use an Environment variable. > Cheers Lars > > Am 24.10.22 um 11:12 schrieb Marcin Niemyjski via MapServer-users: > > Hello, > > coming back to you with one more question about s3, namely: > > As I wrote before - I want to keep my mapfiles on buckets but I also want > to access them without need to mount buckets to VMs, so I've came up with > this: > > https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_p > https://mapserver.org/ogc/wms_server.html#changing-the-online-resource-url > > generaly I want to do this: > > ProxyPass /martest/ https://s3.amazon.com/Bucket/Key > ProxyPassReverse /martest/ https://s3.amazon.com/Bucket/Key > > or > > RewriteEngine on > RewriteRule /martest/ https://s3.amazon.com/Bucket/ > > so, while using WMS online resource url https://www.lpis.pl/cgi-bin/mapserv?map=/martest/jrc.map i would connect to mapfile on s3. > > But it doesn't seem to be working. Is this even possible to connect mapserver and s3 this way? > > As always thank you for your help and time, > Marcin > > > > _______________________________________________ > MapServer-users mailing listMapServer-users at lists.osgeo.orghttps://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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From antonis at antonischristofides.com Sat Oct 29 00:59:41 2022 From: antonis at antonischristofides.com (Antonis Christofides) Date: Sat, 29 Oct 2022 10:59:41 +0300 Subject: [MapServer-users] Solved: WMS: Not all features show, depending on how I zoom and pan In-Reply-To: <1ef014b2-e17e-889d-9bb4-86015422e565@postholer.com> References: <3be4f242-4b24-5584-9e07-be3537a686c0@antonischristofides.com> <895e9d3d-cc0e-4a4f-adcd-a76ba66db6c2@app.fastmail.com> <6c5bfd74-fa67-9668-2957-cc32b63826d5@antonischristofides.com> <1ef014b2-e17e-889d-9bb4-86015422e565@postholer.com> Message-ID: <29de4bd5-62c1-e347-9145-2f15ca7e1482@antonischristofides.com> Thanks Scott and Seth for the help. You might not remember, because it was several weeks ago, but I had several GML source files in EPSG:2100 (Greek grid), and when MapServer was responding to a WMS request requesting the data in EPSG:3857 (or 4326), several features would be missing. I converted the data files to shapefiles to see what would happen, and there was no improvement. In fact I think it was slightly worse. Then I upgraded MapServer to 8.0.0 (from 7.6.2) and the problem disappeared. I used 8.0.0 and not 7.6.4 because I didn't want to compile it and I installed it from Debian bullseye backports, and backports only has 8.0.0. So I don't know if the problem exists in 7.6.4. Regards, Antonis On 02/10/2022 17.53, Scott wrote: > It would be interesting if you could change your 'irrigation-network.gml' into > a different format, say .shp, something like: > > ogr2ogr irrigation-network.shp irrigation-network.gml > > Then try that as a data source in your layer and see if your results differ. > This would might help us distinguish between a driver issue and a mapserver > issue. > > > > On 10/2/22 04:51, Antonis Christofides wrote: >> Hello Seth, >> >> Thanks for replying. I experimented and found out there's no difference if I >> use something minimal such as what you suggested. What does make a difference >> is the CRS: if I tell QGIS to use EPSG:2100 (Greek grid?the CRS the data >> files use), then everything works fine. If I use 4326 or 3857, then the >> problem appears. Therefore it appears that the problem is with reprojecting >> (as the stackexchange user "nmtoken" had suspected). Leaflet seems to be >> requesting 3857. >> >> What would be the right course of action here? Should I tell Leaflet to do >> the reprojection instead? Should I investigate further why mapserver has >> trouble reprojecting (and how would I do that)? Should I reproject my data >> files (GML) offline and store them in 3857 instead of 2100? Is there any >> common/best practice regarding this? >> >> Thanks! >> >> Antonis >> >> >> >> On 28/09/2022 17.47, Seth G wrote: >>> Hi, >>> >>> Is there any change if you update the layer to have a single class with a >>> simple line (no EXPRESSION, LABEL, MAXSCALEDENOM)? >>> >>> E.g. >>> >>> ??????? CLASS >>> ??????????? STYLE >>> ??????????????? COLOR 0 0 255 >>> ??????????????? WIDTH 6 >>> ??????????? END >>> >>> Seth >>> >>> -- >>> web:https://geographika.net >>> twitter: @geographika >>> >>> On Wed, Sep 28, 2022, at 1:03 PM, Antonis Christofides wrote: >>>> >>>> Hello, >>>> >>>> I have a problem that has already been discussed in stackexchange >>>> (https://gis.stackexchange.com/questions/440902/mapserver-wms-not-all-features-show-depending-on-how-i-zoom-and-pan >>>> ), >>>> but without solution so far. >>>> >>>> I'm repeating the full text here, but if there's any problem with the >>>> images it might be better to go to stackexchange to read it. >>>> >>>> Here is how QGIS shows an irrigation network, received by MapServer via WMS >>>> and superimposed on OpenStreetMap: >>>> >>>> enter image description here >>>> >>>> Here is the same thing, but slightly panned to the right: >>>> >>>> enter image description here >>>> >>>> Several items are obviously missing. In fact there are items missing in the >>>> top picture as well. Different items become visible as I zoom and pan >>>> differently. >>>> >>>> Since this pretty much tells the whole story, I'm not going into more >>>> details. MapServer version is 7.6.2 (prepackaged for Debian). The base URL >>>> is >>>> https://poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/aira-poros/mapserver/extralayers.map >>>> . >>>> Finally, below I paste the interesting parts of the mapfile. >>>> >>>> Thanks! >>>> >>>> Antonis >>>> >>>> >>>> >>>> >>>> |MAP NAME "aira-poros" STATUS ON SIZE 9040 7731 EXTENT 103986.57 3850796.18 >>>> 1007945.14 4623933.00 UNITS meters PROJECTION "init=epsg:2100" END CONFIG >>>> MS_ERRORFILE "/var/log/mapserver/extralayers.log" # [Omitting some >>>> OUTPUTFORMAT sections] WEB IMAGEPATH "/var/cache/mapserver/" IMAGEURL >>>> "/mapserver_tmp/" METADATA "wms_title" "Aira Poros" "wms_onlineresource" >>>> "https://poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/aira-poros/mapserver/extralayers.map&" >>>> >>>> "wms_srs" "EPSG:4326 EPSG:2100 EPSG:3857" "wms_enable_request" "*" >>>> "wms_feature_info_mime_type" "text/html" "wfs_title" "Aira Poros" >>>> "wfs_onlineresource" >>>> "https://poros.irmasys.com/cgi-bin/mapserv?map=/opt/aira-poros/aira-poros/mapserver/extralayers.map&" >>>> >>>> "wfs_srs" "EPSG:2100 EPSG:4326 EPSG:3857" "wfs_enable_request" "*" END END >>>> LAYER NAME "irrigation-network" TYPE LINE CONNECTIONTYPE OGR CONNECTION >>>> "irrigation-network.gml" METADATA "wms_title" "Irrigation network" >>>> "wfs_title" "Irrigation network" "gml_include_items" "all" "gml_featureid" >>>> "id" END STATUS ON PROJECTION "init=epsg:2100" END CLASSITEM 'category' >>>> CLASS EXPRESSION '1' STYLE COLOR 0 0 255 OPACITY 50 WIDTH 6 END LABEL COLOR >>>> 0 0 255 ANGLE FOLLOW OFFSET 5 99 MAXSCALEDENOM 10000 TEXT "[irri_code]" END >>>> LABEL COLOR 0 0 255 ANGLE FOLLOW OFFSET -8 99 MAXSCALEDENOM 10000 >>>> EXPRESSION (NOT('[Diameter]' = '')) TEXT "D=[Diameter] mm" END END # >>>> [Omitting three more classes] END # [Omitting four more layers] END| >>>> _______________________________________________ >>>> 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 > _______________________________________________ > 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 osgeo.mailinglist at gmail.com Sun Oct 30 07:11:54 2022 From: osgeo.mailinglist at gmail.com (Thomas Gratier) Date: Sun, 30 Oct 2022 15:11:54 +0100 Subject: [MapServer-users] How to fetch a wfs layer in openLayers In-Reply-To: References: Message-ID: Hello, A least, you seem to got issues from 2 parts: First, ``` const featureRequest = new ol.format.WFS().writeGetFeature({ srsName: 'EPSG:3857', featureNS: 'http://openstreemap.org', featurePrefix: 'osm', featureTypes: ['emprise_3857'], outputFormat: 'application/json', filter: new ol.format.filter.equalTo('numoa', '25366'), }) ``` You want to use namespace whereas I'm not sure Mapserver use the same namespace or use any at all. The original server in the OpenLayers sample alias `http://openstreemap.org` to `osm` as you can see at https://ahocevar.com/geoserver/wfs?request=GetCapabilities&service=WFS&version=2.0.0 2nd issue: as you guessed, maybe, your Mapserver may not return JSON. You send it a POST with XML e.g `new XMLSerializer().serializeToString(featureRequest)` where your `featureRequest` contains `outputFormat: 'application/json'`. You may try using `outputFormat: 'application/gml+xml; version=3.2'`. I suppose your Mapserver support WFS 2.0 otherwise you may need `text/xml; subtype=gml/2.1.2` or `text/xml; subtype=gml/3.1.1` In all case, before you try the part ``` .then(function (json) { ... ... }) ``` To troubleshot, you may change you code to ``` fetch(`http://blabla/cgi-bin/mapserv.exe?MAP=c:/.../naasp_ol.map`, { method: 'POST', body: new XMLSerializer().serializeToString(featureRequest), }) .then(function (resp) { return resp.text(); }) .then(function (text) { // See potential errors message console.log(text) }) ``` To troubleshot, most of the time, I go "outside" of my OpenLayers code. OpenLayers generates magically a payload to send to a Mapserver endpoint. In fact, except, the syntax is in JS, the first issue is about sending the "right" content to this endpoint. If you go to https://openlayers.org/en/latest/examples/vector-wfs-getfeature.html, open your browser Developper Tools, use the Network panel, filter to get the post http call and use the "Copy as curl" https://everything.curl.dev/usingcurl/copyas, you will see the exact POST content send to Mapserver endpoint With this, you can simply debug by changing the content and run CURL in the command line. Not sure it's more easy than JS but at least you will avoid the JS language barrier to make your http calls to Mapserver endpoint. Regards, Thomas Gratier Le mer. 26 oct. 2022 ? 12:30, mathias cunault a ?crit : > Mapserver 7.6.0 & OL6 > > My goal is to find a feature in a WFS layer and zoom on it using > openLayers. > Following this example > https://openlayers.org/en/latest/examples/vector-wfs-getfeature.html, I > am trying to do the same with Mapserver. > I am not very familiar with Javascript so I feel uncomfortable in this > exercise. > I wrote : > const featureRequest = new ol.format.WFS().writeGetFeature({ > srsName: 'EPSG:3857', > featureNS: 'http://openstreemap.org', > featurePrefix: 'osm', > featureTypes: ['emprise_3857'], > outputFormat: 'application/json', > filter: new ol.format.filter.equalTo('numoa', '25366'), > }) > > console.log(featureRequest) > > fetch(`http://blabla/cgi-bin/mapserv.exe?MAP=c:/.../naasp_ol.map`, { > method: 'POST', > body: new XMLSerializer().serializeToString(featureRequest), > }) > .then(function (rep) { > return rep.json(); > }) > .then(function (json) { > const features = new ol.format.GeoJSON().readFeatures(json) > new ol.source.Vector.addFeatures(features) > map.getView().fit(new ol.source.Vector.getExent()) > }) > But the chrome console says that there is an issue with the promise that > it is not a valid JSON. > Is it coming from the fetch I wrote in a bad way or a problem with > application/json ? > Indeed I read in Mapserver doc that only mapserver 8+ could handle > application/json (from what I understood) > > Maybe it is both? I feel a bit lost. > I tried to find more examples and doc on the net, but nothing clear for > me. Maybe you can help? > Thanks > > > *----------* > *Mathias Cunault* > > *r?f?rent SIG / Admin Caviar* > > *Inrap Tours - 148 av. Maginot37000 TOURS06 32 05 98 96* > abonnez-vous ? la lettre d'information de l'Inrap : http://ww > w.inrap.fr/newsletter.php > > _______________________________________________ > 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 Thomas.Ellett at kartverket.no Mon Oct 31 08:16:16 2022 From: Thomas.Ellett at kartverket.no (Thomas Ellett von Brasch) Date: Mon, 31 Oct 2022 15:16:16 +0000 Subject: [MapServer-users] Clipped labels in mapcache/mapserver map In-Reply-To: References: Message-ID: Hi all, I'm really struggling to fix a longstanding issue with clipped labels in a couple of our wmts services. I've tried following the mapserver/mapcache docs and numerous variations of different attributes, but with no luck. The main problem bug fixing is that the issue seems to be quite random, just popping up here and there. Examples can be seen in these urls: https://norgeskart.no/#!?project=norgeskart&layers=1002&zoom=11&lat=6879652.31&lon=167744.51 (the 'Stor rar' and 'S' names in the centre of the map) https://norgeskart.no/#!?project=norgeskart&layers=1002&zoom=6&lat=6440416.41&lon=127931.07 ('Kristiansan' , which should be 'Kristiansand') I have "labelcache_map_edge_buffer" "10" in the mapfile and 10 set in the mapcache file. In the source WMS, the placenames layers are line layers (with very small line geometries used just to give curved lines) and the layers (we have several name layers for the different zoom levels, but they're all set up in the same way) look like (truncated): LAYER NAME "N100Stedsnavn" PROCESSING "CLOSE_CONNECTION=DEFER" PROCESSING "LABEL_NO_CLIP=True" TYPE LINE CLASS NAME "N100 Stedsnavn" EXPRESSION ([fmx_rotation] != 0) LABEL PARTIALS FALSE ANGLE follow ANTIALIAS TRUE FONT "verdana" SIZE [fontsize] COLOR [geodb_color] ENCODING "UTF-8" PRIORITY [fontsize] FORCE FALSE MINDISTANCE 50 OUTLINECOLOR 254 254 254 POSITION [horizontalalignment] TYPE TRUETYPE END TEXT "[textstring]" END END And the tileset definition in the mapcache config file looks like: norgeskart_bakgrunn norgeskart_bakgrunn Topografisk Norgeskart og dybdedata og svalbard minus matrikkel Cache for Norgeskart googlemaps utm33n PNG 8 8 10 Is it possible the metatiles being used in the original seed job and later seeding jobs are different somehow? Given that the labelcache_map_edge_buffer is set (along with metabuffer) and we have PARTIALS FALSE in the mapfile, I didn't think that cut labels would be possible? Any thoughts or ideas would be great :) Thanks in advance! Tom [cid:image001.jpg at 01D3A415.20CB4FE0] Tom Ellett von Brasch Sjefsingeni?r Geodatatjenester Direkte: 32 11 84 73 Mobil: 45806402 E-post: thomas.ellett at kartverket.no Tlf. sentralbord: 32 11 80 00 www.kartverket.no -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 1605 bytes Desc: image003.jpg URL: