From bob.basques at ci.stpaul.mn.us Mon Sep 11 16:16:58 2023 From: bob.basques at ci.stpaul.mn.us (Bob Basques) Date: Mon, 11 Sep 2023 23:16:58 +0000 Subject: [MapServer-users] OSGeo Twin Cities Local Chapter Monthly Meeting (aka TCMUG) Message-ID: All, Our next meeting is being pushed a week for some out of towners to attend. Howard Butler (and crew?) will be in town and attending our Sept. 20th meeting. We?ll be at SeaSalt in Minnehaha Falls Park. Date: Sept 20th, 4:30 ? 6:00 Place SeaSalt See you there. Bobb Get me in Teams PW19-S295-C024 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob.basques at ci.stpaul.mn.us Wed Sep 13 10:01:44 2023 From: bob.basques at ci.stpaul.mn.us (Bob Basques) Date: Wed, 13 Sep 2023 17:01:44 +0000 Subject: [MapServer-users] [REMINDER] OSGeo Twin Cities Local Chapter Monthly Meeting (aka TCMUG) - Sep. 20th. Message-ID: All, Our next meeting is being pushed a week for some out of towners to attend. Howard Butler (and crew?) will be in town and attending our Sept. 20th meeting. We?ll be at SeaSalt in Minnehaha Falls Park. Date: Sept 20th, 4:30 ? 6:00 Place SeaSalt See you there. Bobb Get me in Teams PW19-S295-C024 -------------- next part -------------- An HTML attachment was scrubbed... URL: From JHubert at forum-marais-atl.com Thu Sep 14 01:25:36 2023 From: JHubert at forum-marais-atl.com (Julien Hubert) Date: Thu, 14 Sep 2023 08:25:36 +0000 Subject: [MapServer-users] How to get a WMS GetFeatureInfo response with MapServer in JSON format ? Message-ID: <28996fa2d4d74e9b883587691f197514@forum-marais-atl.com> Hi, I use Mapserver with the Leaflet JS library and I want to display some attributes informations by clicking on the map. Therefore I use the GetFeatureInfo WMS request in order to return these informations. I managed to get the infos with the text/html format but I'd like to get a JSON response back in my browser, e.g : { "value": [value_0], // I must precise I use GetFeatureInfo on a raster } So I changed the wms_get_feature_info_formalist in the METADATA bloc of my mapfile : "wms_getfeatureinfo_formatlist" "application/json" Then, I edited my template as following to return the value of the pixel : [value_0] My GetFeatureInfo request is the one (see "application/json" specified in the INFO_FORMAT parameter) http://IP/cgi-bin/mapserv?map=/var/www/html/mapfiles/test1.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=465348.6282001531,5431156.607774916,697564.3201305186,5503160.28841955&SRS=EPSG:3857&WIDTH=1519&HEIGHT=471&LAYERS=layer1&STYLES=&FORMAT=image/png&TRANSPARENT=true&QUERY_LAYERS=layer1&INFO_FORMAT=application/json&X=766&Y=261 But when I try the GetFeatureInfo request, my browser returns nothing (whereas it works with the text/html) and it downloads a file called "mapserv" with nothing inside : [enter image description here] I must explain I don't want to download a GeoJSON file but to return the content of a JSON response in my browser. Do you know how I could get my JSON response ? Is it possible to make it work ? Any help would be greatly appreciated, thanks ! -- Julien H Back-end developper Forum des Marais Atlantiques -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 3277 bytes Desc: image001.png URL: From sander.pukk at gmail.com Thu Sep 14 05:05:36 2023 From: sander.pukk at gmail.com (Sander Pukk) Date: Thu, 14 Sep 2023 15:05:36 +0300 Subject: [MapServer-users] Mapserver transparent legend Message-ID: Hi! For the life of me, I cant get the Legend background any other color than white. My request is fairly simple: https://xxxx/mapserv?map=xxxxx.map&version=1.3.0&service=WMS&request=GetLegendGraphic&sld_version=1.1.0&layer=layer_name&format=image/png&STYLE=default Is there a URL parameter I can add to change the color or transparent? I have tried bgcolo(u)r, imagecolor, color etc. Tried a SLD_BODY as well, but didnt change Any ideas? With kind regards, Sander -------------- next part -------------- An HTML attachment was scrubbed... URL: From troels at arvin.dk Thu Sep 14 07:05:41 2023 From: troels at arvin.dk (Troels Arvin) Date: Thu, 14 Sep 2023 16:05:41 +0200 Subject: [MapServer-users] Silent error running mapserver Message-ID: Hello, I'm struggling to find out why my newly compiled Mapserver 8 exits without any output and without any error messages. Using Mapserver 6, the following command resulted in PNG output. /usr/local/bin/mapserv QUERY_STRING="map=/foo/my.map&min_x_wc=545984&min_y_wc=6283731.2&max_x_wc=547622.4&max_y_wc=6285369.600000001&layers=theme1&phaseid=00000000-0000-0000-0000-000000000000&elementtypekeys=''&service=WMS&srs=EPSG:25832&workspaceid=66ddb06f-0527-4dc8-89db-d8ed3edf10b3&profileid=00000000-0000-0000-0000-000000000000&_olsalt=0.5323379383513367&width=256&bbox=XXX,XXX,XXX,XXX&height=256&transparent=TRUE&request=GetMap&version=1.1.1&format=image/png&draftid=00000000-0000-0000-0000-000000000000&foo=bar" But using Mapserver 8, nothing happens. On the command line, the result code of the command is 0. Using strace, the last activities look like this: ================================================ 710989 read(3, "ass\n????? name \"9.26_0\"\n????? expression ('[elementtypekey]' = '9.26_0' )\n\n????? style\n symbo"..., 8192) = 8192 710989 access("/home/foo at bar.org", W_OK) = 0 710989 openat(AT_FDCWD, "/home/foo at bar.org/.local/share/proj/epsg", O_RDONLY) = -1 ENOENT (No such file or directory) 710989 openat(AT_FDCWD, "/usr/share/proj/epsg", O_RDONLY) = 5 710989 close(5)???????????????????????? = 0 710989 close(3)???????????????????????? = 0 710989 newfstatat(AT_FDCWD, "/usr/share/proj/proj.db", {st_mode=S_IFREG|0644, st_size=7921664, ...}, 0) = 0 710989 newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=7921664, ...}, AT_EMPTY_PATH) = 0 710989 newfstatat(AT_FDCWD, "/usr/share/proj/proj.db", {st_mode=S_IFREG|0644, st_size=7921664, ...}, 0) = 0 710989 close(4)???????????????????????? = 0 710989 munmap(0x7fc8a3d03000, 135168)?? = 0 710989 munmap(0x7fc8a3d24000, 258048)?? = 0 710989 exit_group(0)??????????????????? = ? 710989 +++ exited with 0 +++ ================================================ Output from "mapserv -v": MapServer version 8.0.1 PROJ version 6.3 GDAL version 3.4 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF Any ideas? -- Kind regards, Troels Arvin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Thu Sep 14 07:13:53 2023 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka) Date: Thu, 14 Sep 2023 14:13:53 +0000 Subject: [MapServer-users] How to get a WMS GetFeatureInfo response with MapServer in JSON format ? In-Reply-To: <28996fa2d4d74e9b883587691f197514@forum-marais-atl.com> References: <28996fa2d4d74e9b883587691f197514@forum-marais-atl.com> Message-ID: Hi, To those who try to help, please have a look at the same question in gis.stackexchange https://gis.stackexchange.com/questions/466896/how-to-get-a-wms-getfeatureinfo-response-with-mapserver-in-json-format/466920? There is an answer that gives half an answer, but a remaining problem is how to insert raster layer attributes into a JSON template. -Jukka Rahkonen- L?hett?j?: MapServer-users Puolesta Julien Hubert L?hetetty: torstai 14. syyskuuta 2023 11.26 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: [MapServer-users] How to get a WMS GetFeatureInfo response with MapServer in JSON format ? Hi, I use Mapserver with the Leaflet JS library and I want to display some attributes informations by clicking on the map. Therefore I use the GetFeatureInfo WMS request in order to return these informations. I managed to get the infos with the text/html format but I'd like to get a JSON response back in my browser, e.g : { "value": [value_0], // I must precise I use GetFeatureInfo on a raster } So I changed the wms_get_feature_info_formalist in the METADATA bloc of my mapfile : "wms_getfeatureinfo_formatlist" "application/json" Then, I edited my template as following to return the value of the pixel : [value_0] My GetFeatureInfo request is the one (see "application/json" specified in the INFO_FORMAT parameter) http://IP/cgi-bin/mapserv?map=/var/www/html/mapfiles/test1.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=465348.6282001531,5431156.607774916,697564.3201305186,5503160.28841955&SRS=EPSG:3857&WIDTH=1519&HEIGHT=471&LAYERS=layer1&STYLES=&FORMAT=image/png&TRANSPARENT=true&QUERY_LAYERS=layer1&INFO_FORMAT=application/json&X=766&Y=261 But when I try the GetFeatureInfo request, my browser returns nothing (whereas it works with the text/html) and it downloads a file called "mapserv" with nothing inside : [enter image description here] I must explain I don't want to download a GeoJSON file but to return the content of a JSON response in my browser. Do you know how I could get my JSON response ? Is it possible to make it work ? Any help would be greatly appreciated, thanks ! -- Julien H Back-end developper Forum des Marais Atlantiques -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 3277 bytes Desc: image001.png URL: From sethg at geographika.co.uk Fri Sep 15 00:02:41 2023 From: sethg at geographika.co.uk (Seth G) Date: Fri, 15 Sep 2023 09:02:41 +0200 Subject: [MapServer-users] Silent error running mapserver In-Reply-To: References: Message-ID: Hi, How are you setting your "PROJ_LIB" path? It looks like it can't find the Proj SHARE directory. Are you able to share a Mapfile? Maybe try with a cut-down version - there are lots of custom parameters in your querystring (that shouldn't affect things, but a simpler test case would be easier to debug). Seth -- web:https://geographika.net & https://mapserverstudio.net twitter: @geographika On Thu, Sep 14, 2023, at 4:05 PM, Troels Arvin wrote: > Hello, > > I'm struggling to find out why my newly compiled Mapserver 8 exits without any output and without any error messages. > > Using Mapserver 6, the following command resulted in PNG output. > > /usr/local/bin/mapserv QUERY_STRING="map=/foo/my.map&min_x_wc=545984&min_y_wc=6283731.2&max_x_wc=547622.4&max_y_wc=6285369.600000001&layers=theme1&phaseid=00000000-0000-0000-0000-000000000000&elementtypekeys=''&service=WMS&srs=EPSG:25832&workspaceid=66ddb06f-0527-4dc8-89db-d8ed3edf10b3&profileid=00000000-0000-0000-0000-000000000000&_olsalt=0.5323379383513367&width=256&bbox=XXX,XXX,XXX,XXX&height=256&transparent=TRUE&request=GetMap&version=1.1.1&format=image/png&draftid=00000000-0000-0000-0000-000000000000&foo=bar" > > But using Mapserver 8, nothing happens. On the command line, the result code of the command is 0. > > Using strace, the last activities look like this: > > ================================================ > > 710989 read(3, "ass\n name \"9.26_0\"\n expression ('[elementtypekey]' = '9.26_0' )\n\n style\n symbo"..., 8192) = 8192 > 710989 access("/home/foo at bar.org", W_OK) = 0 > 710989 openat(AT_FDCWD, "/home/foo at bar.org/.local/share/proj/epsg", O_RDONLY) = -1 ENOENT (No such file or directory) > 710989 openat(AT_FDCWD, "/usr/share/proj/epsg", O_RDONLY) = 5 > 710989 close(5) = 0 > 710989 close(3) = 0 > 710989 newfstatat(AT_FDCWD, "/usr/share/proj/proj.db", {st_mode=S_IFREG|0644, st_size=7921664, ...}, 0) = 0 > 710989 newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=7921664, ...}, AT_EMPTY_PATH) = 0 > 710989 newfstatat(AT_FDCWD, "/usr/share/proj/proj.db", {st_mode=S_IFREG|0644, st_size=7921664, ...}, 0) = 0 > 710989 close(4) = 0 > 710989 munmap(0x7fc8a3d03000, 135168) = 0 > 710989 munmap(0x7fc8a3d24000, 258048) = 0 > 710989 exit_group(0) = ? > 710989 +++ exited with 0 +++ > > ================================================ > > Output from "mapserv -v": > > MapServer version 8.0.1 PROJ version 6.3 GDAL version 3.4 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF > > Any ideas? > > -- > Kind regards, > Troels Arvin > > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmckenna at gatewaygeomatics.com Fri Sep 15 05:51:59 2023 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Fri, 15 Sep 2023 09:51:59 -0300 Subject: [MapServer-users] demo. server updates happening now Message-ID: <8edc146e-125f-2718-f0ad-65a1517b905e@gatewaygeomatics.com> Notice that I'm doing many upgrades today to the server hosting demo.mapserver.org , expect minor downtime. -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ From troels at arvin.dk Mon Sep 18 08:30:27 2023 From: troels at arvin.dk (Troels Arvin) Date: Mon, 18 Sep 2023 17:30:27 +0200 Subject: [MapServer-users] Silent error running mapserver In-Reply-To: References: Message-ID: <00414733-2e8c-965f-fc94-c167b9fe7e32@arvin.dk> Hello, Seth G wrote: > Are you able to share a Mapfile? Maybe try with a cut-down version I found out things seem to fail due to a FILTER expression in the map file which result in an "... AND ()" clause to be added to the SQL being sent to the database (which is a syntax error, at least in Postgres). My issue seems to have to do with the change from 6 to 7 where: " Note Until MapServer 6, native filters could be specified as: ? FILTER 'where id=234'. ? But this is no longer supported." (From https://mapserver.org/mapfile/layer.html ) The odd thing is we have Windows Mapserver 7 where the map files are still working. Mapserver would be completely similar regarding map file rules, regardless of operating system, I'd assume. -- Troels From sethg at geographika.co.uk Mon Sep 18 14:06:54 2023 From: sethg at geographika.co.uk (Seth G) Date: Mon, 18 Sep 2023 23:06:54 +0200 Subject: [MapServer-users] Silent error running mapserver In-Reply-To: <00414733-2e8c-965f-fc94-c167b9fe7e32@arvin.dk> References: <00414733-2e8c-965f-fc94-c167b9fe7e32@arvin.dk> Message-ID: <702cf749-10e6-4156-9154-0d92a226ea90@app.fastmail.com> Hi, Mapfiles are very portable between operating systems, with some possible edge cases as dependencies such as the regex library may vary, or a different code path is used on Windows which may render something slightly differently, or produce different line endings. It is more likely something changed between MapServer 7 and 8 which would cause this to break, possibly the change here [1]. It does sound like a bug though if an invalid SQL statement is created, and if a test case can be created it would be good to open an issue. In any case it is best to update to the new PROCESSING 'NATIVE_FILTER=id=234' format for Mapfiles in MapServer 8.0. Seth [1] https://github.com/MapServer/MapServer/blob/6991fd2d2b21270e9368b52526a89a0204c2399b/src/mappostgis.cpp#L2012 -- web:https://geographika.net & https://mapserverstudio.net twitter: @geographika On Mon, Sep 18, 2023, at 5:30 PM, Troels Arvin wrote: > Hello, > > Seth G wrote: >> Are you able to share a Mapfile? Maybe try with a cut-down version > > I found out things seem to fail due to a FILTER expression in the map > file which result in an "... AND ()" clause to be added to the SQL being > sent to the database (which is a syntax error, at least in Postgres). > > My issue seems to have to do with the change from 6 to 7 where: > > " Note Until MapServer 6, native filters could be specified as: > ? FILTER 'where id=234'. > ? But this is no longer supported." > > (From https://mapserver.org/mapfile/layer.html ) > > The odd thing is we have Windows Mapserver 7 where the map files are > still working. Mapserver would be completely similar regarding map file > rules, regardless of operating system, I'd assume. > > -- > Troels From troels at arvin.dk Mon Sep 18 23:48:34 2023 From: troels at arvin.dk (Troels Arvin) Date: Tue, 19 Sep 2023 08:48:34 +0200 Subject: [MapServer-users] Silent error running mapserver In-Reply-To: <702cf749-10e6-4156-9154-0d92a226ea90@app.fastmail.com> References: <00414733-2e8c-965f-fc94-c167b9fe7e32@arvin.dk> <702cf749-10e6-4156-9154-0d92a226ea90@app.fastmail.com> Message-ID: Hello, Seth G wrote: > It is more likely something changed between MapServer 7 and 8 which would cause this to break I am still only aiming for Mapserver 7 (hoping to use the in-box Mapserver packages in Ubuntu 22). Is https://github.com/MapServer/MapServer/blob/6991fd2d2b21270e9368b52526a89a0204c2399b/src/mappostgis.cpp#L2012 a Mapserver 8 only code change? > It does sound like a bug though if an invalid SQL statement is created What I think is going on: I am using raw filter expressions which are no longer valid in MS 7+. But then instead of throwing an error (which would be the thing to do, in my opinion), Mapserver converts the filter expression to an " AND ()" clause. I hope to provide a minimal test case for that later. -- Kind regards, Troels Arvin From trygve at aspenes.priv.no Thu Sep 21 06:51:46 2023 From: trygve at aspenes.priv.no (Trygve Aspenes) Date: Thu, 21 Sep 2023 15:51:46 +0200 Subject: [MapServer-users] Handeling gdal driver via tileitem for raster Message-ID: <6901d0806f742c6d28c88fc404257950@aspenes.priv.no> Hi I have a postgis db with netcdf filenames and the rest of the needed columns. So I have a layer, time_idx, to get the geom. And the raster layer with tileitem and tileindex like this: LAYER NAME "layername" STATUS ON TYPE raster PROCESSING "BANDS=1" TILEITEM "filename" TILEINDEX "time_idx" END The problem is the filename is handled as a full path to a filename. But since this is a netcdf I need something like this (See eg https://gdal.org/drivers/raster/netcdf.html#raster-netcdf) gdalinfo NETCDF:"sst.nc":tos Where NETCDF is the drive sst.nc is the filename tos is the variable name in the file. Is there a way to prepend the driver and append the variable name to the tileitem? Using DATA directly works. img2map give me like this: msPostGISLayerWhichShapes query status: PGRES_TUPLES_OK (2) msPostGISLayerWhichShapes got 1 records in result. msPostGISLayerNextShape called. msPostGISReadShape called. msPostGISReadShape: PQgetlength = 86 msPostGISReadShape: [filename] "netcdf-filename.nc" msPostGISReadShape: Setting shape->index = 5 msPostGISReadShape: Setting shape->resultindex = 0 msPostGISReadShape: [index] 5 msPostGISReadShape: [shape] POLYGON ((-2717181.7304994701407850 -5571048.1403121398761868, -2717181.7304994701407850 -1475048.1403121401090175, 1378818.2695005300920457 -1475048.1403121401090175, 1378818.2695005300920457 -5571048.1403121398761868, -2717181.7304994701407850 -5571048.1403121398761868)) msDrawRasterLayerLow(layer-name): Filename is: netcdf-filename.nc msDrawRasterLayerLow(layer-name): Path is: netcdf-filename.nc GDAL_netCDF: driver detected file type=3, libnetcdf detected type=3 GDAL_netCDF: var_count = 242 GDAL_netCDF: variable #26 [longitude] was ignored GDAL_netCDF: variable #27 [latitude] was ignored GDAL: GDALOpen(netcdf-filename.nc, this=0x56413c343280) succeeds as netCDF. msResampleGDALToMap in effect: cellsize = 1.000000 msDrawGDAL(layer-name): using RAW_WINDOW=0 0 512 512, dst=0,0,512,512 msGetGDALBandList(): Image handling error. Attempt to operate on GDAL file with no bands, layer=layer-name. GDAL: GDALClose(netcdf-filename.nc, this=0x56413c343280) msPostGISLayerFreeItemInfo called. msPostGISLayerClose called: geom from (select * from netcdf_data where product_variable='') as foo using unique id msConnPoolRelease(time_idx,host=10.88.0.3 user=postgres dbname=postgres port=5432 password=*********************************msConnPoolClose(host=10.88.0.3 user=postgres dbname=postgres port=5432 password=*********************************msDrawMap(): Image handling error. Failed to draw layer named 'layer-name'. msDrawMap(): Image handling error. Failed to draw layer named 'layer-name'.
msGetGDALBandList(): Image handling error. Attempt to operate on GDAL file with no bands, layer=layer-name.
msFreeMap(): freeing map at 0x56413bee40a0. freeLayer(): freeing layer at 0x56413bf67950. msPostGISLayerIsOpen called. freeLayer(): freeing layer at 0x56413bf68e50. GDAL: In GDALDestroy - unloading GDAL shared library. At least it detects the driver I think, but I still need to specify the variable. Any ideas are appreciated or if you can point me to the part of the code that handles this. Thanks! Trygve Aspenes From sethg at geographika.co.uk Thu Sep 28 03:05:40 2023 From: sethg at geographika.co.uk (Seth G) Date: Thu, 28 Sep 2023 12:05:40 +0200 Subject: [MapServer-users] mappyfile is now an OSGeo Community Project Message-ID: <82e53aba-b817-4d92-abc8-da796a283e42@app.fastmail.com> Hi all, This month mappyfile became an official OSGeo Community Project [1]. To celebrate there is a v1.0.0 release, this drops Python 2.7 support, but includes over a year of fixes and improvements. Full release notes are at [2]. mappyfile is a Python library that allows you to easily create, edit, and format MapServer Mapfiles. Source code is on GitHub [3] and docs are at https://mappyfile.readthedocs.io/ and it is available on PyPI [4]. Any feedback or issue reporting welcome, Seth [1] https://www.osgeo.org/projects/mappyfile/ [2] https://mappyfile.readthedocs.io/en/latest/HISTORY.html [3] https://github.com/geographika/mappyfile [4] https://pypi.org/project/mappyfile/ -- web:https://geographika.net & https://mapserverstudio.net twitter: @geographika From even.rouault at spatialys.com Thu Sep 28 07:28:37 2023 From: even.rouault at spatialys.com (Even Rouault) Date: Thu, 28 Sep 2023 16:28:37 +0200 Subject: [MapServer-users] mappyfile is now an OSGeo Community Project In-Reply-To: <82e53aba-b817-4d92-abc8-da796a283e42@app.fastmail.com> References: <82e53aba-b817-4d92-abc8-da796a283e42@app.fastmail.com> Message-ID: Hi Seth, Congratulations!? I believe it would make sense to point to mappyfile on the mapserver.org documentation. Exact place to be determined ("Around MapServer?"), but referencing the FOSS ecosystem upon MapServer would certainly be useful to users. Even Le 28/09/2023 ? 12:05, Seth G via MapServer-users a ?crit?: > Hi all, > > This month mappyfile became an official OSGeo Community Project [1]. To celebrate there is a v1.0.0 release, this drops Python 2.7 support, but includes over a year of fixes and improvements. Full release notes are at [2]. > > mappyfile is a Python library that allows you to easily create, edit, and format MapServer Mapfiles. Source code is on GitHub [3] and docs are at https://mappyfile.readthedocs.io/ and it is available on PyPI [4]. > > Any feedback or issue reporting welcome, > > Seth > > [1] https://www.osgeo.org/projects/mappyfile/ > [2] https://mappyfile.readthedocs.io/en/latest/HISTORY.html > [3] https://github.com/geographika/mappyfile > [4] https://pypi.org/project/mappyfile/ > > -- > web:https://geographika.net & https://mapserverstudio.net > twitter: @geographika > _______________________________________________ > 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. From trygve at aspenes.priv.no Thu Sep 28 09:25:03 2023 From: trygve at aspenes.priv.no (Trygve Aspenes) Date: Thu, 28 Sep 2023 18:25:03 +0200 Subject: [MapServer-users] Handeling gdal driver via tileitem for raster In-Reply-To: <6901d0806f742c6d28c88fc404257950@aspenes.priv.no> References: <6901d0806f742c6d28c88fc404257950@aspenes.priv.no> Message-ID: <502c4790688bd93341db3c5938bd93e8@aspenes.priv.no> I can answer myself; it might help some others in the future. So the trick or problem is SHAPEPATH. https://github.com/MapServer/MapServer/blob/main/src/mapraster.c#L442-L452 Here in the code the method to msDrawRasterBuildRasterPath is decided, and if you don't have SHAPEPATH set and you use tileindex, mapserver thinks you have a file an prepend some path, like './'. When I set SHAPEPATH to "" ( ie empty) in my config "" is prepended to my driver:filename:variable string. And I get what I want. I don't think this is a feature, but it works as long as you don't need to set SHAPEPATH to something else in you map file. Trygve Aspenes Den 2023-09-21 15:51, skrev Trygve Aspenes via MapServer-users: > Hi > I have a postgis db with netcdf filenames and the rest of the needed > columns. > > So I have a layer, time_idx, to get the geom. > And the raster layer with tileitem and tileindex like this: > LAYER > NAME "layername" > STATUS ON > TYPE raster > PROCESSING "BANDS=1" > > TILEITEM "filename" > TILEINDEX "time_idx" > END > > The problem is the filename is handled as a full path to a filename. > But since this is a netcdf I need something like this > (See eg https://gdal.org/drivers/raster/netcdf.html#raster-netcdf) > > gdalinfo NETCDF:"sst.nc":tos > Where NETCDF is the drive > sst.nc is the filename > tos is the variable name in the file. > > > Is there a way to prepend the driver and append the variable name to > the tileitem? Using DATA directly works. > > img2map give me like this: > > msPostGISLayerWhichShapes query status: PGRES_TUPLES_OK (2) > msPostGISLayerWhichShapes got 1 records in result. > msPostGISLayerNextShape called. > msPostGISReadShape called. > msPostGISReadShape: PQgetlength = 86 > msPostGISReadShape: [filename] "netcdf-filename.nc" > msPostGISReadShape: Setting shape->index = 5 > msPostGISReadShape: Setting shape->resultindex = 0 > msPostGISReadShape: [index] 5 > msPostGISReadShape: [shape] POLYGON ((-2717181.7304994701407850 > -5571048.1403121398761868, -2717181.7304994701407850 > -1475048.1403121401090175, 1378818.2695005300920457 > -1475048.1403121401090175, 1378818.2695005300920457 > -5571048.1403121398761868, -2717181.7304994701407850 > -5571048.1403121398761868)) > msDrawRasterLayerLow(layer-name): Filename is: netcdf-filename.nc > msDrawRasterLayerLow(layer-name): Path is: netcdf-filename.nc > GDAL_netCDF: driver detected file type=3, libnetcdf detected type=3 > GDAL_netCDF: var_count = 242 > GDAL_netCDF: variable #26 [longitude] was ignored > GDAL_netCDF: variable #27 [latitude] was ignored > GDAL: GDALOpen(netcdf-filename.nc, this=0x56413c343280) succeeds as > netCDF. > msResampleGDALToMap in effect: cellsize = 1.000000 > msDrawGDAL(layer-name): using RAW_WINDOW=0 0 512 512, dst=0,0,512,512 > msGetGDALBandList(): Image handling error. Attempt to operate on GDAL > file with no bands, layer=layer-name. > GDAL: GDALClose(netcdf-filename.nc, this=0x56413c343280) > msPostGISLayerFreeItemInfo called. > msPostGISLayerClose called: geom from (select * from netcdf_data where > product_variable='') as foo using unique id > msConnPoolRelease(time_idx,host=10.88.0.3 user=postgres dbname=postgres > port=5432 > password=*********************************msConnPoolClose(host=10.88.0.3 > user=postgres dbname=postgres port=5432 > password=*********************************msDrawMap(): Image handling > error. Failed to draw layer named 'layer-name'. > msDrawMap(): Image handling error. Failed to draw layer named > 'layer-name'.
> msGetGDALBandList(): Image handling error. Attempt to operate on GDAL > file with no bands, layer=layer-name.
> msFreeMap(): freeing map at 0x56413bee40a0. > freeLayer(): freeing layer at 0x56413bf67950. > msPostGISLayerIsOpen called. > freeLayer(): freeing layer at 0x56413bf68e50. > GDAL: In GDALDestroy - unloading GDAL shared library. > > > At least it detects the driver I think, but I still need to specify the > variable. > > Any ideas are appreciated or if you can point me to the part of the > code that handles this. > > Thanks! > > Trygve Aspenes > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users From sdlime at gmail.com Thu Sep 28 11:54:52 2023 From: sdlime at gmail.com (Steve Lime) Date: Thu, 28 Sep 2023 13:54:52 -0500 Subject: [MapServer-users] mappyfile is now an OSGeo Community Project In-Reply-To: References: <82e53aba-b817-4d92-abc8-da796a283e42@app.fastmail.com> Message-ID: Agreed! Congrats Seth! On Thu, Sep 28, 2023 at 9:29 AM Even Rouault via MapServer-users < mapserver-users at lists.osgeo.org> wrote: > Hi Seth, > > Congratulations! I believe it would make sense to point to mappyfile on > the mapserver.org documentation. Exact place to be determined ("Around > MapServer?"), but referencing the FOSS ecosystem upon MapServer would > certainly be useful to users. > > Even > > Le 28/09/2023 ? 12:05, Seth G via MapServer-users a ?crit : > > Hi all, > > > > This month mappyfile became an official OSGeo Community Project [1]. To > celebrate there is a v1.0.0 release, this drops Python 2.7 support, but > includes over a year of fixes and improvements. Full release notes are at > [2]. > > > > mappyfile is a Python library that allows you to easily create, edit, > and format MapServer Mapfiles. Source code is on GitHub [3] and docs are at > https://mappyfile.readthedocs.io/ and it is available on PyPI [4]. > > > > Any feedback or issue reporting welcome, > > > > Seth > > > > [1] https://www.osgeo.org/projects/mappyfile/ > > [2] https://mappyfile.readthedocs.io/en/latest/HISTORY.html > > [3] https://github.com/geographika/mappyfile > > [4] https://pypi.org/project/mappyfile/ > > > > -- > > web:https://geographika.net & https://mapserverstudio.net > > twitter: @geographika > > _______________________________________________ > > 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. > > _______________________________________________ > 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 trygve at aspenes.priv.no Fri Sep 29 08:29:43 2023 From: trygve at aspenes.priv.no (Trygve Aspenes) Date: Fri, 29 Sep 2023 17:29:43 +0200 Subject: [MapServer-users] mapcache: Setting styles for a tileset and source Message-ID: Hi In mapserver I have several styles. In mapcache I see no styles info in the getcapabilities document, so my app can't know anything about it. Anyway, you would need one tileset for each styles to cache the data. So right, that makes sense. Then I try to make one tileset per style. I add to my source config, getmap like this: http://mapserver:8080? image/png tileset style_name But no luck. STYLES is sent empty to my mapserver wms server. I haven't got time to debug the code now, but my first look, STYLES should be handled here: https://github.com/MapServer/mapcache/blob/main/lib/source_wms.c#L154-L167 the for loop would parse all elements. But I would need a closer look to see if this is what actually happends. Anyone else know how to handle styles in mapcache? Trygve Aspenes From trygve at aspenes.priv.no Fri Sep 29 08:45:56 2023 From: trygve at aspenes.priv.no (Trygve Aspenes) Date: Fri, 29 Sep 2023 17:45:56 +0200 Subject: [MapServer-users] mapcache: Setting styles for a tileset and source In-Reply-To: References: Message-ID: <00dbbc00f6dfbb77d357f8ed586875e8@aspenes.priv.no> hm, wait The request from my app is based on the getcapability from mapcache, so no styles. But when mapcache is sending the request to mapserver the configured STYLES in the getmap section in the mapcache config is added correctly. I don't know how I missed that, but I think I get what I expect now. Trygve Aspenes Den 2023-09-29 17:29, skrev Trygve Aspenes via MapServer-users: > Hi > > In mapserver I have several styles. > > In mapcache I see no styles info in the getcapabilities document, so my > app can't know anything about it. > Anyway, you would need one tileset for each styles to cache the data. > So right, that makes sense. > > Then I try to make one tileset per style. I add to my source config, > getmap like this: > > > > http://mapserver:8080? > > > > image/png > tileset > style_name > > > > > But no luck. STYLES is sent empty to my mapserver wms server. I haven't > got time to debug the code now, but my first look, STYLES should be > handled here: > https://github.com/MapServer/mapcache/blob/main/lib/source_wms.c#L154-L167 > > the for loop would parse all elements. But I would need a closer look > to see if this is what actually happends. > > Anyone else know how to handle styles in mapcache? > > Trygve Aspenes > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users