From jukka.rahkonen at maanmittauslaitos.fi Mon Nov 1 00:58:42 2021 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Mon, 1 Nov 2021 07:58:42 +0000 Subject: [mapserver-users] Point query from Mapserver raster Message-ID: <6a414668e73549598779bb0298232034@maanmittauslaitos.fi> Hi, The WMS GetFeatureInfo should work and the answer in gis.stackexhange seems to contain all the details that you need for making it to work. With WCS what you did is probably the best you can do with Mapserver. With some other servers you may get a single pixel output by using WCS slicing (subset=Long(-100)&subset=Lat(22)) or trimming with lowerlimit=upperlimit (subset=Long(-100,-100)&subset=Lat(22,22)) but Mapserver does not support either. See https://osgeo-org.atlassian.net/browse/GEOS-9553. I could not find a link to an answer by Stefan Meissl about why Mapserver does not support slicing but it was about dimensions. A raster image can be considered to be two dimensional even when it has only one pixel, but by the WCS standard each trim is removing one dimension. Slicing DEM with two axes must return a zero dimensional result and raster formats do not support that. I still think that subsets with lower=upper limits should works and return a single pixel output but that does not work with either Mapserver or Geoserver. See also https://www.mail-archive.com/search?l=mapserver-users%40lists.osgeo.org&q=subject:%22%5C%5Bmapserver%5C-users%5C%5D+WCS+GetCoverage+request+one++by+one+pixel%22&o=newest&f=1 -Jukka Rahkonen- L?hett?j?: MapServer-users Puolesta Carl Godkin L?hetetty: lauantai 30. lokakuuta 2021 2.10 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: [mapserver-users] Point query from Mapserver raster Hi, Now that I have my WMS and WCS servers working well (thanks, list!!), I have one more thing I would like to figure out how to do. I want to do point queries on [Lat,Lon] points for their elevation from the terrain layer I have. I have done some searching and come across various ideas such as Raster Query (https://mapserver.org/input/raster.html#raster-query) and a query template (https://gis.stackexchange.com/questions/167239/mapserver-raster-picking-elevation-data) but haven't found enough information for either to implement it. I came up with a solution that works fine, but might be considered as going "All Around the Barn" What works is to add an ASCII output format to my map file that serves terrain like this: OUTPUTFORMAT NAME XYZ DRIVER "GDAL/XYZ" MIMETYPE "text/plain" IMAGEMODE FLOAT32 EXTENSION "txt" END and then use GetCoverage on a small rectangle whose lower-left corner is the point whose elevation I want: http://localhost:8080/wcs?SERVICE=WCS&VERSION=2.0.1&REQUEST=GetCoverage&coverageid=SRTM_3_arc-second_grid&format=XYZ&subset=Lat(42.948,42.958)&subset=Lon(-122.086,-122.076) and then take the first line of the returned output file. What would Mapserver best practice be for a problem like this? Thanks very much, carl -------------- next part -------------- An HTML attachment was scrubbed... URL: From cgodkin at gmail.com Mon Nov 1 06:50:41 2021 From: cgodkin at gmail.com (Carl Godkin) Date: Mon, 1 Nov 2021 06:50:41 -0700 Subject: [mapserver-users] Point query from Mapserver raster In-Reply-To: <6a414668e73549598779bb0298232034@maanmittauslaitos.fi> References: <6a414668e73549598779bb0298232034@maanmittauslaitos.fi> Message-ID: Hi Jukka, Thank you for your reply. I will play around with WMS + GetFeatureInfo and see if I can make that work. I'm still pretty new to this stuff and WCS seemed the more natural service for this. Thanks, carl On Mon, Nov 1, 2021 at 12:58 AM Rahkonen Jukka (MML) < jukka.rahkonen at maanmittauslaitos.fi> wrote: > Hi, > > > > The WMS GetFeatureInfo should work and the answer in gis.stackexhange > seems to contain all the details that you need for making it to work. > > With WCS what you did is probably the best you can do with Mapserver. With > some other servers you may get a single pixel output by using WCS slicing > (subset=Long(-100)&subset=Lat(22)) or trimming with lowerlimit=upperlimit > (subset=Long(-100,-100)&subset=Lat(22,22)) but Mapserver does not support > either. See https://osgeo-org.atlassian.net/browse/GEOS-9553. > > > > I could not find a link to an answer by Stefan Meissl about why Mapserver > does not support slicing but it was about dimensions. A raster image can be > considered to be two dimensional even when it has only one pixel, but by > the WCS standard each trim is removing one dimension. Slicing DEM with two > axes must return a zero dimensional result and raster formats do not > support that. I still think that subsets with lower=upper limits should > works and return a single pixel output but that does not work with either > Mapserver or Geoserver. See also > https://www.mail-archive.com/search?l=mapserver-users%40lists.osgeo.org&q=subject:%22%5C%5Bmapserver%5C-users%5C%5D+WCS+GetCoverage+request+one++by+one+pixel%22&o=newest&f=1 > > > > > > -Jukka Rahkonen- > > > > > > *L?hett?j?:* MapServer-users *Puolesta > *Carl Godkin > *L?hetetty:* lauantai 30. lokakuuta 2021 2.10 > *Vastaanottaja:* mapserver-users at lists.osgeo.org > *Aihe:* [mapserver-users] Point query from Mapserver raster > > > > Hi, > > Now that I have my WMS and WCS servers working well (thanks, list!!), I > have one more thing I would like to figure out how to do. > > > > I want to do point queries on [Lat,Lon] points for their elevation from > the terrain layer I have. > > > > I have done some searching and come across various ideas such as Raster > Query (https://mapserver.org/input/raster.html#raster-query) and a query > template ( > https://gis.stackexchange.com/questions/167239/mapserver-raster-picking-elevation-data) > but haven't found enough information for either to implement it. > > > > I came up with a solution that works fine, but might be considered as > going "All Around the Barn" What works is to add an ASCII output format > to my map file that serves terrain like this: > > > > OUTPUTFORMAT > > NAME XYZ > > DRIVER "GDAL/XYZ" > > MIMETYPE "text/plain" > > IMAGEMODE FLOAT32 > > EXTENSION "txt" > > END > > > > and then use GetCoverage on a small rectangle whose lower-left corner > > is the point whose elevation I want: > > > > > http://localhost:8080/wcs?SERVICE=WCS&VERSION=2.0.1&REQUEST=GetCoverage&coverageid=SRTM_3_arc-second_grid&format=XYZ&subset=Lat(42.948,42.958)&subset=Lon(-122.086,-122.076) > > > > and then take the first line of the returned output file. > > > > What would Mapserver best practice be for a problem like this? > > > > Thanks very much, > > > > carl > > > > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob.basques at ci.stpaul.mn.us Tue Nov 2 07:55:37 2021 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Tue, 2 Nov 2021 14:55:37 +0000 Subject: [mapserver-users] [Need Presenter] OSGeo Twin Cities (aka TCMUG) Local Chapter Meeting - Nov 10th (4:30pm CDT) Message-ID: <06BEA534-F62E-4828-8CE8-91AE0CAF9ABD@ci.stpaul.mn.us> All, Casting out for a presenter for next Wednesdays online Twin Cities OSGeo Local Chapter meeting. I?ll take care of the meeting announcement/setup/recording. Just send me a short Bio and title for your presentation, 30-45 min. Now?s your chance to show what you?ve been working on. Bobb -------------- next part -------------- An HTML attachment was scrubbed... URL: From cgodkin at gmail.com Tue Nov 2 08:06:00 2021 From: cgodkin at gmail.com (Carl Godkin) Date: Tue, 2 Nov 2021 08:06:00 -0700 Subject: [mapserver-users] Point query from Mapserver raster In-Reply-To: <6a414668e73549598779bb0298232034@maanmittauslaitos.fi> References: <6a414668e73549598779bb0298232034@maanmittauslaitos.fi> Message-ID: Hi, Following Jukka's advice on my elevation point query, I am trying to use WMS GetFeatureInfo, I've mostly got it working but have a few more questions. (I am using MS4W 4.0.5 which includes MapServer 7.7.0) I added a LAYER to my WMS map file: LAYER PROCESSING "RESAMPLE=BILINEAR" NAME SRTM_3_arc-second_grid METADATA "wms_title" "SRTM - 3 arc-second grid" "ows_extent" "-125 24 -66 50" "wms_include_items" "all" END TYPE RASTER STATUS ON TILEINDEX "srtm_3_hgt-index.shp" TILEITEM "Location" TEMPLATE "../template.html" PROJECTION "init=epsg:4326" END END and an empty template except for the line. Here's my query: http://localhost:8080/wms? SERVICE=WMS& VERSION=1.3.0& REQUEST=GetFeatureInfo& LAYERS=SRTM_3_arc-second_grid& CRS=EPSG:4326& BBOX= 42.94,-122.09,42.95,-122.08& WIDTH=2& HEIGHT=2& X=1& Y=1& QUERY_LAYERS=SRTM_3_arc-second_grid This works fine and returns the elevation I am expecting. However, the MapServer log complains about a "degenerate rect" every time: [Tue Nov 2 07:58:44 2021].66000 msProjectRect(): Warning: degenerate rect {-122.082500,42.942500,-122.082500,42.942500} What am I doing wrong here? As I posted originally, I am really only interested in a point here. Thank you very much, carl On Mon, Nov 1, 2021 at 12:58 AM Rahkonen Jukka (MML) < jukka.rahkonen at maanmittauslaitos.fi> wrote: > Hi, > > > > The WMS GetFeatureInfo should work and the answer in gis.stackexhange > seems to contain all the details that you need for making it to work. > > With WCS what you did is probably the best you can do with Mapserver. With > some other servers you may get a single pixel output by using WCS slicing > (subset=Long(-100)&subset=Lat(22)) or trimming with lowerlimit=upperlimit > (subset=Long(-100,-100)&subset=Lat(22,22)) but Mapserver does not support > either. See https://osgeo-org.atlassian.net/browse/GEOS-9553. > > > > I could not find a link to an answer by Stefan Meissl about why Mapserver > does not support slicing but it was about dimensions. A raster image can be > considered to be two dimensional even when it has only one pixel, but by > the WCS standard each trim is removing one dimension. Slicing DEM with two > axes must return a zero dimensional result and raster formats do not > support that. I still think that subsets with lower=upper limits should > works and return a single pixel output but that does not work with either > Mapserver or Geoserver. See also > https://www.mail-archive.com/search?l=mapserver-users%40lists.osgeo.org&q=subject:%22%5C%5Bmapserver%5C-users%5C%5D+WCS+GetCoverage+request+one++by+one+pixel%22&o=newest&f=1 > > > > > > -Jukka Rahkonen- > > > > > > *L?hett?j?:* MapServer-users *Puolesta > *Carl Godkin > *L?hetetty:* lauantai 30. lokakuuta 2021 2.10 > *Vastaanottaja:* mapserver-users at lists.osgeo.org > *Aihe:* [mapserver-users] Point query from Mapserver raster > > > > Hi, > > Now that I have my WMS and WCS servers working well (thanks, list!!), I > have one more thing I would like to figure out how to do. > > > > I want to do point queries on [Lat,Lon] points for their elevation from > the terrain layer I have. > > > > I have done some searching and come across various ideas such as Raster > Query (https://mapserver.org/input/raster.html#raster-query) and a query > template ( > https://gis.stackexchange.com/questions/167239/mapserver-raster-picking-elevation-data) > but haven't found enough information for either to implement it. > > > > I came up with a solution that works fine, but might be considered as > going "All Around the Barn" What works is to add an ASCII output format > to my map file that serves terrain like this: > > > > OUTPUTFORMAT > > NAME XYZ > > DRIVER "GDAL/XYZ" > > MIMETYPE "text/plain" > > IMAGEMODE FLOAT32 > > EXTENSION "txt" > > END > > > > and then use GetCoverage on a small rectangle whose lower-left corner > > is the point whose elevation I want: > > > > > http://localhost:8080/wcs?SERVICE=WCS&VERSION=2.0.1&REQUEST=GetCoverage&coverageid=SRTM_3_arc-second_grid&format=XYZ&subset=Lat(42.948,42.958)&subset=Lon(-122.086,-122.076) > > > > and then take the first line of the returned output file. > > > > What would Mapserver best practice be for a problem like this? > > > > Thanks very much, > > > > carl > > > > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmckenna at gatewaygeomatics.com Tue Nov 2 08:08:19 2021 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Tue, 2 Nov 2021 12:08:19 -0300 Subject: [mapserver-users] searching the list archives Message-ID: Hi all, As most of you know, Nabble.com has been unreliable, so here are some updated ways to search the MapServer list archives: - mapserver-users: https://www.mail-archive.com/mapserver-users at lists.osgeo.org/ (or https://marc.info/?l=mapserver-users ) - mapserver-dev: https://marc.info/?l=mapserver-dev (I've begun the process to enable mail-archive.com for the dev list: https://www.mail-archive.com/mapserver-dev at lists.osgeo.org/ -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ From jukka.rahkonen at maanmittauslaitos.fi Tue Nov 2 08:31:21 2021 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Tue, 2 Nov 2021 15:31:21 +0000 Subject: [mapserver-users] Point query from Mapserver raster Message-ID: <2d1182a7d55e4f7d8addd74428102dbb@maanmittauslaitos.fi> Hi, (Had to clip some text from the bottom because of the size limit of this list) You do not seem to do anything wrong. Your WMS 1.3.0 EPSG:4326 lat-long BBOX=42.94,-122.09,42.95,-122.08& gets converted into long-lat order and for some reason the lower and higher values are equal {-122.082500,42.942500,-122.082500,42.942500}, thus this is no more a box but a point. GetFeatureInfo with a small bbox and width=2 and height=2 is a trick that is certainly not heavily tested because the corresponding GetMap is pretty odd despite being valid. Maybe using slightly bigger BBOX makes Mapserver to query the backend raster with a rectangle instead of a point. BTW X=1 and Y=1 are not valid in WMS 1.3.0, you are supposed to use i= and j= instead. That makes me think that maybe you could have a try with a full and valid WMS 1.1.0 GetFeatureInfo request with SRS= and BBOX in long-lat order and see if it has any effect on the msProjectRect() -Jukka Rahkonen- L?hett?j?: MapServer-users > Puolesta Carl Godkin L?hetetty: tiistai 2. marraskuuta 2021 17.06 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: Re: [mapserver-users] Point query from Mapserver raster Hi, Following Jukka's advice on my elevation point query, I am trying to use WMS GetFeatureInfo, I've mostly got it working but have a few more questions. (I am using MS4W 4.0.5 which includes MapServer 7.7.0) I added a LAYER to my WMS map file: LAYER PROCESSING "RESAMPLE=BILINEAR" NAME SRTM_3_arc-second_grid METADATA "wms_title" "SRTM - 3 arc-second grid" "ows_extent" "-125 24 -66 50" "wms_include_items" "all" END TYPE RASTER STATUS ON TILEINDEX "srtm_3_hgt-index.shp" TILEITEM "Location" TEMPLATE "../template.html" PROJECTION "init=epsg:4326" END END and an empty template except for the line. Here's my query: http://localhost:8080/wms? SERVICE=WMS& VERSION=1.3.0& REQUEST=GetFeatureInfo& LAYERS=SRTM_3_arc-second_grid& CRS=EPSG:4326& BBOX=42.94,-122.09,42.95,-122.08& WIDTH=2& HEIGHT=2& X=1& Y=1& QUERY_LAYERS=SRTM_3_arc-second_grid This works fine and returns the elevation I am expecting. However, the MapServer log complains about a "degenerate rect" every time: [Tue Nov 2 07:58:44 2021].66000 msProjectRect(): Warning: degenerate rect {-122.082500,42.942500,-122.082500,42.942500} What am I doing wrong here? As I posted originally, I am really only interested in a point here. Thank you very much, carl -------------- next part -------------- An HTML attachment was scrubbed... URL: From cgodkin at gmail.com Tue Nov 2 09:04:01 2021 From: cgodkin at gmail.com (Carl Godkin) Date: Tue, 2 Nov 2021 09:04:01 -0700 Subject: [mapserver-users] Point query from Mapserver raster In-Reply-To: <4e91505e1cf742a186a9e987ccd86916@maanmittauslaitos.fi> References: <4e91505e1cf742a186a9e987ccd86916@maanmittauslaitos.fi> Message-ID: Thanks for the quick response, Jukka. I did not realize that X/Y had been replaced by I/J. I just tried that instead and it still worked (of course) but I still get the warning message. I had also been trying WMS 1.1.0 and 1.1.1 earlier and I am unable to find any combination of versions and other query parameters to quiet the warning message. Regarding the BBOX range, I opened the range to a full degree in each direction and still get the warning. I think I will stick with the query I posted originally (with 1.3.0) since it works and just ignore the messages in the log. This seems like sort of a hack to me (asking for a box when I want a point, etc.) which is why I asked my question in the first place. But it works fine so I'm happy! Thanks again, carl On Tue, Nov 2, 2021 at 8:29 AM Rahkonen Jukka (MML) < jukka.rahkonen at maanmittauslaitos.fi> wrote: > Hi, > > > > You do not seem to do anything wrong. Your WMS 1.3.0 EPSG:4326 lat-long > BBOX=42.94,-122.09,42.95,-122.08& gets converted into long-lat order and > for some reason the lower and higher values are equal > {-122.082500,42.942500,-122.082500,42.942500}, thus this is no more a box > but a point. > > GetFeatureInfo with a small bbox and width=2 and height=2 is a trick that > is certainly not heavily tested because the corresponding GetMap is pretty > odd despite being valid. Maybe using slightly bigger BBOX makes Mapserver > to query the backend raster with a rectangle instead of a point. > > BTW X=1 and Y=1 are not valid in WMS 1.3.0, you are supposed to use i= and > j= instead. That makes me think that maybe you could have a try with a full > and valid WMS 1.1.0 GetFeatureInfo request with SRS= and BBOX in long-lat > order and see if it has any effect on the msProjectRect() > > > > -Jukka Rahkonen- > > > > *L?hett?j?:* MapServer-users *Puolesta > *Carl Godkin > *L?hetetty:* tiistai 2. marraskuuta 2021 17.06 > *Vastaanottaja:* mapserver-users at lists.osgeo.org > *Aihe:* Re: [mapserver-users] Point query from Mapserver raster > > > > Hi, > > > > Following Jukka's advice on my elevation point query, I am trying to use > WMS GetFeatureInfo, > > > > I've mostly got it working but have a few more questions. (I am using > MS4W 4.0.5 which includes MapServer 7.7.0) > > > > I added a LAYER to my WMS map file: > > > > LAYER > > PROCESSING "RESAMPLE=BILINEAR" > > NAME SRTM_3_arc-second_grid > > METADATA > > "wms_title" "SRTM - 3 arc-second grid" > > "ows_extent" "-125 24 -66 50" > > "wms_include_items" "all" > > END > > > > TYPE RASTER > > STATUS ON > > TILEINDEX "srtm_3_hgt-index.shp" > > TILEITEM "Location" > > TEMPLATE "../template.html" > > PROJECTION > > "init=epsg:4326" > > END > > END > > > > and an empty template except for the > > > > > > > > line. Here's my query: > > > > http://localhost:8080/wms? > > SERVICE=WMS& > > VERSION=1.3.0& > > REQUEST=GetFeatureInfo& > > LAYERS=SRTM_3_arc-second_grid& > > CRS=EPSG:4326& > > BBOX=42.94,-122.09,42.95,-122.08& > > WIDTH=2& > > HEIGHT=2& > > X=1& > > Y=1& > > QUERY_LAYERS=SRTM_3_arc-second_grid > > > > This works fine and returns the elevation I am expecting. However, the > MapServer log complains about a "degenerate rect" every time: > > > > [Tue Nov 2 07:58:44 2021].66000 msProjectRect(): Warning: degenerate rect > {-122.082500,42.942500,-122.082500,42.942500} > > > > What am I doing wrong here? As I posted originally, I am really only > interested in a point here. > > > > Thank you very much, > > > > carl > > > > > > On Mon, Nov 1, 2021 at 12:58 AM Rahkonen Jukka (MML) < > jukka.rahkonen at maanmittauslaitos.fi> wrote: > > Hi, > > > > The WMS GetFeatureInfo should work and the answer in gis.stackexhange > seems to contain all the details that you need for making it to work. > > With WCS what you did is probably the best you can do with Mapserver. With > some other servers you may get a single pixel output by using WCS slicing > (subset=Long(-100)&subset=Lat(22)) or trimming with lowerlimit=upperlimit > (subset=Long(-100,-100)&subset=Lat(22,22)) but Mapserver does not support > either. See https://osgeo-org.atlassian.net/browse/GEOS-9553. > > > > I could not find a link to an answer by Stefan Meissl about why Mapserver > does not support slicing but it was about dimensions. A raster image can be > considered to be two dimensional even when it has only one pixel, but by > the WCS standard each trim is removing one dimension. Slicing DEM with two > axes must return a zero dimensional result and raster formats do not > support that. I still think that subsets with lower=upper limits should > works and return a single pixel output but that does not work with either > Mapserver or Geoserver. See also > https://www.mail-archive.com/search?l=mapserver-users%40lists.osgeo.org&q=subject:%22%5C%5Bmapserver%5C-users%5C%5D+WCS+GetCoverage+request+one++by+one+pixel%22&o=newest&f=1 > > > > > > -Jukka Rahkonen- > > > > > > *L?hett?j?:* MapServer-users *Puolesta > *Carl Godkin > *L?hetetty:* lauantai 30. lokakuuta 2021 2.10 > *Vastaanottaja:* mapserver-users at lists.osgeo.org > *Aihe:* [mapserver-users] Point query from Mapserver raster > > > > Hi, > > Now that I have my WMS and WCS servers working well (thanks, list!!), I > have one more thing I would like to figure out how to do. > > > > I want to do point queries on [Lat,Lon] points for their elevation from > the terrain layer I have. > > > > I have done some searching and come across various ideas such as Raster > Query (https://mapserver.org/input/raster.html#raster-query) and a query > template ( > https://gis.stackexchange.com/questions/167239/mapserver-raster-picking-elevation-data) > but haven't found enough information for either to implement it. > > > > I came up with a solution that works fine, but might be considered as > going "All Around the Barn" What works is to add an ASCII output format > to my map file that serves terrain like this: > > > > OUTPUTFORMAT > > NAME XYZ > > DRIVER "GDAL/XYZ" > > MIMETYPE "text/plain" > > IMAGEMODE FLOAT32 > > EXTENSION "txt" > > END > > > > and then use GetCoverage on a small rectangle whose lower-left corner > > is the point whose elevation I want: > > > > > http://localhost:8080/wcs?SERVICE=WCS&VERSION=2.0.1&REQUEST=GetCoverage&coverageid=SRTM_3_arc-second_grid&format=XYZ&subset=Lat(42.948,42.958)&subset=Lon(-122.086,-122.076) > > > > and then take the first line of the returned output file. > > > > What would Mapserver best practice be for a problem like this? > > > > Thanks very much, > > > > carl > > > > > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Tue Nov 2 09:17:30 2021 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Tue, 2 Nov 2021 16:17:30 +0000 Subject: [mapserver-users] Point query from Mapserver raster Message-ID: <3dc8aa7e76844909a09d107025a3b670@maanmittauslaitos.fi> Hi, Yes, it is a useful hack. The same hack works with Geoservers but then GetFeatureInfo returns the values that are scaled to 0-255 for GetMaps instead of the raw values and that is not especially useful if you have a DEM layer. So be warned and stay with Mapserver. None of the existing OGC standards suits well for point queries from rasters but the coming OGC API Coverages standard should support those https://github.com/opengeospatial/ogcapi-coverages/issues/112. -Jukka- L?hett?j?: MapServer-users > Puolesta Carl Godkin L?hetetty: tiistai 2. marraskuuta 2021 18.04 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: Re: [mapserver-users] Point query from Mapserver raster Thanks for the quick response, Jukka. I did not realize that X/Y had been replaced by I/J. I just tried that instead and it still worked (of course) but I still get the warning message. I had also been trying WMS 1.1.0 and 1.1.1 earlier and I am unable to find any combination of versions and other query parameters to quiet the warning message. Regarding the BBOX range, I opened the range to a full degree in each direction and still get the warning. I think I will stick with the query I posted originally (with 1.3.0) since it works and just ignore the messages in the log. This seems like sort of a hack to me (asking for a box when I want a point, etc.) which is why I asked my question in the first place. But it works fine so I'm happy! Thanks again, carl -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.schipkov at gmail.com Mon Nov 8 04:44:12 2021 From: n.schipkov at gmail.com (=?UTF-8?B?0J3QuNC60LjRgtCwINCp0LjQv9C60L7Qsg==?=) Date: Mon, 8 Nov 2021 13:44:12 +0100 Subject: [mapserver-users] Apply styling for MVT from using .map file Message-ID: Hello everyone! Is it possible to serve an MVT layer in Openlayers, but using a style from a .map file? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve.lime at state.mn.us Mon Nov 8 13:33:06 2021 From: steve.lime at state.mn.us (Lime, Steve D (MNIT)) Date: Mon, 8 Nov 2021 21:33:06 +0000 Subject: [mapserver-users] Apply styling for MVT from using .map file In-Reply-To: References: Message-ID: Hi! No, there?s no way built-in to export MapServer styling to something a MVT client could use. I imagine it would be possible to write something but it?s not something I?m aware anyone has a ready-made solution for. --Steve From: MapServer-users On Behalf Of ?????? ?????? Sent: Monday, November 8, 2021 6:44 AM To: mapserver-users at lists.osgeo.org Subject: [mapserver-users] Apply styling for MVT from using .map file Hello everyone! Is it possible to serve an MVT layer in Openlayers, but using a style from a .map file? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From sethg at geographika.co.uk Mon Nov 8 14:24:28 2021 From: sethg at geographika.co.uk (Seth G) Date: Mon, 08 Nov 2021 23:24:28 +0100 Subject: [mapserver-users] Apply styling for MVT from using .map file In-Reply-To: References: Message-ID: Hi, You should be able to use GeoStyler to do style conversions: https://github.com/geostyler/geostyler-mapfile-parser - MapFile to GeoStyler and then https://github.com/geostyler/geostyler-openlayers-parser - GeoStyler to OpenLayers There are a couple of FOSS4G talks on GeoStyler that might be a useful introduction: https://www.youtube.com/watch?v=1vI5CEtgaO8 https://www.youtube.com/watch?v=xts-o3BjmKo Seth -- web:http://geographika.co.uk twitter: @geographika On Mon, Nov 8, 2021, at 1:44 PM, ?????? ?????? wrote: > Hello everyone! > Is it possible to serve an MVT layer in Openlayers, but using a style from a .map file? > Thank you! > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob.basques at ci.stpaul.mn.us Tue Nov 9 07:20:53 2021 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Tue, 9 Nov 2021 15:20:53 +0000 Subject: [mapserver-users] [REMINDER] OSGeo Twin Cities (aka TCMUG) Local Chapter Meeting - Nov 10th Message-ID: <81515423-3CE4-46AC-858F-97A8CE9A1CAA@ci.stpaul.mn.us> All, Last month?s meeting, from Damon Nelton on the MN EPC Underground Utilities Mapping Project Team ( UUMPT ) sparked a lot of thought and questions, and It worked very well as a rehearsal for the Mn GIS/LIS. Those presentations should be posted any day now, and I?ll get a link out to you all when it?s available. As always, last month?s presentation has been posted, along with all the previous ones, at the link at the bottom of this page. This month will be a follow-on presentation by Steve Swazee, a coordinating member of the UUMP team. Title: Begging for Your Assistance to Help Save Lives Stephen Swazee Sr. Steve is a retired Navy Captain and former Delta Air Lines 747 pilot who chairs the Emergency Preparedness Committee of the Minnesota Geospatial Advisory Council (MGAC). In 2008, he was one of the founding members of the Twin Cities based geospatial research and development nonprofit SharedGeo, and for the past 13 years has served as its volunteer Executive Director. He also serves on the Public X Y Mapping Project Board of Directors and was previously a member of the Minnesota Geospatial Advisory Council, the Geospatial Information and Technology Association (GITA) Board of Directors, and for six years was GITA?s Administrative Director. Based on more than three years of discussions with the Minnesota underground utilities sector, in 2020, Steve was instrumental in the formation of the nation?s first effort to work on creating a comprehensive, accurate, visualization of all buried infrastructure in a state. Known as the Minnesota Underground Utilities Mapping Project Team, this ground-breaking, multi-year project has now reached a point where it desperately needs the assistance of the open source community to solve one of the world?s most vexing geospatial problems. In what will be a dynamic, back-and-forth discussion you won?t want to miss, come find out why Steve is down on his knees, begging for your assistance. Online Presentation: https://meet.jit.si/osgeo_tcmug When Nov. 10th, 4:30 PM bobb OSGeo, Twin Cities (aka TCMUG), MN, USA Local Chapter Page. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kkniel at mac.com Mon Nov 15 10:19:00 2021 From: kkniel at mac.com (Kenneth Kniel) Date: Mon, 15 Nov 2021 13:19:00 -0500 Subject: [mapserver-users] msCGILoadMap(): Web application error. CGI variable "map" is not set Message-ID: Mac OS 11.6.1 Mapserver 7.6.4. Homebrew install Working my way through the tutorial. Going slow a lot of permission issues. The Mapserver is running I go the no query response when I access from the server. Trying to run the first example //localhost/cgi-bin/mapserv?%20map=/ms4w/apps/tutorial/htdocs/example1-1.map&layer=states&mode=map Getting error in subject line above. Thoughts? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob.basques at ci.stpaul.mn.us Mon Nov 15 10:39:55 2021 From: bob.basques at ci.stpaul.mn.us (Basques, Bob (CI-StPaul)) Date: Mon, 15 Nov 2021 18:39:55 +0000 Subject: [mapserver-users] msCGILoadMap(): Web application error. CGI variable "map" is not set In-Reply-To: References: Message-ID: <006BB9B4-6C92-4E95-9880-C8D30862A4EE@ci.stpaul.mn.us> Does that MAPFILE actually exist in that location on the server: map=/ms4w/apps/tutorial/htdocs/example1-1.map If it does, then you may have a config/permissions problem on the (root of the) server. Mac OS has it?s own web service for example and it sometimes takes a little fiddling to get add-on working. Bobb From: MapServer-users on behalf of "mapserver-users at lists.osgeo.org" Reply-To: Kenneth Kniel Date: Monday, November 15, 2021 at 12:19 PM To: "mapserver-users at lists.osgeo.org" Subject: [mapserver-users] msCGILoadMap(): Web application error. CGI variable "map" is not set Think Before You Click: This email originated outside our organization. Mac OS 11.6.1 Mapserver 7.6.4. Homebrew install Working my way through the tutorial. Going slow a lot of permission issues. The Mapserver is running I go the no query response when I access from the server. Trying to run the first example //localhost/cgi-bin/mapserv?%20map=/ms4w/apps/tutorial/htdocs/example1-1.map&layer=states&mode=map Getting error in subject line above. Thoughts? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Mon Nov 15 11:03:54 2021 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Mon, 15 Nov 2021 19:03:54 +0000 Subject: [mapserver-users] msCGILoadMap(): Web application error. CGI variable "map" is not set Message-ID: Hi, You seem to have an extra space character in your url after /mapserv?. See %20 in that place, it is space as url-encoded. -Jukka Rahkonen- L?hett?j?: MapServer-users Puolesta Kenneth Kniel via MapServer-users L?hetetty: maanantai 15. marraskuuta 2021 20.19 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: [mapserver-users] msCGILoadMap(): Web application error. CGI variable "map" is not set Mac OS 11.6.1 Mapserver 7.6.4. Homebrew install Working my way through the tutorial. Going slow a lot of permission issues. The Mapserver is running I go the no query response when I access from the server. Trying to run the first example //localhost/cgi-bin/mapserv?%20map=/ms4w/apps/tutorial/htdocs/example1-1.map&layer=states&mode=map Getting error in subject line above. Thoughts? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Mon Nov 15 11:57:06 2021 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Mon, 15 Nov 2021 19:57:06 +0000 Subject: [mapserver-users] msCGILoadMap(): Web application error. CGI variable "map" is not set Message-ID: Hi, Please use ?Reply all? for sending mail to the list as well. If your trouble gets solved the mailing list archives may help other Mapserver users later. You have such a new Mapserver version that you must take care of some additional security settings https://www.mapserver.org/optimization/limit_mapfile_access.html#limit-mapfile-access Have a look at your Apache httpd.conf file. Do you see a configuration of environment variable MS_MAP_PATTERN there? I am sorry but I cannot help with writing correct regexp, I do not really understand it myself. It takes me usually a few copy-paste-edit-test rounds to make the regexp work. -Jukka Rahkonen- L?hett?j?: Kenneth Kniel L?hetetty: maanantai 15. marraskuuta 2021 21.37 Vastaanottaja: Rahkonen Jukka (MML) Aihe: Re: [mapserver-users] msCGILoadMap(): Web application error. CGI variable "map" is not set Thank you sir. Now I have Bobb's problem a permissions issue I believe. msLoadMap(): Unable to access file. (/ms4w/apps/tutorial/htdocs/example1-1.map) On Nov 15, 2021, at 2:03 PM, Rahkonen Jukka (MML) > wrote: Hi, You seem to have an extra space character in your url after /mapserv?. See %20 in that place, it is space as url-encoded. -Jukka Rahkonen- L?hett?j?: MapServer-users > Puolesta Kenneth Kniel via MapServer-users L?hetetty: maanantai 15. marraskuuta 2021 20.19 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: [mapserver-users] msCGILoadMap(): Web application error. CGI variable "map" is not set Mac OS 11.6.1 Mapserver 7.6.4. Homebrew install Working my way through the tutorial. Going slow a lot of permission issues. The Mapserver is running I go the no query response when I access from the server. Trying to run the first example //localhost/cgi-bin/mapserv?%20map=/ms4w/apps/tutorial/htdocs/example1-1.map&layer=states&mode=map Getting error in subject line above. Thoughts? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cgodkin at gmail.com Tue Nov 16 10:32:17 2021 From: cgodkin at gmail.com (Carl Godkin) Date: Tue, 16 Nov 2021 10:32:17 -0800 Subject: [mapserver-users] Comment on OpenStreetMap tutorial... Message-ID: Hi (mostly Jeff), I am going through the excellent MapServer + OpenStreetMap tutorial that you produced at https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows . As you know, it's several versions behind but everything works fine up to one spot. Under "Verify PostgreSQL and PostGIS Installation Success" I don't see the "template_postgis" database discussed under the 7th bullet point: - There should be an icon with a red X labeled something like "template_postgis" (databases created by postgis install) . Instead, I only see the default "postgres" database. There is a clue that says - Single click 'template_postgis" (Note: with PostgresSQL 11 Stackbuilder this will not be there; create a db and add the extensions yourself using pgAdmin) but although I was able to create a database called "template_postgis," I was unable to add the postgis and postgis_topology extensions, perhaps due to my unfamiliarity with the pgAdmin tool. I think that the reason is due to the third bullet point under "Install PostGIS" which says - Make sure "Create Database" is not selected perhaps? Anyway, I found a workaround. I opened back up Stack Builder, and reinstalled PostGIS and this time checked the "Create Database" option. I named the database "template_postgis" and the new database seems to be fine. I would consider making a PR for this page if you thought this was the right approach. I am using Postgres 14 on Windows 10 with MS4W 4.0.5 and so far, so good! Thanks, carl -------------- next part -------------- An HTML attachment was scrubbed... URL: From John.Huotari at RCIS.com Wed Nov 17 14:21:22 2021 From: John.Huotari at RCIS.com (John Huotari) Date: Wed, 17 Nov 2021 22:21:22 +0000 Subject: [mapserver-users] Corrupted PNG issue Message-ID: I'm attempting to upgrade from MapServer 7.6.1 to 7.6.4 via compiled packages obtained from GISInternals. I'm running it on Windows/IIS and whereas 7.6.1 was generating .PNG tiles perfectly for me, after upgrading to 7.6.4, the .PNGs being created appear to be corrupt. I can replace the 7.6.4 exe and dlls with 7.6.1 versions and the PNG images generate fine again, so while there are quite a few places that could introduce an issue, with the exception of a change to MapServer everything would be identical in my stack between having the issue in 7.6.4 and not in 7.6.1. The good headers from 7.6.1 look like this 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 and the corrupted ones from 7.6.4 look like this 89 50 4e 47 0d 0d 0a 1a 0d 0a 00 00 00 0d 49 48 44 52 It appears that the 0a values from the valid header are being converted to 0d 0a. I might be wrong here, but it appears to me that something is interpreting the 0a as a line feed and given the code is running on Windows, is converting that LF into a CR LF. The replacement doesn't seem to be limited to the file header as I see the 7.6.4 version of the file is slightly larger (18,571 bytes instead of 18,407 bytes) and in spot checking, I've verified some additional 0d's exist precede 0a within the data blocks of the .PNG. Has anyone experienced anything like this or know of any fixes? PNG Images produced on the server with shp2img are just fine, it's only images produced by making a WMS request to mapserv.exe that have the issue. An example WMS request would be https:///mapserv.exe?map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445 Maybe I'm completely misdiagnosing the problem as these PNG image files just show up as corrupted within a browser - for example FireFox reports "The image cannot be displayed because it contains errors." The way I obtained the actual .PNG images to view in a binary editor was to use PostMan and save the body of the results. Perhaps PostMan introduced the extra bytes when saving an unrecognizable format file to disk whereas it did not when saving a file it recognized as a valid PNG. I can't find anything different between the valid and invalid files beyond the extra 0d's that have been added though, so I don't think PostMan or anything else in the chain introduced them. ******************* PLEASE NOTE ******************* This message, along with any attachments, is for the designated recipient(s) only and may contain privileged, proprietary, or otherwise confidential information. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Any other use of such misdirected e-mail by you is prohibited. Where allowed by local law, electronic communications with Zurich and its affiliates, including e-mail and instant messaging (including content), may be scanned for the purposes of information security and assessment of internal compliance with company policy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdlime at gmail.com Thu Nov 18 06:53:07 2021 From: sdlime at gmail.com (Steve Lime) Date: Thu, 18 Nov 2021 08:53:07 -0600 Subject: [mapserver-users] Corrupted PNG issue In-Reply-To: References: Message-ID: Hmmm... I've not run into or heard of this before although I'm not a windows user. I did a quick sanity check with a mapfile here and the latest 7.4 and 7.6 versions. While not exactly the same setup you have in terms of versions, they produce the exact same png image. What do you get for output if you use mapserv.exe at the command line? So something like: mapserv.exe -nh "QUERY_STRING= map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445" > test.png That would take PostMan and the web server out of the picture. Is there any chance different versions of libpng are being used? What are you using to manage the tiles? --Steve On Wed, Nov 17, 2021 at 4:57 PM John Huotari via MapServer-users < mapserver-users at lists.osgeo.org> wrote: > I?m attempting to upgrade from MapServer 7.6.1 to 7.6.4 via compiled > packages obtained from GISInternals. I?m running it on Windows/IIS and > whereas 7.6.1 was generating .PNG tiles perfectly for me, after upgrading > to 7.6.4, the .PNGs being created appear to be corrupt. I can replace the > 7.6.4 exe and dlls with 7.6.1 versions and the PNG images generate fine > again, so while there are quite a few places that could introduce an issue, > with the exception of a change to MapServer everything would be identical > in my stack between having the issue in 7.6.4 and not in 7.6.1. > > > > The good headers from 7.6.1 look like this > > > > 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 > > > > and the corrupted ones from 7.6.4 look like this > > > > 89 50 4e 47 0d 0d 0a 1a 0d 0a 00 00 00 0d 49 48 44 52 > > > > It appears that the 0a values from the valid header are being converted to > 0d 0a. I might be wrong here, but it appears to me that something is > interpreting the 0a as a line feed and given the code is running on > Windows, is converting that LF into a CR LF. The replacement doesn?t seem > to be limited to the file header as I see the 7.6.4 version of the file is > slightly larger (18,571 bytes instead of 18,407 bytes) and in spot > checking, I?ve verified some additional 0d?s exist precede 0a within the > data blocks of the .PNG. Has anyone experienced anything like this or know > of any fixes? > > > > PNG Images produced on the server with shp2img are just fine, it?s only > images produced by making a WMS request to mapserv.exe that have the > issue. An example WMS request would be > > > > https:// Removed>/mapserv.exe?map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445 > > > > Maybe I?m completely misdiagnosing the problem as these PNG image files > just show up as corrupted within a browser ? for example FireFox reports > ?The image cannot be displayed because it contains > errors.? The way I obtained the actual .PNG images to view in a binary > editor was to use PostMan and save the body of the results. Perhaps > PostMan introduced the extra bytes when saving an unrecognizable format > file to disk whereas it did not when saving a file it recognized as a valid > PNG. I can?t find anything different between the valid and invalid files > beyond the extra 0d?s that have been added though, so I don?t think PostMan > or anything else in the chain introduced them. > > ******************* PLEASE NOTE ******************* > This message, along with any attachments, is for the designated > recipient(s) only and may contain privileged, proprietary, or otherwise > confidential information. If this message has reached you in error, kindly > destroy it without review and notify the sender immediately. Any other use > of such misdirected e-mail by you is prohibited. Where allowed by local > law, electronic communications with Zurich and its affiliates, including > e-mail and instant messaging (including content), may be scanned for the > purposes of information security and assessment of internal compliance with > company policy. > _______________________________________________ > 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 kkniel at mac.com Thu Nov 18 07:13:47 2021 From: kkniel at mac.com (Kenneth Kniel) Date: Thu, 18 Nov 2021 10:13:47 -0500 Subject: [mapserver-users] Running on Mac Apache with Hombrew Install of Mapserver 7.6.4 Message-ID: <47A36B0E-974D-4B5A-B9EE-1C1500031D42@mac.com> Working through server issues have not really begun to see maps yet but have verified mapserver is running. Latest issues is that I am getting the msCGILoadMap(): Web application error. CGI variable "map" fails to validate. When I try access demo example-1 I believe I need to add this statement to my http.conf file SetEnv MS_MAP_PATTERN "^\/opt\/mapserver\/([^\.][_A-Za-z0-9\-\.]+\/{1})*([_A-Za-z0-9\-\.]+\.(map))$" Maybe I have not looked hard enough but cannot find a /opt/mapserver/ directory in my Homebrew install? Does it natter where in the https.conf you place this statement? Anyone dealt with this? Gettin so close I can almost see a map?.:) Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Thu Nov 18 07:30:18 2021 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Thu, 18 Nov 2021 15:30:18 +0000 Subject: [mapserver-users] Running on Mac Apache with Hombrew Install of Mapserver 7.6.4 Message-ID: Hi, I have env setting at the top level in httpd.conf. On my Windows I have there also things like SetEnv PROJ_LIB "/ms4w/proj/nad/" SetEnv GDAL_DATA "/ms4w/gdaldata" but you may have those set already as generic environmental variables on your Mac. And you do not need to have directory /opt/mapserver for your mapfiles, you can store them anywhere you want, but MS_MAP_PATTERN must validate the path that you are using. -Jukka Rahkonen- L?hett?j?: MapServer-users Puolesta Kenneth Kniel via MapServer-users L?hetetty: torstai 18. marraskuuta 2021 17.14 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: [mapserver-users] Running on Mac Apache with Hombrew Install of Mapserver 7.6.4 Working through server issues have not really begun to see maps yet but have verified mapserver is running. Latest issues is that I am getting the msCGILoadMap(): Web application error. CGI variable "map" fails to validate. When I try access demo example-1 I believe I need to add this statement to my http.conf file SetEnv MS_MAP_PATTERN "^\/opt\/mapserver\/([^\.][_A-Za-z0-9\-\.]+\/{1})*([_A-Za-z0-9\-\.]+\.(map))$" Maybe I have not looked hard enough but cannot find a /opt/mapserver/ directory in my Homebrew install? Does it natter where in the https.conf you place this statement? Anyone dealt with this? Gettin so close I can almost see a map?.:) Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cgodkin at gmail.com Thu Nov 18 14:03:06 2021 From: cgodkin at gmail.com (Carl Godkin) Date: Thu, 18 Nov 2021 14:03:06 -0800 Subject: [mapserver-users] Trouble with OpenStreetMap data in MapServer Message-ID: Hi, I am following the instructions for using OpenStreetMap data in MapServer here: https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows I've been almost all the way through the steps getting everything to work until I reached the step "Testing with shp2img" which says to run this: shp2img -m osm-google.map -o output.png -map_debug 3 It fails, like this: msDrawMap(): rendering using outputformat named png (AGG/PNG). msDrawMap(): WMS/WFS set-up and query, 0.000s msPostGISLayerWhichShapes(): Error (out of memory for query result ) executing query: SELECT "name"::text,ST_AsBinary(("geometry"),'NDR') as geom,"osm_id"::text FROM (select geometry,osm_id, name as name from osm_new_buildings) as foo WHERE "geometry" && ST_GeomFromText('POLYGON((-20037508.3427892 -3113412.49464005,-20037508.3427892 15861721.9613068,-1062373.88684241 15861721.9613068,-1062373.88684241 -3113412.49464005,-20037508.3427892 -3113412.49464005))',3857) msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs msDrawMap(): Image handling error. Failed to draw layer named 'buildings3'. msDrawMap(): Image handling error. Failed to draw layer named 'buildings3'.
msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs
-- I don't see anything in the MapServer logs and don't really understand what is wrong. I tried specifying individual layers with "-l " to the shp2img command and most of them work, which I find encouraging. Specifying layer "buildings3" which failed above still fails when specified individually. I'm using Postgres 14, MS4W 4.0.5, MapServer 7.6.4 on Windows 10. Inspecting the "osm-google.map" file doesn't show me anything very strange but I'm no expert. I pasted the LAYER section for "buildings3" at the bottom in case someone spots anything. (The process used to generate this file is ... well ... amazing!) I am using data from geofabric.de for the USA ( http://download.geofabrik.de/north-america/us-latest.osm.pbf) downloaded two days ago. Does anyone have any suggestions on getting to the bottom of this? I feel like I'm tantalizingly close! Thanks a lot, carl --- LAYER STATUS ON PROJECTION "init=epsg:3857" END GROUP "default" NAME "buildings3" TYPE POLYGON CONNECTIONTYPE postgis CONNECTION "host=localhost dbname=osm user=postgres password=postgres port=5432" DATA "geometry from (select geometry,osm_id, name as name from osm_new_buildings) as foo using unique osm_id using srid=3857" LABELITEM "name" PROCESSING "LABEL_NO_CLIP=ON" PROCESSING "CLOSE_CONNECTION=DEFER" MAXSCALEDENOM 83202051 MINSCALEDENOM 41601025 CLASS STYLE COLOR "#bbbbbb" OPACITY 50 END STYLE OUTLINECOLOR "#333333" WIDTH 0 END END END -------------- next part -------------- An HTML attachment was scrubbed... URL: From joerg.thomsen at wheregroup.com Fri Nov 19 00:01:23 2021 From: joerg.thomsen at wheregroup.com (=?UTF-8?Q?J=c3=b6rg_Thomsen_=28WhereGroup=29?=) Date: Fri, 19 Nov 2021 09:01:23 +0100 Subject: [mapserver-users] Trouble with OpenStreetMap data in MapServer In-Reply-To: References: Message-ID: <5c0741e1-1642-9e1e-025e-4988bd7f92c5@wheregroup.com> Hello Carl, what about the error-message > out of memory for query result ? I guess the buildings of the whole USA need a lot of space (talking about your database and memory not the real world ;) ) I tink theres nothing wrong with your MapServer-Configuration, loks more like a message from PostGIS. Have you looked into the pg-log? you might check the memory-usage in taskmannager during the request. Have you tried the sql-query directly in pg (psql, pg-admin)? You also coud try to test a smaller bbox. J?rg Am 18.11.21 um 23:03 schrieb Carl Godkin: > Hi, > > I am following the instructions for using OpenStreetMap data in > MapServer here: > > https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows > > > I've been almost all the way through the steps getting everything to > work until I reached the step "Testing with shp2img" which says to run this: > > ? ? ? ? ? shp2img -m osm-google.map -o output.png -map_debug 3 > > It fails, like this: > > msDrawMap(): rendering using outputformat named png (AGG/PNG). > msDrawMap(): WMS/WFS set-up and query, 0.000s > msPostGISLayerWhichShapes(): Error (out of memory for query result > ) executing query: SELECT "name"::text,ST_AsBinary(("geometry"),'NDR') > as geom,"osm_id"::text FROM (select geometry,osm_id, name as name from > osm_new_buildings) as foo WHERE "geometry" && > ST_GeomFromText('POLYGON((-20037508.3427892 > -3113412.49464005,-20037508.3427892 15861721.9613068,-1062373.88684241 > 15861721.9613068,-1062373.88684241 -3113412.49464005,-20037508.3427892 > -3113412.49464005))',3857) > msPostGISLayerWhichShapes(): Query error. Error executing query. Check > server logs > msDrawMap(): Image handling error. Failed to draw layer named 'buildings3'. > msDrawMap(): Image handling error. Failed to draw layer named > 'buildings3'.
> msPostGISLayerWhichShapes(): Query error. Error executing query. Check > server logs
> > -- > I don't see anything in the MapServer logs and don't really understand > what is wrong. > > I tried specifying individual layers with "-l " to the > shp2img command and most of them work, which?I find encouraging. > Specifying layer "buildings3" which failed above still fails when > specified individually. > > I'm using Postgres 14, MS4W 4.0.5, MapServer 7.6.4 on Windows 10. > > Inspecting the "osm-google.map" file doesn't show me anything very > strange but I'm no expert.? I pasted the LAYER section for "buildings3" > at the bottom in case someone spots anything. > (The process used to generate this file is ... well ... amazing!) > > I am using data from geofabric.de for the USA > (http://download.geofabrik.de/north-america/us-latest.osm.pbf > ) > downloaded two days ago. > > Does anyone have any suggestions on getting to the bottom of this?? I > feel like I'm tantalizingly close! > > Thanks a lot, > > carl > > --- > LAYER > ? ? STATUS ON > ? ? PROJECTION > ? ? ? ? "init=epsg:3857" > ? ? END > ? ? GROUP "default" > ? ? NAME "buildings3" > ? ? TYPE POLYGON > ? ? CONNECTIONTYPE postgis > ? ? CONNECTION "host=localhost dbname=osm user=postgres > password=postgres port=5432" > ? ? DATA "geometry from (select geometry,osm_id, name as name from > osm_new_buildings) as foo using unique osm_id using srid=3857" > ? ? LABELITEM "name" > ? ? PROCESSING "LABEL_NO_CLIP=ON" > ? ? PROCESSING "CLOSE_CONNECTION=DEFER" > ? ? MAXSCALEDENOM 83202051 > ? ? MINSCALEDENOM 41601025 > ? ? CLASS > ? ? ? STYLE > ? ? ? ? ?COLOR "#bbbbbb" > ? ? ? ? ?OPACITY 50 > ? ? ? END > ? ? ? STYLE > ? ? ? ? ?OUTLINECOLOR "#333333" > ? ? ? ? ?WIDTH 0 > ? ? ? END > ? ?END > END > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -- Viele Gr??e, J?rg Thomsen --------------------------------------------- Schon gewusst? In unserem Blog geben wir Tipps & Tricks zu Open-Source-GIS-Software und berichten aus unserem Experten-Alltag: https://wheregroup.com/blog/ --------------------------------------------- J?rg Thomsen WhereGroup GmbH Bundesallee 23 10717 Berlin Germany Tel: +49 (0)30 / 5130 278 74 Fax: +49 (0)30 / 5130 278 11 joerg.thomsen at wheregroup.com www.wheregroup.com Gesch?ftsf?hrer: Olaf Knopp, Peter Stamm Amtsgericht Bonn, HRB 9885 ------------------------------- Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com From jukka.rahkonen at maanmittauslaitos.fi Fri Nov 19 00:18:14 2021 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Fri, 19 Nov 2021 08:18:14 +0000 Subject: [mapserver-users] Trouble with OpenStreetMap data in MapServer Message-ID: <18cd9743c3d1454cafa40ed6220450bd@maanmittauslaitos.fi> Hi, I agree with J?rg. The polygon that is used in the query is about 19000 km wide. Run shp2img with for smaller bbox with -e switch https://mapserver.org/utilities/shp2img.html. However, there may be something to improve in the mapfile and layer maxscaledenom because it does not make sense to render buildings at that scale. -Jukka Rahkonen- -----Alkuper?inen viesti----- L?hett?j?: MapServer-users Puolesta J?rg Thomsen (WhereGroup) L?hetetty: perjantai 19. marraskuuta 2021 10.01 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: Re: [mapserver-users] Trouble with OpenStreetMap data in MapServer Hello Carl, what about the error-message > out of memory for query result ? I guess the buildings of the whole USA need a lot of space (talking about your database and memory not the real world ;) ) I tink theres nothing wrong with your MapServer-Configuration, loks more like a message from PostGIS. Have you looked into the pg-log? you might check the memory-usage in taskmannager during the request. Have you tried the sql-query directly in pg (psql, pg-admin)? You also coud try to test a smaller bbox. J?rg Am 18.11.21 um 23:03 schrieb Carl Godkin: > Hi, > > I am following the instructions for using OpenStreetMap data in > MapServer here: > > https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows > > > I've been almost all the way through the steps getting everything to > work until I reached the step "Testing with shp2img" which says to run this: > > ? ? ? ? ? shp2img -m osm-google.map -o output.png -map_debug 3 > > It fails, like this: > > msDrawMap(): rendering using outputformat named png (AGG/PNG). > msDrawMap(): WMS/WFS set-up and query, 0.000s > msPostGISLayerWhichShapes(): Error (out of memory for query result > ) executing query: SELECT "name"::text,ST_AsBinary(("geometry"),'NDR') > as geom,"osm_id"::text FROM (select geometry,osm_id, name as name from > osm_new_buildings) as foo WHERE "geometry" && > ST_GeomFromText('POLYGON((-20037508.3427892 > -3113412.49464005,-20037508.3427892 15861721.9613068,-1062373.88684241 > 15861721.9613068,-1062373.88684241 -3113412.49464005,-20037508.3427892 > -3113412.49464005))',3857) > msPostGISLayerWhichShapes(): Query error. Error executing query. Check > server logs > msDrawMap(): Image handling error. Failed to draw layer named 'buildings3'. > msDrawMap(): Image handling error. Failed to draw layer named > 'buildings3'.
> msPostGISLayerWhichShapes(): Query error. Error executing query. Check > server logs
> > -- > I don't see anything in the MapServer logs and don't really understand > what is wrong. > > I tried specifying individual layers with "-l " to the > shp2img command and most of them work, which?I find encouraging. > Specifying layer "buildings3" which failed above still fails when > specified individually. > > I'm using Postgres 14, MS4W 4.0.5, MapServer 7.6.4 on Windows 10. > > Inspecting the "osm-google.map" file doesn't show me anything very > strange but I'm no expert.? I pasted the LAYER section for "buildings3" > at the bottom in case someone spots anything. > (The process used to generate this file is ... well ... amazing!) > > I am using data from geofabric.de for the USA > (http://download.geofabrik.de/north-america/us-latest.osm.pbf > ) > downloaded two days ago. > > Does anyone have any suggestions on getting to the bottom of this?? I > feel like I'm tantalizingly close! > > Thanks a lot, > > carl > > --- > LAYER > ? ? STATUS ON > ? ? PROJECTION > ? ? ? ? "init=epsg:3857" > ? ? END > ? ? GROUP "default" > ? ? NAME "buildings3" > ? ? TYPE POLYGON > ? ? CONNECTIONTYPE postgis > ? ? CONNECTION "host=localhost dbname=osm user=postgres > password=postgres port=5432" > ? ? DATA "geometry from (select geometry,osm_id, name as name from > osm_new_buildings) as foo using unique osm_id using srid=3857" > ? ? LABELITEM "name" > ? ? PROCESSING "LABEL_NO_CLIP=ON" > ? ? PROCESSING "CLOSE_CONNECTION=DEFER" > ? ? MAXSCALEDENOM 83202051 > ? ? MINSCALEDENOM 41601025 > ? ? CLASS > ? ? ? STYLE > ? ? ? ? ?COLOR "#bbbbbb" > ? ? ? ? ?OPACITY 50 > ? ? ? END > ? ? ? STYLE > ? ? ? ? ?OUTLINECOLOR "#333333" > ? ? ? ? ?WIDTH 0 > ? ? ? END > ? ?END > END > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -- Viele Gr??e, J?rg Thomsen --------------------------------------------- Schon gewusst? In unserem Blog geben wir Tipps & Tricks zu Open-Source-GIS-Software und berichten aus unserem Experten-Alltag: https://wheregroup.com/blog/ --------------------------------------------- J?rg Thomsen WhereGroup GmbH Bundesallee 23 10717 Berlin Germany Tel: +49 (0)30 / 5130 278 74 Fax: +49 (0)30 / 5130 278 11 joerg.thomsen at wheregroup.com www.wheregroup.com Gesch?ftsf?hrer: Olaf Knopp, Peter Stamm Amtsgericht Bonn, HRB 9885 ------------------------------- Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com _______________________________________________ MapServer-users mailing list MapServer-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users From sethg at geographika.co.uk Fri Nov 19 00:43:36 2021 From: sethg at geographika.co.uk (Seth G) Date: Fri, 19 Nov 2021 09:43:36 +0100 Subject: [mapserver-users] Corrupted PNG issue In-Reply-To: References: Message-ID: <6cfd4198-5052-4102-bb76-39fed57450ec@www.fastmail.com> Possibly unrelated but I ran into a similar issue exporting WFS to zipped shapefiles. Working fine in 7-4-3 but broken in 7-6-4 (and current master) - the zip files are corrupt, although they have an identical size. 7-zip reports "Headers Error Unconfirmed start of archive" The same command is used for both versions: mapserv -nh "QUERY_STRING=map=my.map&service=WFS&REQUEST=GetFeature&TYPENAME=LayerName&version=2.0.0&outputformat=shapezip&srsName=EPSG:3857" > output.zip I had a look with a hex editor but the start of the working and corrupt zips seem identical. On the other hand all PNGs / WMS services are fine. Seth -- web:http://geographika.co.uk twitter: @geographika On Thu, Nov 18, 2021, at 3:53 PM, Steve Lime wrote: > Hmmm... I've not run into or heard of this before although I'm not a windows user. I did a quick sanity check with a mapfile here and the latest 7.4 and 7.6 versions. While not exactly the same setup you have in terms of versions, they produce the exact same png image. > > What do you get for output if you use mapserv.exe at the command line? So something like: > > mapserv.exe -nh "QUERY_STRING= map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445" > test.png > > That would take PostMan and the web server out of the picture. Is there any chance different versions of libpng are being used? What are you using to manage the tiles? > > --Steve > > On Wed, Nov 17, 2021 at 4:57 PM John Huotari via MapServer-users wrote: >> I?m attempting to upgrade from MapServer 7.6.1 to 7.6.4 via compiled packages obtained from GISInternals. I?m running it on Windows/IIS and whereas 7.6.1 was generating .PNG tiles perfectly for me, after upgrading to 7.6.4, the .PNGs being created appear to be corrupt. I can replace the 7.6.4 exe and dlls with 7.6.1 versions and the PNG images generate fine again, so while there are quite a few places that could introduce an issue, with the exception of a change to MapServer everything would be identical in my stack between having the issue in 7.6.4 and not in 7.6.1.____ >> __ __ >> The good headers from 7.6.1 look like this____ >> __ __ >> 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52____ >> __ __ >> and the corrupted ones from 7.6.4 look like this____ >> __ __ >> 89 50 4e 47 0d 0d 0a 1a 0d 0a 00 00 00 0d 49 48 44 52____ >> __ __ >> It appears that the 0a values from the valid header are being converted to 0d 0a. I might be wrong here, but it appears to me that something is interpreting the 0a as a line feed and given the code is running on Windows, is converting that LF into a CR LF. The replacement doesn?t seem to be limited to the file header as I see the 7.6.4 version of the file is slightly larger (18,571 bytes instead of 18,407 bytes) and in spot checking, I?ve verified some additional 0d?s exist precede 0a within the data blocks of the .PNG. Has anyone experienced anything like this or know of any fixes?____ >> __ __ >> PNG Images produced on the server with shp2img are just fine, it?s only images produced by making a WMS request to mapserv.exe that have the issue. An example WMS request would be____ >> __ __ >> https:///mapserv.exe?map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445____ >> __ __ >> Maybe I?m completely misdiagnosing the problem as these PNG image files just show up as corrupted within a browser ? for example FireFox reports ?The image cannot be displayed because it contains errors.? The way I obtained the actual .PNG images to view in a binary editor was to use PostMan and save the body of the results. Perhaps PostMan introduced the extra bytes when saving an unrecognizable format file to disk whereas it did not when saving a file it recognized as a valid PNG. I can?t find anything different between the valid and invalid files beyond the extra 0d?s that have been added though, so I don?t think PostMan or anything else in the chain introduced them.____ >> >> ******************* PLEASE NOTE ******************* >> This message, along with any attachments, is for the designated recipient(s) only and may contain privileged, proprietary, or otherwise confidential information. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Any other use of such misdirected e-mail by you is prohibited. Where allowed by local law, electronic communications with Zurich and its affiliates, including e-mail and instant messaging (including content), may be scanned for the purposes of information security and assessment of internal compliance with company policy. >> _______________________________________________ >> 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 even.rouault at spatialys.com Fri Nov 19 05:07:25 2021 From: even.rouault at spatialys.com (Even Rouault) Date: Fri, 19 Nov 2021 14:07:25 +0100 Subject: [mapserver-users] Corrupted PNG issue In-Reply-To: <6cfd4198-5052-4102-bb76-39fed57450ec@www.fastmail.com> References: <6cfd4198-5052-4102-bb76-39fed57450ec@www.fastmail.com> Message-ID: Could be a msIO_needBinaryStdout() missing somewhere. Seth, if you've the chance to run a git bisect session, that could probably give a strong hint of how to fix that. Le 19/11/2021 ? 09:43, Seth G a ?crit?: > Possibly unrelated but I ran into a similar issue exporting WFS to > zipped shapefiles. > Working fine in?7-4-3 but broken in 7-6-4 (and current master) - the > zip files are corrupt, although they have an identical size. > > 7-zip reports "Headers Error Unconfirmed start of archive" > > The same command is used for both versions: > > mapserv -nh > "QUERY_STRING=map=my.map&service=WFS&REQUEST=GetFeature&TYPENAME=LayerName&version=2.0.0&outputformat=shapezip&srsName=EPSG:3857" > > output.zip > > I had a look with a hex editor but the start of the working and > corrupt zips seem identical. > > On the other hand all PNGs / WMS services are fine. > > Seth > > > -- > web:http://geographika.co.uk > twitter: @geographika > > > On Thu, Nov 18, 2021, at 3:53 PM, Steve Lime wrote: >> Hmmm... I've not run into or heard of this before although I'm not a >> windows user. I did a quick sanity check with a mapfile here and the >> latest 7.4 and 7.6 versions. While not exactly the same setup you >> have in terms of versions, they produce the exact same png image. >> >> What do you get for output if you use mapserv.exe at the command >> line? So something like: >> >> ? mapserv.exe -nh "QUERY_STRING= >> map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445" >> > test.png >> >> That would take PostMan and the web server out of the picture. Is >> there any chance different versions of libpng are being used? What >> are you using to manage the tiles? >> >> --Steve >> >> On Wed, Nov 17, 2021 at 4:57 PM John Huotari via MapServer-users >> > > wrote: >> >> I?m attempting to upgrade from MapServer 7.6.1 to 7.6.4 via >> compiled packages obtained from GISInternals.? I?m running it on >> Windows/IIS and whereas 7.6.1 was generating .PNG tiles perfectly >> for me, after upgrading to 7.6.4, the .PNGs being created appear >> to be corrupt.? I can replace the 7.6.4 exe and dlls with 7.6.1 >> versions and the PNG images generate fine again, so while there >> are quite a few places that could introduce an issue, with the >> exception of a change to MapServer everything would be identical >> in my stack between having the issue in 7.6.4 and not in 7.6.1. >> >> >> The good headers from 7.6.1 look like this >> >> >> 89 50 4e 47 0d 0a 1a 0a? 00 00 00 0d 49 48 44 52 >> >> >> and the corrupted ones from 7.6.4 look like this >> >> >> 89 50 4e 47 0d 0d 0a 1a 0d 0a 00 00 00 0d 49 48 44 52 >> >> >> It appears that the 0a values from the valid header are being >> converted to 0d 0a.? I might be wrong here, but it appears to me >> that something is interpreting the 0a as a line feed and given >> the code is running on Windows, is converting that LF into a CR >> LF.? The replacement doesn?t seem to be limited to the file >> header as I see the 7.6.4 version of the file is slightly larger >> (18,571 bytes instead of 18,407 bytes) and in spot checking, I?ve >> verified some additional 0d?s exist precede 0a within the data >> blocks of the .PNG.? Has anyone experienced anything like this or >> know of any fixes? >> >> >> PNG Images produced on the server with shp2img are just fine, >> it?s only images produced by making a WMS request to mapserv.exe >> that have the issue.? An example WMS request would be >> >> >> https://> Removed>/mapserv.exe?map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445 >> >> >> Maybe I?m completely misdiagnosing the problem as these PNG image >> files just show up as corrupted within a browser ? for example >> FireFox reports ?The image cannot be displayed >> because it contains errors.?? The way I obtained the actual .PNG >> images to view in a binary editor was to use PostMan and save the >> body of the results.? Perhaps PostMan introduced the extra bytes >> when saving an unrecognizable format file to disk whereas it did >> not when saving a file it recognized as a valid PNG.? I can?t >> find anything different between the valid and invalid files >> beyond the extra 0d?s that have been added though, so I don?t >> think PostMan or anything else in the chain introduced them. >> >> >> ******************* PLEASE NOTE ******************* >> This message, along with any attachments, is for the designated >> recipient(s) only and may contain privileged, proprietary, or >> otherwise confidential information. If this message has reached >> you in error, kindly destroy it without review and notify the >> sender immediately. Any other use of such misdirected e-mail by >> you is prohibited. Where allowed by local law, electronic >> communications with Zurich and its affiliates, including e-mail >> and instant messaging (including content), may be scanned for the >> purposes of information security and assessment of internal >> compliance with company policy. >> _______________________________________________ >> 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 -- http://www.spatialys.com My software is free, but my time generally not. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sethg at geographika.co.uk Fri Nov 19 07:01:01 2021 From: sethg at geographika.co.uk (Seth G) Date: Fri, 19 Nov 2021 16:01:01 +0100 Subject: [mapserver-users] Corrupted PNG issue In-Reply-To: References: <6cfd4198-5052-4102-bb76-39fed57450ec@www.fastmail.com> Message-ID: <12b6ad09-e661-4eb1-a128-fa4082219923@www.fastmail.com> Thanks Even, I'll give that a go (the bisect worked well for another issue a few months ago). I presume the zipping issue is more likely to be in the MapServer codebase than in GDAL? The GISInternals did switch from GDAL 2.4.4 to GDAL 3.3.3 from the 7.4.3 to 7.6.4 branches. The zip exports work fine over a web browser rather than command line which is strange. Maybe its related to modifications to the -nh switch. Seth -- web:http://geographika.co.uk twitter: @geographika On Fri, Nov 19, 2021, at 2:07 PM, Even Rouault wrote: > Could be a msIO_needBinaryStdout() missing somewhere. Seth, if you've the chance to run a git bisect session, that could probably give a strong hint of how to fix that. > > Le 19/11/2021 ? 09:43, Seth G a ?crit : >> Possibly unrelated but I ran into a similar issue exporting WFS to zipped shapefiles. >> Working fine in 7-4-3 but broken in 7-6-4 (and current master) - the zip files are corrupt, although they have an identical size. >> >> 7-zip reports "Headers Error Unconfirmed start of archive" >> >> The same command is used for both versions: >> >> mapserv -nh "QUERY_STRING=map=my.map&service=WFS&REQUEST=GetFeature&TYPENAME=LayerName&version=2.0.0&outputformat=shapezip&srsName=EPSG:3857" > output.zip >> >> I had a look with a hex editor but the start of the working and corrupt zips seem identical. >> >> On the other hand all PNGs / WMS services are fine. >> >> Seth >> >> >> -- >> web:http://geographika.co.uk >> twitter: @geographika >> >> >> On Thu, Nov 18, 2021, at 3:53 PM, Steve Lime wrote: >>> Hmmm... I've not run into or heard of this before although I'm not a windows user. I did a quick sanity check with a mapfile here and the latest 7.4 and 7.6 versions. While not exactly the same setup you have in terms of versions, they produce the exact same png image. >>> >>> What do you get for output if you use mapserv.exe at the command line? So something like: >>> >>> mapserv.exe -nh "QUERY_STRING= map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445" > test.png >>> >>> That would take PostMan and the web server out of the picture. Is there any chance different versions of libpng are being used? What are you using to manage the tiles? >>> >>> --Steve >>> >>> On Wed, Nov 17, 2021 at 4:57 PM John Huotari via MapServer-users wrote: >>>> I?m attempting to upgrade from MapServer 7.6.1 to 7.6.4 via compiled packages obtained from GISInternals. I?m running it on Windows/IIS and whereas 7.6.1 was generating .PNG tiles perfectly for me, after upgrading to 7.6.4, the .PNGs being created appear to be corrupt. I can replace the 7.6.4 exe and dlls with 7.6.1 versions and the PNG images generate fine again, so while there are quite a few places that could introduce an issue, with the exception of a change to MapServer everything would be identical in my stack between having the issue in 7.6.4 and not in 7.6.1. >>>> >>>> The good headers from 7.6.1 look like this >>>> >>>> 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 >>>> >>>> and the corrupted ones from 7.6.4 look like this >>>> >>>> 89 50 4e 47 0d 0d 0a 1a 0d 0a 00 00 00 0d 49 48 44 52 >>>> >>>> It appears that the 0a values from the valid header are being converted to 0d 0a. I might be wrong here, but it appears to me that something is interpreting the 0a as a line feed and given the code is running on Windows, is converting that LF into a CR LF. The replacement doesn?t seem to be limited to the file header as I see the 7.6.4 version of the file is slightly larger (18,571 bytes instead of 18,407 bytes) and in spot checking, I?ve verified some additional 0d?s exist precede 0a within the data blocks of the .PNG. Has anyone experienced anything like this or know of any fixes? >>>> >>>> PNG Images produced on the server with shp2img are just fine, it?s only images produced by making a WMS request to mapserv.exe that have the issue. An example WMS request would be >>>> >>>> https:///mapserv.exe?map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445 >>>> >>>> Maybe I?m completely misdiagnosing the problem as these PNG image files just show up as corrupted within a browser ? for example FireFox reports ?The image cannot be displayed because it contains errors.? The way I obtained the actual .PNG images to view in a binary editor was to use PostMan and save the body of the results. Perhaps PostMan introduced the extra bytes when saving an unrecognizable format file to disk whereas it did not when saving a file it recognized as a valid PNG. I can?t find anything different between the valid and invalid files beyond the extra 0d?s that have been added though, so I don?t think PostMan or anything else in the chain introduced them. >>>> >>>> ******************* PLEASE NOTE ******************* >>>> This message, along with any attachments, is for the designated recipient(s) only and may contain privileged, proprietary, or otherwise confidential information. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Any other use of such misdirected e-mail by you is prohibited. Where allowed by local law, electronic communications with Zurich and its affiliates, including e-mail and instant messaging (including content), may be scanned for the purposes of information security and assessment of internal compliance with company policy. >>>> _______________________________________________ >>>> 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 >> > -- > 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 even.rouault at spatialys.com Fri Nov 19 07:11:51 2021 From: even.rouault at spatialys.com (Even Rouault) Date: Fri, 19 Nov 2021 16:11:51 +0100 Subject: [mapserver-users] Corrupted PNG issue In-Reply-To: <12b6ad09-e661-4eb1-a128-fa4082219923@www.fastmail.com> References: <6cfd4198-5052-4102-bb76-39fed57450ec@www.fastmail.com> <12b6ad09-e661-4eb1-a128-fa4082219923@www.fastmail.com> Message-ID: <4acec6c1-0568-89b0-628d-0416c6439244@spatialys.com> Ah, GDAL also changed... Zipping is done by GDAL, so could be a GDAL related change (there were adjustments in the past regarding ZIP64 that could result in some bytes being different). Did you try opening the zip with another utility (like 'unzip' on Linux) ? This might be then a completely different issue than the one reported by John. Le 19/11/2021 ? 16:01, Seth G a ?crit?: > Thanks Even, I'll give that a go (the bisect worked well for another > issue a few months ago). > > I presume the zipping issue is more likely to be in the MapServer > codebase than in GDAL? > The GISInternals did switch from GDAL 2.4.4 to GDAL 3.3.3 from the > 7.4.3 to 7.6.4 branches. > > The zip exports work fine over a web browser rather than command line > which is strange. Maybe its related to modifications to the -nh switch. > > Seth > > -- > web:http://geographika.co.uk > twitter: @geographika > > > On Fri, Nov 19, 2021, at 2:07 PM, Even Rouault wrote: >> >> Could be a msIO_needBinaryStdout() missing somewhere. Seth, if you've >> the chance to run a git bisect session, that could probably give a >> strong hint of how to fix that. >> >> Le 19/11/2021 ? 09:43, Seth G a ?crit?: >>> Possibly unrelated but I ran into a similar issue exporting WFS to >>> zipped shapefiles. >>> Working fine in?7-4-3 but broken in 7-6-4 (and current master) - the >>> zip files are corrupt, although they have an identical size. >>> >>> 7-zip reports "Headers Error Unconfirmed start of archive" >>> >>> The same command is used for both versions: >>> >>> mapserv -nh >>> "QUERY_STRING=map=my.map&service=WFS&REQUEST=GetFeature&TYPENAME=LayerName&version=2.0.0&outputformat=shapezip&srsName=EPSG:3857" >>> > output.zip >>> >>> I had a look with a hex editor but the start of the working and >>> corrupt zips seem identical. >>> >>> On the other hand all PNGs / WMS services are fine. >>> >>> Seth >>> >>> >>> -- >>> web:http://geographika.co.uk >>> twitter: @geographika >>> >>> >>> On Thu, Nov 18, 2021, at 3:53 PM, Steve Lime wrote: >>>> Hmmm... I've not run into or heard of this before although I'm not >>>> a windows user. I did a quick sanity check with a mapfile here and >>>> the latest 7.4 and 7.6 versions. While not exactly the same setup >>>> you have in terms of versions, they produce the exact same png image. >>>> >>>> What do you get for output if you use mapserv.exe at the command >>>> line? So something like: >>>> >>>> ? mapserv.exe -nh "QUERY_STRING= >>>> map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445" >>>> > test.png >>>> >>>> That would take PostMan and the web server out of the picture. Is >>>> there any chance different versions of libpng are being used? What >>>> are you using to manage the tiles? >>>> >>>> --Steve >>>> >>>> On Wed, Nov 17, 2021 at 4:57 PM John Huotari via MapServer-users >>>> >>> > wrote: >>>> >>>> I?m attempting to upgrade from MapServer 7.6.1 to 7.6.4 via >>>> compiled packages obtained from GISInternals.? I?m running it >>>> on Windows/IIS and whereas 7.6.1 was generating .PNG tiles >>>> perfectly for me, after upgrading to 7.6.4, the .PNGs being >>>> created appear to be corrupt.? I can replace the 7.6.4 exe and >>>> dlls with 7.6.1 versions and the PNG images generate fine >>>> again, so while there are quite a few places that could >>>> introduce an issue, with the exception of a change to MapServer >>>> everything would be identical in my stack between having the >>>> issue in 7.6.4 and not in 7.6.1. >>>> >>>> >>>> The good headers from 7.6.1 look like this >>>> >>>> >>>> 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 >>>> >>>> >>>> and the corrupted ones from 7.6.4 look like this >>>> >>>> >>>> 89 50 4e 47 0d 0d 0a 1a 0d 0a 00 00 00 0d 49 48 44 52 >>>> >>>> >>>> It appears that the 0a values from the valid header are being >>>> converted to 0d 0a.? I might be wrong here, but it appears to >>>> me that something is interpreting the 0a as a line feed and >>>> given the code is running on Windows, is converting that LF >>>> into a CR LF.? The replacement doesn?t seem to be limited to >>>> the file header as I see the 7.6.4 version of the file is >>>> slightly larger (18,571 bytes instead of 18,407 bytes) and in >>>> spot checking, I?ve verified some additional 0d?s exist precede >>>> 0a within the data blocks of the .PNG.? Has anyone experienced >>>> anything like this or know of any fixes? >>>> >>>> >>>> PNG Images produced on the server with shp2img are just fine, >>>> it?s only images produced by making a WMS request to >>>> mapserv.exe that have the issue.? An example WMS request would be >>>> >>>> >>>> https://>>> Removed>/mapserv.exe?map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445 >>>> >>>> >>>> Maybe I?m completely misdiagnosing the problem as these PNG >>>> image files just show up as corrupted within a browser ? for >>>> example FireFox reports ?The image cannot be >>>> displayed because it contains errors.?? The way I obtained the >>>> actual .PNG images to view in a binary editor was to use >>>> PostMan and save the body of the results.? Perhaps PostMan >>>> introduced the extra bytes when saving an unrecognizable format >>>> file to disk whereas it did not when saving a file it >>>> recognized as a valid PNG.? I can?t find anything different >>>> between the valid and invalid files beyond the extra 0d?s that >>>> have been added though, so I don?t think PostMan or anything >>>> else in the chain introduced them. >>>> >>>> >>>> ******************* PLEASE NOTE ******************* >>>> This message, along with any attachments, is for the designated >>>> recipient(s) only and may contain privileged, proprietary, or >>>> otherwise confidential information. If this message has reached >>>> you in error, kindly destroy it without review and notify the >>>> sender immediately. Any other use of such misdirected e-mail by >>>> you is prohibited. Where allowed by local law, electronic >>>> communications with Zurich and its affiliates, including e-mail >>>> and instant messaging (including content), may be scanned for >>>> the purposes of information security and assessment of internal >>>> compliance with company policy. >>>> _______________________________________________ >>>> 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 >>> >> -- >> 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 >> >> > -- http://www.spatialys.com My software is free, but my time generally not. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sethg at geographika.co.uk Fri Nov 19 08:44:40 2021 From: sethg at geographika.co.uk (Seth G) Date: Fri, 19 Nov 2021 17:44:40 +0100 Subject: [mapserver-users] Corrupted PNG issue In-Reply-To: <4acec6c1-0568-89b0-628d-0416c6439244@spatialys.com> References: <6cfd4198-5052-4102-bb76-39fed57450ec@www.fastmail.com> <12b6ad09-e661-4eb1-a128-fa4082219923@www.fastmail.com> <4acec6c1-0568-89b0-628d-0416c6439244@spatialys.com> Message-ID: <08048e70-8eda-4579-9b2b-7033d73c7ee2@www.fastmail.com> Yes apologies John for hijacking the thread, I thought it could be related to your issue but looking less and less likely. Steve's suggestion to use the commandline mapserv -nh "QUERY..." approach should rule out a few more issues. Even - the same zip cannot be opened on Linux either (using Ark and unzip): "9487 extra bytes at begging or within zipfile". The GDAL within the build (3.3.3) creates a zip of the WFS just fine for the same layer/WFS service using ogr2ogr: ogr2ogr -f "ESRI Shapefile" "H:/Temp/test.shp.zip" WFS:"https://server/mapserver/?service=WFS&REQUEST=GetFeature&version=2.0.0 " LayerName -overwrite -skipfailures GDAL 2.4.4 doesn't create zips so it must be MapServer doing the zipping in this version at least? I'm guessing this points to a MapServer issue, so I'll carry on debugging. Seth -- web:http://geographika.co.uk twitter: @geographika On Fri, Nov 19, 2021, at 4:11 PM, Even Rouault wrote: > Ah, GDAL also changed... Zipping is done by GDAL, so could be a GDAL related change (there were adjustments in the past regarding ZIP64 that could result in some bytes being different). Did you try opening the zip with another utility (like 'unzip' on Linux) ? > > This might be then a completely different issue than the one reported by John. > > Le 19/11/2021 ? 16:01, Seth G a ?crit : >> Thanks Even, I'll give that a go (the bisect worked well for another issue a few months ago). >> >> I presume the zipping issue is more likely to be in the MapServer codebase than in GDAL? >> The GISInternals did switch from GDAL 2.4.4 to GDAL 3.3.3 from the 7.4.3 to 7.6.4 branches. >> >> The zip exports work fine over a web browser rather than command line which is strange. Maybe its related to modifications to the -nh switch. >> >> Seth >> >> -- >> web:http://geographika.co.uk >> twitter: @geographika >> >> >> On Fri, Nov 19, 2021, at 2:07 PM, Even Rouault wrote: >>> Could be a msIO_needBinaryStdout() missing somewhere. Seth, if you've the chance to run a git bisect session, that could probably give a strong hint of how to fix that. >>> >>> Le 19/11/2021 ? 09:43, Seth G a ?crit : >>>> Possibly unrelated but I ran into a similar issue exporting WFS to zipped shapefiles. >>>> Working fine in 7-4-3 but broken in 7-6-4 (and current master) - the zip files are corrupt, although they have an identical size. >>>> >>>> 7-zip reports "Headers Error Unconfirmed start of archive" >>>> >>>> The same command is used for both versions: >>>> >>>> mapserv -nh "QUERY_STRING=map=my.map&service=WFS&REQUEST=GetFeature&TYPENAME=LayerName&version=2.0.0&outputformat=shapezip&srsName=EPSG:3857" > output.zip >>>> >>>> I had a look with a hex editor but the start of the working and corrupt zips seem identical. >>>> >>>> On the other hand all PNGs / WMS services are fine. >>>> >>>> Seth >>>> >>>> >>>> -- >>>> web:http://geographika.co.uk >>>> twitter: @geographika >>>> >>>> >>>> On Thu, Nov 18, 2021, at 3:53 PM, Steve Lime wrote: >>>>> Hmmm... I've not run into or heard of this before although I'm not a windows user. I did a quick sanity check with a mapfile here and the latest 7.4 and 7.6 versions. While not exactly the same setup you have in terms of versions, they produce the exact same png image. >>>>> >>>>> What do you get for output if you use mapserv.exe at the command line? So something like: >>>>> >>>>> mapserv.exe -nh "QUERY_STRING= map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445" > test.png >>>>> >>>>> That would take PostMan and the web server out of the picture. Is there any chance different versions of libpng are being used? What are you using to manage the tiles? >>>>> >>>>> --Steve >>>>> >>>>> On Wed, Nov 17, 2021 at 4:57 PM John Huotari via MapServer-users wrote: >>>>>> I?m attempting to upgrade from MapServer 7.6.1 to 7.6.4 via compiled packages obtained from GISInternals. I?m running it on Windows/IIS and whereas 7.6.1 was generating .PNG tiles perfectly for me, after upgrading to 7.6.4, the .PNGs being created appear to be corrupt. I can replace the 7.6.4 exe and dlls with 7.6.1 versions and the PNG images generate fine again, so while there are quite a few places that could introduce an issue, with the exception of a change to MapServer everything would be identical in my stack between having the issue in 7.6.4 and not in 7.6.1. >>>>>> >>>>>> The good headers from 7.6.1 look like this >>>>>> >>>>>> 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 >>>>>> >>>>>> and the corrupted ones from 7.6.4 look like this >>>>>> >>>>>> 89 50 4e 47 0d 0d 0a 1a 0d 0a 00 00 00 0d 49 48 44 52 >>>>>> >>>>>> It appears that the 0a values from the valid header are being converted to 0d 0a. I might be wrong here, but it appears to me that something is interpreting the 0a as a line feed and given the code is running on Windows, is converting that LF into a CR LF. The replacement doesn?t seem to be limited to the file header as I see the 7.6.4 version of the file is slightly larger (18,571 bytes instead of 18,407 bytes) and in spot checking, I?ve verified some additional 0d?s exist precede 0a within the data blocks of the .PNG. Has anyone experienced anything like this or know of any fixes? >>>>>> >>>>>> PNG Images produced on the server with shp2img are just fine, it?s only images produced by making a WMS request to mapserv.exe that have the issue. An example WMS request would be >>>>>> >>>>>> https:///mapserv.exe?map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445 >>>>>> >>>>>> Maybe I?m completely misdiagnosing the problem as these PNG image files just show up as corrupted within a browser ? for example FireFox reports ?The image cannot be displayed because it contains errors.? The way I obtained the actual .PNG images to view in a binary editor was to use PostMan and save the body of the results. Perhaps PostMan introduced the extra bytes when saving an unrecognizable format file to disk whereas it did not when saving a file it recognized as a valid PNG. I can?t find anything different between the valid and invalid files beyond the extra 0d?s that have been added though, so I don?t think PostMan or anything else in the chain introduced them. >>>>>> >>>>>> ******************* PLEASE NOTE ******************* >>>>>> This message, along with any attachments, is for the designated recipient(s) only and may contain privileged, proprietary, or otherwise confidential information. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Any other use of such misdirected e-mail by you is prohibited. Where allowed by local law, electronic communications with Zurich and its affiliates, including e-mail and instant messaging (including content), may be scanned for the purposes of information security and assessment of internal compliance with company policy. >>>>>> _______________________________________________ >>>>>> 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 >>>> >>>> >>> -- >>> 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 >>> >> > -- > http://www.spatialys.com > My software is free, but my time generally not. -------------- next part -------------- An HTML attachment was scrubbed... URL: From even.rouault at spatialys.com Fri Nov 19 08:49:29 2021 From: even.rouault at spatialys.com (Even Rouault) Date: Fri, 19 Nov 2021 17:49:29 +0100 Subject: [mapserver-users] Corrupted PNG issue In-Reply-To: <08048e70-8eda-4579-9b2b-7033d73c7ee2@www.fastmail.com> References: <6cfd4198-5052-4102-bb76-39fed57450ec@www.fastmail.com> <12b6ad09-e661-4eb1-a128-fa4082219923@www.fastmail.com> <4acec6c1-0568-89b0-628d-0416c6439244@spatialys.com> <08048e70-8eda-4579-9b2b-7033d73c7ee2@www.fastmail.com> Message-ID: <64369195-6de4-7895-0bc9-51c37fff0fdd@spatialys.com> > > GDAL 2.4.4 doesn't create zips so it must be MapServer doing the > zipping in this version at least? Direct support for zipped shape is a recent GDAL 3 addition, which MapServer doesn't use. MapServer uses instead a lower level GDAL's CPL ZIP API: https://github.com/MapServer/MapServer/blob/main/mapogroutput.cpp#L1304 -- http://www.spatialys.com My software is free, but my time generally not. From cgodkin at gmail.com Fri Nov 19 11:06:50 2021 From: cgodkin at gmail.com (Carl Godkin) Date: Fri, 19 Nov 2021 11:06:50 -0800 Subject: [mapserver-users] Trouble with OpenStreetMap data in MapServer In-Reply-To: References: Message-ID: Hi J?rg, aimdev, and Jukka, Thanks for all of the help! I turned "buildings3" off with LAYER/STATUS OFF and found that rerunning the shp2img now works fine. But then trying the very next step, which is using this URL in the browser: http://localhost/cgi-bin/mapserv.exe? mode=browse& template=openlayers& layers=all& map=C:/ms4w/apps/osm/basemaps/osm-google.map fails with the same old error because of my old friend "buildings3." So I changed these MINSCALEDENOM 99999999999 MAXSCALEDENOM 99999999999 and now that works. (I guess layers=all means ALL LAYERS even if STATUS is OFF.) I have now made it all the way through the instructions in Jeff's tutorial and am ready to strike out on my own. Thanks very much for your help, carl On Thu, Nov 18, 2021 at 2:03 PM Carl Godkin wrote: > Hi, > > I am following the instructions for using OpenStreetMap data in MapServer > here: > > https://github.com/mapserver/mapserver/wiki/RenderingOsmDataWindows > > I've been almost all the way through the steps getting everything to work > until I reached the step "Testing with shp2img" which says to run this: > > shp2img -m osm-google.map -o output.png -map_debug 3 > > It fails, like this: > > msDrawMap(): rendering using outputformat named png (AGG/PNG). > msDrawMap(): WMS/WFS set-up and query, 0.000s > msPostGISLayerWhichShapes(): Error (out of memory for query result > ) executing query: SELECT "name"::text,ST_AsBinary(("geometry"),'NDR') as > geom,"osm_id"::text FROM (select geometry,osm_id, name as name from > osm_new_buildings) as foo WHERE "geometry" && > ST_GeomFromText('POLYGON((-20037508.3427892 > -3113412.49464005,-20037508.3427892 15861721.9613068,-1062373.88684241 > 15861721.9613068,-1062373.88684241 -3113412.49464005,-20037508.3427892 > -3113412.49464005))',3857) > msPostGISLayerWhichShapes(): Query error. Error executing query. Check > server logs > msDrawMap(): Image handling error. Failed to draw layer named 'buildings3'. > msDrawMap(): Image handling error. Failed to draw layer named > 'buildings3'.
> msPostGISLayerWhichShapes(): Query error. Error executing query. Check > server logs
> > -- > I don't see anything in the MapServer logs and don't really understand > what is wrong. > > I tried specifying individual layers with "-l " to the shp2img > command and most of them work, which I find encouraging. > Specifying layer "buildings3" which failed above still fails when > specified individually. > > I'm using Postgres 14, MS4W 4.0.5, MapServer 7.6.4 on Windows 10. > > Inspecting the "osm-google.map" file doesn't show me anything very strange > but I'm no expert. I pasted the LAYER section for "buildings3" at the > bottom in case someone spots anything. > (The process used to generate this file is ... well ... amazing!) > > I am using data from geofabric.de for the USA ( > http://download.geofabrik.de/north-america/us-latest.osm.pbf) downloaded > two days ago. > > Does anyone have any suggestions on getting to the bottom of this? I feel > like I'm tantalizingly close! > > Thanks a lot, > > carl > > --- > LAYER > STATUS ON > PROJECTION > "init=epsg:3857" > END > GROUP "default" > NAME "buildings3" > TYPE POLYGON > CONNECTIONTYPE postgis > CONNECTION "host=localhost dbname=osm user=postgres password=postgres > port=5432" > DATA "geometry from (select geometry,osm_id, name as name from > osm_new_buildings) as foo using unique osm_id using srid=3857" > LABELITEM "name" > PROCESSING "LABEL_NO_CLIP=ON" > PROCESSING "CLOSE_CONNECTION=DEFER" > MAXSCALEDENOM 83202051 > MINSCALEDENOM 41601025 > CLASS > STYLE > COLOR "#bbbbbb" > OPACITY 50 > END > STYLE > OUTLINECOLOR "#333333" > WIDTH 0 > END > END > END > -------------- next part -------------- An HTML attachment was scrubbed... URL: From John.Huotari at RCIS.com Fri Nov 19 11:01:32 2021 From: John.Huotari at RCIS.com (John Huotari) Date: Fri, 19 Nov 2021 19:01:32 +0000 Subject: [mapserver-users] Corrupted PNG issue In-Reply-To: References: Message-ID: Thanks for the feedback Jukka, Steve, and Seth. Using mapserv.exe ?nh at the command line produces the same corrupt PNGs as I get through a web server. Using MapServer 7.7.0dev from MS4W as Jukka suggested produces good PNGs, so that?s a viable alternative for me. I?ve done some playing around with different versions available from GISInternals and it appears that PNG images generate fine up through their GDAL 3.2.1 and MapServer 7.6.2 version (release-1900-x64-gdal-3-2-1-mapserver-7-6-2), but started producing corrupt PNGs in their GDAL 3.2.2 and MapServer 7.6.2 version (release-1928-x64-gdal-3-2-2-mapserver-7-6-2). If anyone with Windows wants to attempt to reproduce, the older GISInternals versions are available here: https://www.gisinternals.com/archive.php And the .map file I?m using for testing this is just hitting a publicly-available WMS. MAP NAME "MAP" CONFIG "MS_ERRORFILE" "c:/temp/ms_error.txt" CONFIG "PROJ_LIB" "C:/ms/projlib/" EXTENT -20037508.342789244 -20037508.342789244 20037508.342789244 20037508.342789244 SIZE 256 256 SYMBOLSET "c:\ms\symbols.txt" FONTSET "c:\ms\fonts.txt" IMAGECOLOR 255 255 255 TRANSPARENT ON DEFRESOLUTION 72 RESOLUTION 72 UNITS meters PROJECTION "init=epsg:3857" END WEB METADATA "wms_enable_request" "*" END END LAYER STATUS DEFAULT TYPE RASTER NAME "WMS_DRG" CONNECTIONTYPE WMS CONNECTION "https://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WmsServer?" PROJECTION "init=epsg:3857" END METADATA "wms_srs" "EPSG:3857" "wms_name" "0" "wms_server_version" "1.1.1" "wms_format" "image/png" END END END From: Steve Lime Sent: Thursday, November 18, 2021 8:53 AM To: John Huotari Cc: mapserver-users at lists.osgeo.org Subject: [EXTERNAL] Re: [mapserver-users] Corrupted PNG issue Hmmm... I've not run into or heard of this before although I'm not a windows user. I did a quick sanity check with a mapfile here and the latest 7.4 and 7.6 versions. While not exactly the same setup you have in terms of versions, they produce the exact same png image. What do you get for output if you use mapserv.exe at the command line? So something like: mapserv.exe -nh "QUERY_STRING= map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445" > test.png That would take PostMan and the web server out of the picture. Is there any chance different versions of libpng are being used? What are you using to manage the tiles? --Steve On Wed, Nov 17, 2021 at 4:57 PM John Huotari via MapServer-users > wrote: I?m attempting to upgrade from MapServer 7.6.1 to 7.6.4 via compiled packages obtained from GISInternals. I?m running it on Windows/IIS and whereas 7.6.1 was generating .PNG tiles perfectly for me, after upgrading to 7.6.4, the .PNGs being created appear to be corrupt. I can replace the 7.6.4 exe and dlls with 7.6.1 versions and the PNG images generate fine again, so while there are quite a few places that could introduce an issue, with the exception of a change to MapServer everything would be identical in my stack between having the issue in 7.6.4 and not in 7.6.1. The good headers from 7.6.1 look like this 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 and the corrupted ones from 7.6.4 look like this 89 50 4e 47 0d 0d 0a 1a 0d 0a 00 00 00 0d 49 48 44 52 It appears that the 0a values from the valid header are being converted to 0d 0a. I might be wrong here, but it appears to me that something is interpreting the 0a as a line feed and given the code is running on Windows, is converting that LF into a CR LF. The replacement doesn?t seem to be limited to the file header as I see the 7.6.4 version of the file is slightly larger (18,571 bytes instead of 18,407 bytes) and in spot checking, I?ve verified some additional 0d?s exist precede 0a within the data blocks of the .PNG. Has anyone experienced anything like this or know of any fixes? PNG Images produced on the server with shp2img are just fine, it?s only images produced by making a WMS request to mapserv.exe that have the issue. An example WMS request would be https:// Name Removed>/mapserv.exe?map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445 Maybe I?m completely misdiagnosing the problem as these PNG image files just show up as corrupted within a browser ? for example FireFox reports ?The image cannot be displayed because it contains errors.? The way I obtained the actual .PNG images to view in a binary editor was to use PostMan and save the body of the results. Perhaps PostMan introduced the extra bytes when saving an unrecognizable format file to disk whereas it did not when saving a file it recognized as a valid PNG. I can?t find anything different between the valid and invalid files beyond the extra 0d?s that have been added though, so I don?t think PostMan or anything else in the chain introduced them. ******************* PLEASE NOTE ******************* This message, along with any attachments, is for the designated recipient(s) only and may contain privileged, proprietary, or otherwise confidential information. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Any other use of such misdirected e-mail by you is prohibited. Where allowed by local law, electronic communications with Zurich and its affiliates, including e-mail and instant messaging (including content), may be scanned for the purposes of information security and assessment of internal compliance with company policy. _______________________________________________ MapServer-users mailing list MapServer-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users ******************* PLEASE NOTE ******************* This message, along with any attachments, is for the designated recipient(s) only and may contain privileged, proprietary, or otherwise confidential information. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Any other use of such misdirected e-mail by you is prohibited. Where allowed by local law, electronic communications with Zurich and its affiliates, including e-mail and instant messaging (including content), may be scanned for the purposes of information security and assessment of internal compliance with company policy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdlime at gmail.com Mon Nov 22 08:16:57 2021 From: sdlime at gmail.com (Steve Lime) Date: Mon, 22 Nov 2021 10:16:57 -0600 Subject: [mapserver-users] Corrupted PNG issue In-Reply-To: References: Message-ID: John: What happens if you take WMS out of the equation, so: mapserv.exe -nh "QUERY_STRING= map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&mode=map" > test.png --Steve On Fri, Nov 19, 2021 at 1:01 PM John Huotari wrote: > Thanks for the feedback Jukka, Steve, and Seth. > > > > Using mapserv.exe ?nh at the command line produces the same corrupt PNGs > as I get through a web server. > > > > Using MapServer 7.7.0dev from MS4W as Jukka suggested produces good PNGs, > so that?s a viable alternative for me. > > > > I?ve done some playing around with different versions available from > GISInternals and it appears that PNG images generate fine up through their > GDAL 3.2.1 and MapServer 7.6.2 version > (release-1900-x64-gdal-3-2-1-mapserver-7-6-2), but started producing > corrupt PNGs in their GDAL 3.2.2 and MapServer 7.6.2 version > (release-1928-x64-gdal-3-2-2-mapserver-7-6-2). > > > > If anyone with Windows wants to attempt to reproduce, the older > GISInternals versions are available here: > https://www.gisinternals.com/archive.php > > > > And the .map file I?m using for testing this is just hitting a > publicly-available WMS. > > > > MAP > > NAME "MAP" > > CONFIG "MS_ERRORFILE" "c:/temp/ms_error.txt" > > CONFIG "PROJ_LIB" "C:/ms/projlib/" > > EXTENT -20037508.342789244 -20037508.342789244 20037508.342789244 > 20037508.342789244 > > SIZE 256 256 > > SYMBOLSET "c:\ms\symbols.txt" > > FONTSET "c:\ms\fonts.txt" > > IMAGECOLOR 255 255 255 > > TRANSPARENT ON > > DEFRESOLUTION 72 > > RESOLUTION 72 > > UNITS meters > > PROJECTION "init=epsg:3857" END > > WEB > > METADATA > > "wms_enable_request" "*" > > END > > END > > LAYER > > STATUS DEFAULT TYPE RASTER NAME "WMS_DRG" > > CONNECTIONTYPE WMS CONNECTION " > https://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WmsServer > ?" > > PROJECTION "init=epsg:3857" END > > METADATA > > "wms_srs" "EPSG:3857" > > "wms_name" "0" > > "wms_server_version" "1.1.1" > > "wms_format" "image/png" > > END > > END > > END > > > > > > > > > > *From:* Steve Lime > *Sent:* Thursday, November 18, 2021 8:53 AM > *To:* John Huotari > *Cc:* mapserver-users at lists.osgeo.org > *Subject:* [EXTERNAL] Re: [mapserver-users] Corrupted PNG issue > > > > Hmmm... I've not run into or heard of this before although I'm not a > windows user. I did a quick sanity check with a mapfile here and the latest > 7.4 and 7.6 versions. While not exactly the same setup you have in terms of > versions, they produce the exact same png image. > > > > What do you get for output if you use mapserv.exe at the command line? So > something like: > > > > mapserv.exe -nh "QUERY_STRING= > map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445" > > test.png > > > > That would take PostMan and the web server out of the picture. Is there > any chance different versions of libpng are being used? What are you using > to manage the tiles? > > > > --Steve > > > > On Wed, Nov 17, 2021 at 4:57 PM John Huotari via MapServer-users < > mapserver-users at lists.osgeo.org> wrote: > > I?m attempting to upgrade from MapServer 7.6.1 to 7.6.4 via compiled > packages obtained from GISInternals. I?m running it on Windows/IIS and > whereas 7.6.1 was generating .PNG tiles perfectly for me, after upgrading > to 7.6.4, the .PNGs being created appear to be corrupt. I can replace the > 7.6.4 exe and dlls with 7.6.1 versions and the PNG images generate fine > again, so while there are quite a few places that could introduce an issue, > with the exception of a change to MapServer everything would be identical > in my stack between having the issue in 7.6.4 and not in 7.6.1. > > > > The good headers from 7.6.1 look like this > > > > 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 > > > > and the corrupted ones from 7.6.4 look like this > > > > 89 50 4e 47 0d 0d 0a 1a 0d 0a 00 00 00 0d 49 48 44 52 > > > > It appears that the 0a values from the valid header are being converted to > 0d 0a. I might be wrong here, but it appears to me that something is > interpreting the 0a as a line feed and given the code is running on > Windows, is converting that LF into a CR LF. The replacement doesn?t seem > to be limited to the file header as I see the 7.6.4 version of the file is > slightly larger (18,571 bytes instead of 18,407 bytes) and in spot > checking, I?ve verified some additional 0d?s exist precede 0a within the > data blocks of the .PNG. Has anyone experienced anything like this or know > of any fixes? > > > > PNG Images produced on the server with shp2img are just fine, it?s only > images produced by making a WMS request to mapserv.exe that have the > issue. An example WMS request would be > > > > https:// > Name > Removed>/mapserv.exe?map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=MAP&TILED=true&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=-10877294.873093722%2C5536486.832751887%2C-10876071.880641159%2C5537709.82520445 > > > > Maybe I?m completely misdiagnosing the problem as these PNG image files > just show up as corrupted within a browser ? for example FireFox reports > ?The image cannot be displayed because it contains > errors.? The way I obtained the actual .PNG images to view in a binary > editor was to use PostMan and save the body of the results. Perhaps > PostMan introduced the extra bytes when saving an unrecognizable format > file to disk whereas it did not when saving a file it recognized as a valid > PNG. I can?t find anything different between the valid and invalid files > beyond the extra 0d?s that have been added though, so I don?t think PostMan > or anything else in the chain introduced them. > > > ******************* PLEASE NOTE ******************* > This message, along with any attachments, is for the designated > recipient(s) only and may contain privileged, proprietary, or otherwise > confidential information. If this message has reached you in error, kindly > destroy it without review and notify the sender immediately. Any other use > of such misdirected e-mail by you is prohibited. Where allowed by local > law, electronic communications with Zurich and its affiliates, including > e-mail and instant messaging (including content), may be scanned for the > purposes of information security and assessment of internal compliance with > company policy. > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > > > > ******************* PLEASE NOTE ******************* > This message, along with any attachments, is for the designated > recipient(s) only and may contain privileged, proprietary, or otherwise > confidential information. If this message has reached you in error, kindly > destroy it without review and notify the sender immediately. Any other use > of such misdirected e-mail by you is prohibited. Where allowed by local > law, electronic communications with Zurich and its affiliates, including > e-mail and instant messaging (including content), may be scanned for the > purposes of information security and assessment of internal compliance with > company policy. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From John.Huotari at RCIS.com Mon Nov 22 13:26:55 2021 From: John.Huotari at RCIS.com (John Huotari) Date: Mon, 22 Nov 2021 21:26:55 +0000 Subject: [mapserver-users] Corrupted PNG issue In-Reply-To: References: Message-ID: I created a .map file that only referenced a single layer - a Shapefile from the local disk (of US States from the Census) and used mapserv.exe ?nh and the query string you list below. The issue with it producing an invalid PNG occurs with that as well. The resulting PNG has the same issue of the 0a (or 10 in decimal) in the header having been converted to 0d 0a (or 13 10 in decimal). From: Steve Lime > Sent: Monday, November 22, 2021 10:17 AM To: John Huotari > Cc: mapserver-users at lists.osgeo.org Subject: [EXTERNAL] Re: Re: [mapserver-users] Corrupted PNG issue John: What happens if you take WMS out of the equation, so: mapserv.exe -nh "QUERY_STRING= map=dynamic\5708d96b-c606-4c35-95e7-085fedc1dcce.map&mode=map" > test.png --Steve On Fri, Nov 19, 2021 at 1:01 PM John Huotari > wrote: Thanks for the feedback Jukka, Steve, and Seth. Using mapserv.exe ?nh at the command line produces the same corrupt PNGs as I get through a web server. Using MapServer 7.7.0dev from MS4W as Jukka suggested produces good PNGs, so that?s a viable alternative for me. I?ve done some playing around with different versions available from GISInternals and it appears that PNG images generate fine up through their GDAL 3.2.1 and MapServer 7.6.2 version (release-1900-x64-gdal-3-2-1-mapserver-7-6-2), but started producing corrupt PNGs in their GDAL 3.2.2 and MapServer 7.6.2 version (release-1928-x64-gdal-3-2-2-mapserver-7-6-2). If anyone with Windows wants to attempt to reproduce, the older GISInternals versions are available here: https://www.gisinternals.com/archive.php ******************* PLEASE NOTE ******************* This message, along with any attachments, is for the designated recipient(s) only and may contain privileged, proprietary, or otherwise confidential information. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Any other use of such misdirected e-mail by you is prohibited. Where allowed by local law, electronic communications with Zurich and its affiliates, including e-mail and instant messaging (including content), may be scanned for the purposes of information security and assessment of internal compliance with company policy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpass at bgs.ac.uk Tue Nov 23 05:30:30 2021 From: jpass at bgs.ac.uk (James Passmore - BGS) Date: Tue, 23 Nov 2021 13:30:30 +0000 Subject: [mapserver-users] Corrupted PNG issue Message-ID: Possibly not related, but I reported an issue to Tamas Szekeres (gisinternals) back in March against release-1928-x64-gdal-3-2-1-mapserver-7-6-2(dfdda8a 258d73a) then again in May with release-1928-x64-gdal-3-3-0-mapserver-7-6-3.zip (7c05724 eeeffe6). I could not get GetMap or GetLegendGraphic to work against my data, which is working against 7.4.0. WFS and WMS GetFeatureInfo were working as expected. James This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses. From sdlime at gmail.com Tue Nov 23 07:24:49 2021 From: sdlime at gmail.com (Steve Lime) Date: Tue, 23 Nov 2021 09:24:49 -0600 Subject: [mapserver-users] Corrupted PNG issue In-Reply-To: References: Message-ID: So that's 3 reports of issues with the GIS Internals build(s) then. Still could be MapServer-based though... On Tue, Nov 23, 2021 at 7:30 AM James Passmore - BGS wrote: > Possibly not related, but I reported an issue to Tamas Szekeres > (gisinternals) back in March against > release-1928-x64-gdal-3-2-1-mapserver-7-6-2(dfdda8a 258d73a) then again in > May with release-1928-x64-gdal-3-3-0-mapserver-7-6-3.zip (7c05724 > eeeffe6). I could not get GetMap or GetLegendGraphic to work against my > data, which is working against 7.4.0. > > WFS and WMS GetFeatureInfo were working as expected. > > James > > > > > This email and any attachments are intended solely for the use of the > named recipients. If you are not the intended recipient you must not use, > disclose, copy or distribute this email or any of its attachments and > should notify the sender immediately and delete this email from your > system. UK Research and Innovation (UKRI) has taken every reasonable > precaution to minimise risk of this email or any attachments containing > viruses or malware but the recipient should carry out its own virus and > malware checks before opening the attachments. UKRI does not accept any > liability for any losses or damages which the recipient may sustain due to > presence of any viruses. > > _______________________________________________ > 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 cneves at lrec.pt Tue Nov 23 11:45:44 2021 From: cneves at lrec.pt (Carlos Neves (LREC)) Date: Tue, 23 Nov 2021 19:45:44 +0000 Subject: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? Message-ID: Hi List, It seems to be simple, but I can't find a way. How to turn off a Layer in MAPSERVER when a specific Layer is ON in a MAP file? Any Help would be appreciated. Best Regards Carlos From jukka.rahkonen at maanmittauslaitos.fi Tue Nov 23 13:23:24 2021 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Tue, 23 Nov 2021 21:23:24 +0000 Subject: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? Message-ID: <15db7b749aa8482caec9576711840887@maanmittauslaitos.fi> Hi, I would try LAYER - REQUIRES that is documented in https://mapserver.org/mapfile/layer.html#labelrequires -Jukka Rahkonen- -----Alkuper?inen viesti----- L?hett?j?: MapServer-users Puolesta Carlos Neves (LREC) L?hetetty: tiistai 23. marraskuuta 2021 21.46 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? Hi List, It seems to be simple, but I can't find a way. How to turn off a Layer in MAPSERVER when a specific Layer is ON in a MAP file? Any Help would be appreciated. Best Regards Carlos _______________________________________________ MapServer-users mailing list MapServer-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users From jmckenna at gatewaygeomatics.com Tue Nov 23 13:29:50 2021 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Tue, 23 Nov 2021 17:29:50 -0400 Subject: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? In-Reply-To: References: Message-ID: <5b54d090-4e3f-3a3c-3c04-7581faba0809@gatewaygeomatics.com> Hi Carlos, I had a great answer drafted for you, tooting my own horn on the recent MapServer tutorial updates for MapServer 8.x, and the demo server updates...as by chance the tutorial mentions that the parameter "REQUIRES" at the LAYER level should do exactly what you need, super : but sadly my tests now fail with MapServer 8.0-dev, I cannot get REQUIRES to work, such as: LAYER .. REQUIRES "![modis]" END where modis is another layer name. Since I hadn't been testing this feature, and it is only briefly mentioned in the tutorial (and not part of the live demo), I have no way of saying when this should have worked, for what MapServer version. It is part of the tutorial mapfiles, but the functionality is not working, for my local tests. But your question has made me see more room for improvement in the tutorial, and its mapfiles, so your question has helped. Sorry for my non-news, ha. I'll do more testing on this feature and report back. -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ On 2021-11-23 3:45 p.m., Carlos Neves (LREC) wrote: > Hi List, > > It seems to be simple, but I can't find a way. How to turn off a Layer > in MAPSERVER when a specific Layer is ON in a MAP file? > > Any Help would be appreciated. > > Best Regards > > Carlos > > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > From jmckenna at gatewaygeomatics.com Tue Nov 23 13:34:35 2021 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Tue, 23 Nov 2021 17:34:35 -0400 Subject: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? In-Reply-To: <5b54d090-4e3f-3a3c-3c04-7581faba0809@gatewaygeomatics.com> References: <5b54d090-4e3f-3a3c-3c04-7581faba0809@gatewaygeomatics.com> Message-ID: <41c59a45-a969-ef9c-2dea-42ad4aee1f45@gatewaygeomatics.com> To give a more detailed example of what *should* work: LAYER .. REQUIRES "![modis] OR ![someotherlayername]" END I'll continue my 8.0-dev testing... -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ On 2021-11-23 5:29 p.m., Jeff McKenna wrote: > Hi Carlos, > > I had a great answer drafted for you, tooting my own horn on the recent > MapServer tutorial updates for MapServer 8.x, and the demo server > updates...as by chance the tutorial mentions that the parameter > "REQUIRES" at the LAYER level should do exactly what you need, super : > but sadly my tests now fail with MapServer 8.0-dev, I cannot get > REQUIRES to work, such as: > > ? LAYER > ?? .. > ?? REQUIRES "![modis]" > ? END > > ?where modis is another layer name. > > Since I hadn't been testing this feature, and it is only briefly > mentioned in the tutorial (and not part of the live demo), I have no way > of saying when this should have worked, for what MapServer version.? It > is part of the tutorial mapfiles, but the functionality is not working, > for my local tests. > > But your question has made me see more room for improvement in the > tutorial, and its mapfiles, so your question has helped. > > Sorry for my non-news, ha. > > I'll do more testing on this feature and report back. > > -jeff > > > From jukka.rahkonen at maanmittauslaitos.fi Tue Nov 23 13:42:36 2021 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Tue, 23 Nov 2021 21:42:36 +0000 Subject: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? Message-ID: <8c0a82047a0b45d79183cb8895c74470@maanmittauslaitos.fi> Hi Jeff, I know REQUIRES has worked in a positive way (show copyright when a layer is on) because I have used that feature but I do not admin that service any more and I can't check the details. Probably I used version 6.x then. -Jukka Rahkonen- -----Alkuper?inen viesti----- L?hett?j?: MapServer-users Puolesta Jeff McKenna L?hetetty: tiistai 23. marraskuuta 2021 23.35 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: Re: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? To give a more detailed example of what *should* work: LAYER .. REQUIRES "![modis] OR ![someotherlayername]" END I'll continue my 8.0-dev testing... -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ On 2021-11-23 5:29 p.m., Jeff McKenna wrote: > Hi Carlos, > > I had a great answer drafted for you, tooting my own horn on the recent > MapServer tutorial updates for MapServer 8.x, and the demo server > updates...as by chance the tutorial mentions that the parameter > "REQUIRES" at the LAYER level should do exactly what you need, super : > but sadly my tests now fail with MapServer 8.0-dev, I cannot get > REQUIRES to work, such as: > > ? LAYER > ?? .. > ?? REQUIRES "![modis]" > ? END > > ?where modis is another layer name. > > Since I hadn't been testing this feature, and it is only briefly > mentioned in the tutorial (and not part of the live demo), I have no way > of saying when this should have worked, for what MapServer version.? It > is part of the tutorial mapfiles, but the functionality is not working, > for my local tests. > > But your question has made me see more room for improvement in the > tutorial, and its mapfiles, so your question has helped. > > Sorry for my non-news, ha. > > I'll do more testing on this feature and report back. > > -jeff > > > _______________________________________________ MapServer-users mailing list MapServer-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users From jmckenna at gatewaygeomatics.com Tue Nov 23 13:58:07 2021 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Tue, 23 Nov 2021 17:58:07 -0400 Subject: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? In-Reply-To: <8c0a82047a0b45d79183cb8895c74470@maanmittauslaitos.fi> References: <8c0a82047a0b45d79183cb8895c74470@maanmittauslaitos.fi> Message-ID: <9c6d2930-991e-d0c5-6bc6-798602258373@gatewaygeomatics.com> Thanks Jukka, was that in CGI, or WMS modes? Maybe I am testing wrong, ha. -jeff -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ On 2021-11-23 5:42 p.m., Rahkonen Jukka (MML) wrote: > Hi Jeff, > > I know REQUIRES has worked in a positive way (show copyright when a layer is on) because I have used that feature but I do not admin that service any more and I can't check the details. Probably I used version 6.x then. > > -Jukka Rahkonen- > > -----Alkuper?inen viesti----- > L?hett?j?: MapServer-users Puolesta Jeff McKenna > L?hetetty: tiistai 23. marraskuuta 2021 23.35 > Vastaanottaja: mapserver-users at lists.osgeo.org > Aihe: Re: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? > > To give a more detailed example of what *should* work: > > LAYER > .. > REQUIRES "![modis] OR ![someotherlayername]" > END > > I'll continue my 8.0-dev testing... > > > -jeff > > > > -- > Jeff McKenna > GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ > > > On 2021-11-23 5:29 p.m., Jeff McKenna wrote: >> Hi Carlos, >> >> I had a great answer drafted for you, tooting my own horn on the recent >> MapServer tutorial updates for MapServer 8.x, and the demo server >> updates...as by chance the tutorial mentions that the parameter >> "REQUIRES" at the LAYER level should do exactly what you need, super : >> but sadly my tests now fail with MapServer 8.0-dev, I cannot get >> REQUIRES to work, such as: >> >> ? LAYER >> ?? .. >> ?? REQUIRES "![modis]" >> ? END >> >> ?where modis is another layer name. >> >> Since I hadn't been testing this feature, and it is only briefly >> mentioned in the tutorial (and not part of the live demo), I have no way >> of saying when this should have worked, for what MapServer version.? It >> is part of the tutorial mapfiles, but the functionality is not working, >> for my local tests. >> >> But your question has made me see more room for improvement in the >> tutorial, and its mapfiles, so your question has helped. >> >> Sorry for my non-news, ha. >> >> I'll do more testing on this feature and report back. >> >> -jeff >> >> >> > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > From jmckenna at gatewaygeomatics.com Tue Nov 23 14:07:31 2021 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Tue, 23 Nov 2021 18:07:31 -0400 Subject: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? In-Reply-To: <8c0a82047a0b45d79183cb8895c74470@maanmittauslaitos.fi> References: <8c0a82047a0b45d79183cb8895c74470@maanmittauslaitos.fi> Message-ID: <4c0fc034-5c2b-dba2-a019-c760a88c4069@gatewaygeomatics.com> Indeed I think my testing was wrong, as mode=map and layers= was overriding the REQUIRES parameter, as I see that in msautotest things are working with shp2img. So, maybe I should not have sent these messages ha. -jeff On 2021-11-23 5:42 p.m., Rahkonen Jukka (MML) wrote: > Hi Jeff, > > I know REQUIRES has worked in a positive way (show copyright when a layer is on) because I have used that feature but I do not admin that service any more and I can't check the details. Probably I used version 6.x then. > > -Jukka Rahkonen- > > -----Alkuper?inen viesti----- > L?hett?j?: MapServer-users Puolesta Jeff McKenna > L?hetetty: tiistai 23. marraskuuta 2021 23.35 > Vastaanottaja: mapserver-users at lists.osgeo.org > Aihe: Re: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? > > To give a more detailed example of what *should* work: > > LAYER > .. > REQUIRES "![modis] OR ![someotherlayername]" > END > > I'll continue my 8.0-dev testing... > > > -jeff > > > > -- > Jeff McKenna > GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ > > > On 2021-11-23 5:29 p.m., Jeff McKenna wrote: >> Hi Carlos, >> >> I had a great answer drafted for you, tooting my own horn on the recent >> MapServer tutorial updates for MapServer 8.x, and the demo server >> updates...as by chance the tutorial mentions that the parameter >> "REQUIRES" at the LAYER level should do exactly what you need, super : >> but sadly my tests now fail with MapServer 8.0-dev, I cannot get >> REQUIRES to work, such as: >> >> ? LAYER >> ?? .. >> ?? REQUIRES "![modis]" >> ? END >> >> ?where modis is another layer name. >> >> Since I hadn't been testing this feature, and it is only briefly >> mentioned in the tutorial (and not part of the live demo), I have no way >> of saying when this should have worked, for what MapServer version.? It >> is part of the tutorial mapfiles, but the functionality is not working, >> for my local tests. >> >> But your question has made me see more room for improvement in the >> tutorial, and its mapfiles, so your question has helped. >> >> Sorry for my non-news, ha. >> >> I'll do more testing on this feature and report back. >> >> -jeff >> >> >> > > _______________________________________________ > MapServer-users mailing list > MapServer-users at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/mapserver-users > -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ From sander.pukk at gmail.com Wed Nov 24 05:01:42 2021 From: sander.pukk at gmail.com (Sander Pukk) Date: Wed, 24 Nov 2021 15:01:42 +0200 Subject: [mapserver-users] WFS bbox/intersect etc query from custom projection to EPSG:4326 Message-ID: Hi there! We have been running into an issue with WFS, EPSG:4326 and a filter (namely bbox) query. We have been using MapServer for years and the current version we have is 7.6.4. WMS and WFS are both enabled and WFS is configured for gml and geojson. Our MapServer's main output is in EPSG:3301 projection and most of our clients use it like that. The bbox OGC WFS filters work in that projection and another more "robust" approach by limiting bbox into a 20x20 pixel square in the request. Our MapServer can also function in the regular 4326 and 3857 in WMS and WFS. But one of our clients is doing their things in 4326 and we noticed an issue when querying WFS with a bbox/intersect filter in that projection. *Main problem:*Trying to reverse geocode from WFS service (capable of 3301, 4326 and 3857) where underlying data is in EPSG:3301 and request comes in 4326. The response should be in 4326, but the transformation does not work. (Obvious from the database SQL). Everything works in EPSG:3301. I have obscured some URL and Layer names. Our map file with a sample layer looks like this: MAP LEGEND LABEL TYPE truetype FONT "Arial" SIZE 10 POSITION AUTO END END NAME "<%NAME%>_keskkond" STATUS ON EXTENT <%= node['mapserver']['extent'] %> FONTSET "<%= URL %>/fonts/current/fonts.list" IMAGETYPE "png" DEFRESOLUTION 96 RESOLUTION 96 CONFIG "MS_ERRORFILE" "infolayer.log" DEBUG 0 MAXSIZE 10000 OUTPUTFORMAT NAME "png" DRIVER AGG/PNG MIMETYPE "image/png" IMAGEMODE RGB EXTENSION "png" FORMATOPTION "QUANTIZE_FORCE=on" END OUTPUTFORMAT NAME "geojson" DRIVER "OGR/GEOJSON" MIMETYPE "application/json; subtype=geojson; charset=utf-8" FORMATOPTION "STORAGE=filesystem" FORMATOPTION "FORM=SIMPLE" END WEB METADATA "wfs_title" "infolayer" "wfs_enable_request" "*" "wfs_encoding" "UTF-8" "wms_title" "infolayer" "wms_encoding" "UTF-8" "wms_onlineresource" "/mapserv?map=/app/gis/infokihid/infolayer.map&" "wfs_onlineresource" "/mapserv?map=/app/gis/infokihid/infolayer.map&" "ows_srs" "EPSG:3301 EPSG:3857 EPSG:4326" "ows_enable_request" "*" "wfs_getfeature_formatlist" "gml,geojson" "wms_feature_info_mime_type" "application/json,application/json; subtype=geojson,application/vnd.ogc.gml,text/plain" END END PROJECTION "init=epsg:3301" END LAYER TEMPLATE "dummy" NAME "omavalitsus" STATUS off TYPE polygon CONNECTIONTYPE POSTGIS INCLUDE "postgis.inc" DATA "geom from omavalitsus using unique gid using srid=3301" LABELITEM "nimetus" TYPE polygon MAXSCALEDENOM 2000000 METADATA "gml_msGeometry_type" "polygon" "wfs_title" "omavalitsus" "wms_title" "omavalitsus" "wfs_srs" "EPSG:3301" "wms_srs" "EPSG:3301" "wms_extent" "355000 6360000 754000 6660000" "gml_include_items" "all" "ows_include_items" "all" "wfs_srs" "EPSG:3301" "gml_featureid" "id" "ows_featureid" "id" END CLASS NAME omavalitsus STYLE COLOR 234 123 43 OPACITY 15 END STYLE WIDTH 2 OUTLINECOLOR 80 80 80 OPACITY 15 END END END If we do a query without a bbox and want all the features, it works. Example: https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&service=WFS&request=GetFeature&version=1.1.0&typename={{LAYER}}&outputformat=gml3&srsName=EPSG:4326 WFS version 1.3.0 and 2.0.0 But if we add a bbox in OGC filter format or bbox, then it does not work anymore: Example: https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&service=WFS&request=GetFeature&version=1.1.0&typename={{LAYER}}&outputformat=gml3&srsName=EPSG:4326&bbox=24.753586,59.29725,24.773586,59.31725,urn:x-ogc:def:crs:EPSG:4326 OR OGC https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&SERVICE=WFS&Version=2.0.0&REQUEST=GetFeature&typeNames={{LAYER}}&Filter=Geometry25.035308,59.32675 Some documentation hints that OGC filter needs to be in the same SRID as the underlying data so I guess that shouldn't be working. SQL form the database where you can see the geom query part where transformation of geom contains/intersect etc happens, is is wrong: select <>,ST_AsBinary(("geom"),'NDR') as geom,"gid"::text from (select * from LAYER where kehtiv_alates < now() and (kehtiv_kuni > now() OR kehtiv_kuni is null)) as subquery where ("geom" && ST_GeomFromText('POLYGON((296500 6249000,296500 6761000,808500 6761000,808500 6249000,296500 6249000))',3301)) AND ST_Distance("geom", ST_GeomFromText('POLYGON((296500 6249000,296500 6761000,808500 6761000,808500 6249000,296500 6249000))',3301)) = 0 and (st_contains(geom,ST_GeomFromText('POINT (25.0353080000000006 59.3267499999999970)',3301)) = TRUE) The contains should be: (st_contains(geom,ST_TRANSFORM(ST_GeomFromText('POINT (25.0353080000000006 59.3267499999999970)',4326),3301)) One way to get a result is using WFS 1.0.0. It returns the result in EPSG:3301 but is correct. https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&service=WFS&request=GetFeature&version=1.0.0&typename={{LAYER}}&outputformat=gml3&srsName=EPSG:4326&bbox=24.753586,59.29725,24.773586,59.31725,urn:x-ogc:def:crs:EPSG:4326 I have tried different OGC filters, but they all act the same when trying to do stuff in EPSG:4326. Tried different WFS versions, coordinate order in OGC filter/manual bbox etc. Even with the OGC filter being in EPSG:3301, but request in srs 4326. Have not yet managed to get it. So my questions are: 1. Is there something wrong in our MAP/LAYER files? Do we need to change or add something? 2. Could/Should it be possible to do what we are trying to do, when the main projection is something different then all the request parameters? Cheers, Sander -------------- next part -------------- An HTML attachment was scrubbed... URL: From sethg at geographika.co.uk Wed Nov 24 07:32:16 2021 From: sethg at geographika.co.uk (Seth G) Date: Wed, 24 Nov 2021 16:32:16 +0100 Subject: [mapserver-users] WFS bbox/intersect etc query from custom projection to EPSG:4326 In-Reply-To: References: Message-ID: <9a885fe2-7937-4a72-9a1e-f668156a05eb@www.fastmail.com> Hi Sander, Does adding a PROJECTION block to your LAYER have an effect? Even if the layer projection is the same as the MAP I think I've run into a few combinations where setting explicitly on the layer helped. Seth -- web:http://geographika.co.uk twitter: @geographika On Wed, Nov 24, 2021, at 2:01 PM, Sander Pukk wrote: > Hi there! > > We have been running into an issue with WFS, EPSG:4326 and a filter (namely bbox) query. > We have been using MapServer for years and the current version we have is 7.6.4. > WMS and WFS are both enabled and WFS is configured for gml and geojson. > > Our MapServer's main output is in EPSG:3301 projection and most of our clients use it like that. > The bbox OGC WFS filters work in that projection and another more "robust" approach by limiting bbox into a 20x20 pixel square in the request. > > Our MapServer can also function in the regular 4326 and 3857 in WMS and WFS. > But one of our clients is doing their things in 4326 and we noticed an issue when querying WFS with a bbox/intersect filter in that projection. > > *Main problem: *Trying to reverse geocode from WFS service (capable of 3301, 4326 and 3857) where underlying data is in EPSG:3301 and request comes in 4326. > The response should be in 4326, but the transformation does not work. (Obvious from the database SQL). > Everything works in EPSG:3301. > > I have obscured some URL and Layer names. > Our map file with a sample layer looks like this: > MAP > > LEGEND > LABEL > TYPE truetype > FONT "Arial" > SIZE 10 > POSITION AUTO > END > END > > NAME "<%NAME%>_keskkond" > STATUS ON > EXTENT <%= node['mapserver']['extent'] %> > FONTSET "<%= URL %>/fonts/current/fonts.list" > IMAGETYPE "png" > DEFRESOLUTION 96 > RESOLUTION 96 > CONFIG "MS_ERRORFILE" "infolayer.log" > DEBUG 0 > MAXSIZE 10000 > OUTPUTFORMAT > NAME "png" > DRIVER AGG/PNG > MIMETYPE "image/png" > IMAGEMODE RGB > EXTENSION "png" > FORMATOPTION "QUANTIZE_FORCE=on" > END > > OUTPUTFORMAT > NAME "geojson" > DRIVER "OGR/GEOJSON" > MIMETYPE "application/json; subtype=geojson; charset=utf-8" > FORMATOPTION "STORAGE=filesystem" > FORMATOPTION "FORM=SIMPLE" > END > > WEB > METADATA > "wfs_title" "infolayer" > "wfs_enable_request" "*" > "wfs_encoding" "UTF-8" > "wms_title" "infolayer" > "wms_encoding" "UTF-8" > "wms_onlineresource" "/mapserv?map=/app/gis/infokihid/infolayer.map&" > "wfs_onlineresource" "/mapserv?map=/app/gis/infokihid/infolayer.map&" > "ows_srs" "EPSG:3301 EPSG:3857 EPSG:4326" > "ows_enable_request" "*" > "wfs_getfeature_formatlist" "gml,geojson" > "wms_feature_info_mime_type" "application/json,application/json; subtype=geojson,application/vnd.ogc.gml,text/plain" > END > END > > PROJECTION > "init=epsg:3301" > END > > LAYER > TEMPLATE "dummy" > NAME "omavalitsus" > STATUS off > TYPE polygon > CONNECTIONTYPE POSTGIS > INCLUDE "postgis.inc" > DATA "geom from omavalitsus using unique gid using srid=3301" > LABELITEM "nimetus" > TYPE polygon > MAXSCALEDENOM 2000000 > > METADATA > "gml_msGeometry_type" "polygon" > "wfs_title" "omavalitsus" > "wms_title" "omavalitsus" > "wfs_srs" "EPSG:3301" > "wms_srs" "EPSG:3301" > "wms_extent" "355000 6360000 754000 6660000" > "gml_include_items" "all" > "ows_include_items" "all" > "wfs_srs" "EPSG:3301" > "gml_featureid" "id" > "ows_featureid" "id" > END > > CLASS > NAME omavalitsus > STYLE > COLOR 234 123 43 > OPACITY 15 > END > STYLE > WIDTH 2 > OUTLINECOLOR 80 80 80 > OPACITY 15 > END > END > END > > > If we do a query without a bbox and want all the features, it works. > > Example: > https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&service=WFS&request=GetFeature&version=1.1.0&typename={{LAYER}}&outputformat=gml3&srsName=EPSG:4326 > > WFS version 1.3.0 and 2.0.0 > But if we add a bbox in OGC filter format or bbox, then it does not work anymore: > > Example: > > https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&service=WFS&request=GetFeature&version=1.1.0&typename={{LAYER}}&outputformat=gml3&srsName=EPSG:4326&bbox=24.753586,59.29725,24.773586,59.31725,urn:x-ogc:def:crs:EPSG:4326 > > OR OGC > > https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&SERVICE=WFS&Version=2.0.0&REQUEST=GetFeature&typeNames={{LAYER}}&Filter= Geometry25.035308,59.32675 > > > Some documentation hints that OGC filter needs to be in the same SRID as the underlying data so I guess that shouldn't be working. > > SQL form the database where you can see the geom query part where transformation of geom contains/intersect etc happens, is is wrong: > > select <>,ST_AsBinary(("geom"),'NDR') as geom,"gid"::text from (select * from LAYER where kehtiv_alates < now() and (kehtiv_kuni > now() OR kehtiv_kuni is null)) as subquery where ("geom" && ST_GeomFromText('POLYGON((296500 6249000,296500 6761000,808500 6761000,808500 6249000,296500 6249000))',3301)) AND ST_Distance("geom", ST_GeomFromText('POLYGON((296500 6249000,296500 6761000,808500 6761000,808500 6249000,296500 6249000))',3301)) = 0 and (st_contains(geom,ST_GeomFromText('POINT (25.0353080000000006 59.3267499999999970)',3301)) = TRUE) > > The contains should be: > > (st_contains(geom,ST_TRANSFORM(ST_GeomFromText('POINT (25.0353080000000006 59.3267499999999970)',4326),3301)) > > One way to get a result is using WFS 1.0.0. It returns the result in EPSG:3301 but is correct. > > https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&service=WFS&request=GetFeature&version=1.0.0&typename={{LAYER}}&outputformat=gml3&srsName=EPSG:4326&bbox=24.753586,59.29725,24.773586,59.31725,urn:x-ogc:def:crs:EPSG:4326 > > I have tried different OGC filters, but they all act the same when trying to do stuff in EPSG:4326. > Tried different WFS versions, coordinate order in OGC filter/manual bbox etc. > Even with the OGC filter being in EPSG:3301, but request in srs 4326. > Have not yet managed to get it. > > So my questions are: > 1. Is there something wrong in our MAP/LAYER files? Do we need to change or add something? > 2. Could/Should it be possible to do what we are trying to do, when the main projection is something different then all the request parameters? > > Cheers, > Sander > _______________________________________________ > 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 Wed Nov 24 11:18:19 2021 From: jmckenna at gatewaygeomatics.com (Jeff McKenna) Date: Wed, 24 Nov 2021 15:18:19 -0400 Subject: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? In-Reply-To: <4c0fc034-5c2b-dba2-a019-c760a88c4069@gatewaygeomatics.com> References: <8c0a82047a0b45d79183cb8895c74470@maanmittauslaitos.fi> <4c0fc034-5c2b-dba2-a019-c760a88c4069@gatewaygeomatics.com> Message-ID: <64aa9baf-a0df-72ab-401a-84022a84ce4c@gatewaygeomatics.com> Ah! Boy this was tricky to get working. In my tests, it is the logical operators AND and OR that are not working, with MapServer 8.0-dev (I tested mode=map, map2img/shp2img, WMS GetMap, and PHP MapScript). But the great news is that something like the following works well, in all modes : LAYER .. REQUIRES "![yourlayername]" END not working: REQUIRES "![yourlayername] OR ![someotherlayername]" I'll add these notes to the docs today... Thanks for the nudge on this Carlos! -jeff On 2021-11-23 6:07 p.m., Jeff McKenna wrote: > Indeed I think my testing was wrong, as mode=map and layers= was > overriding the REQUIRES parameter, as I see that in msautotest things > are working with shp2img.? So, maybe I should not have sent these > messages ha. > > -jeff > > > > On 2021-11-23 5:42 p.m., Rahkonen Jukka (MML) wrote: >> Hi Jeff, >> >> I know REQUIRES has worked in a positive way (show copyright when a >> layer is on) because I have used that feature but I do not admin that >> service any more and I can't check the details. Probably I used >> version 6.x then. >> >> -Jukka Rahkonen- >> >> -----Alkuper?inen viesti----- >> L?hett?j?: MapServer-users >> Puolesta Jeff McKenna >> L?hetetty: tiistai 23. marraskuuta 2021 23.35 >> Vastaanottaja: mapserver-users at lists.osgeo.org >> Aihe: Re: [mapserver-users] How to Turn off a Layer when other >> specific Layer is ON in a map file ? >> >> To give a more detailed example of what *should* work: >> >> ??? LAYER >> ????? .. >> ????? REQUIRES "![modis] OR ![someotherlayername]" >> ??? END >> >> I'll continue my 8.0-dev testing... >> >> >> -jeff >> >> >> >> -- >> Jeff McKenna >> GatewayGeo: Developers of MS4W, MapServer Consulting and Training >> co-founder of FOSS4G http://gatewaygeo.com/ >> >> >> On 2021-11-23 5:29 p.m., Jeff McKenna wrote: >>> Hi Carlos, >>> >>> I had a great answer drafted for you, tooting my own horn on the recent >>> MapServer tutorial updates for MapServer 8.x, and the demo server >>> updates...as by chance the tutorial mentions that the parameter >>> "REQUIRES" at the LAYER level should do exactly what you need, super : >>> but sadly my tests now fail with MapServer 8.0-dev, I cannot get >>> REQUIRES to work, such as: >>> >>> ? ? LAYER >>> ? ?? .. >>> ? ?? REQUIRES "![modis]" >>> ? ? END >>> >>> ? ?where modis is another layer name. >>> >>> Since I hadn't been testing this feature, and it is only briefly >>> mentioned in the tutorial (and not part of the live demo), I have no way >>> of saying when this should have worked, for what MapServer version.? It >>> is part of the tutorial mapfiles, but the functionality is not working, >>> for my local tests. >>> >>> But your question has made me see more room for improvement in the >>> tutorial, and its mapfiles, so your question has helped. >>> >>> Sorry for my non-news, ha. >>> >>> I'll do more testing on this feature and report back. >>> >>> -jeff >>> >>> >>> >> >> _______________________________________________ >> MapServer-users mailing list >> MapServer-users at lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users >> > > -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ From sander.pukk at gmail.com Wed Nov 24 23:21:20 2021 From: sander.pukk at gmail.com (Sander Pukk) Date: Thu, 25 Nov 2021 09:21:20 +0200 Subject: [mapserver-users] WFS bbox/intersect etc query from custom projection to EPSG:4326 In-Reply-To: <9a885fe2-7937-4a72-9a1e-f668156a05eb@www.fastmail.com> References: <9a885fe2-7937-4a72-9a1e-f668156a05eb@www.fastmail.com> Message-ID: Hei! Unfortunately it did not change the behaviour. Regards, Sander On Wed, Nov 24, 2021 at 5:33 PM Seth G wrote: > Hi Sander, > > Does adding a PROJECTION block to your LAYER have an effect? > Even if the layer projection is the same as the MAP I think I've run into > a few combinations where setting explicitly on the layer helped. > > Seth > > > -- > web:http://geographika.co.uk > twitter: @geographika > > > On Wed, Nov 24, 2021, at 2:01 PM, Sander Pukk wrote: > > Hi there! > > We have been running into an issue with WFS, EPSG:4326 and a filter > (namely bbox) query. > We have been using MapServer for years and the current version we have is > 7.6.4. > WMS and WFS are both enabled and WFS is configured for gml and geojson. > > Our MapServer's main output is in EPSG:3301 projection and most of our > clients use it like that. > The bbox OGC WFS filters work in that projection and another more "robust" > approach by limiting bbox into a 20x20 pixel square in the request. > > Our MapServer can also function in the regular 4326 and 3857 in WMS and > WFS. > But one of our clients is doing their things in 4326 and we noticed an > issue when querying WFS with a bbox/intersect filter in that projection. > > > *Main problem:*Trying to reverse geocode from WFS service (capable of > 3301, 4326 and 3857) where underlying data is in EPSG:3301 and request > comes in 4326. > The response should be in 4326, but the transformation does not work. > (Obvious from the database SQL). > Everything works in EPSG:3301. > > I have obscured some URL and Layer names. > Our map file with a sample layer looks like this: > MAP > > LEGEND > LABEL > TYPE truetype > FONT "Arial" > SIZE 10 > POSITION AUTO > END > END > > NAME "<%NAME%>_keskkond" > STATUS ON > EXTENT <%= node['mapserver']['extent'] %> > FONTSET "<%= URL %>/fonts/current/fonts.list" > IMAGETYPE "png" > DEFRESOLUTION 96 > RESOLUTION 96 > CONFIG "MS_ERRORFILE" "infolayer.log" > DEBUG 0 > MAXSIZE 10000 > OUTPUTFORMAT > NAME "png" > DRIVER AGG/PNG > MIMETYPE "image/png" > IMAGEMODE RGB > EXTENSION "png" > FORMATOPTION "QUANTIZE_FORCE=on" > END > > OUTPUTFORMAT > NAME "geojson" > DRIVER "OGR/GEOJSON" > MIMETYPE "application/json; subtype=geojson; charset=utf-8" > FORMATOPTION "STORAGE=filesystem" > FORMATOPTION "FORM=SIMPLE" > END > > WEB > METADATA > "wfs_title" "infolayer" > "wfs_enable_request" "*" > "wfs_encoding" "UTF-8" > "wms_title" "infolayer" > "wms_encoding" "UTF-8" > "wms_onlineresource" > "/mapserv?map=/app/gis/infokihid/infolayer.map&" > "wfs_onlineresource" > "/mapserv?map=/app/gis/infokihid/infolayer.map&" > "ows_srs" "EPSG:3301 EPSG:3857 EPSG:4326" > "ows_enable_request" "*" > "wfs_getfeature_formatlist" "gml,geojson" > "wms_feature_info_mime_type" > "application/json,application/json; > subtype=geojson,application/vnd.ogc.gml,text/plain" > END > END > > PROJECTION > "init=epsg:3301" > END > > LAYER > TEMPLATE "dummy" > NAME "omavalitsus" > STATUS off > TYPE polygon > CONNECTIONTYPE POSTGIS > INCLUDE "postgis.inc" > DATA "geom from omavalitsus using unique gid using srid=3301" > LABELITEM "nimetus" > TYPE polygon > MAXSCALEDENOM 2000000 > > METADATA > "gml_msGeometry_type" "polygon" > "wfs_title" "omavalitsus" > "wms_title" "omavalitsus" > "wfs_srs" "EPSG:3301" > "wms_srs" "EPSG:3301" > "wms_extent" "355000 6360000 754000 6660000" > "gml_include_items" "all" > "ows_include_items" "all" > "wfs_srs" "EPSG:3301" > "gml_featureid" "id" > "ows_featureid" "id" > END > > CLASS > NAME omavalitsus > STYLE > COLOR 234 123 43 > OPACITY 15 > END > STYLE > WIDTH 2 > OUTLINECOLOR 80 80 80 > OPACITY 15 > END > END > END > > > If we do a query without a bbox and want all the features, it works. > > Example: > > https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&service=WFS&request=GetFeature&version=1.1.0&typename={{LAYER}}&outputformat=gml3&srsName=EPSG:4326 > > WFS version 1.3.0 and 2.0.0 > But if we add a bbox in OGC filter format or bbox, then it does not work > anymore: > > Example: > > > https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&service=WFS&request=GetFeature&version=1.1.0&typename={{LAYER}}&outputformat=gml3&srsName=EPSG:4326&bbox=24.753586,59.29725,24.773586,59.31725,urn:x-ogc:def:crs:EPSG:4326 > > OR OGC > > > https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&SERVICE=WFS&Version=2.0.0&REQUEST=GetFeature&typeNames={{LAYER}}&Filter=Geometry srsName="urn:ogc:def:crs:EPSG::4326">25.035308,59.32675 > > > Some documentation hints that OGC filter needs to be in the same SRID as > the underlying data so I guess that shouldn't be working. > > SQL form the database where you can see the geom query part where > transformation of geom contains/intersect etc happens, is is wrong: > > select <>,ST_AsBinary(("geom"),'NDR') as geom,"gid"::text from (select * from LAYER where kehtiv_alates < now() and (kehtiv_kuni > now() OR kehtiv_kuni is null)) as subquery where ("geom" && ST_GeomFromText('POLYGON((296500 6249000,296500 6761000,808500 6761000,808500 6249000,296500 6249000))',3301)) AND ST_Distance("geom", ST_GeomFromText('POLYGON((296500 6249000,296500 6761000,808500 6761000,808500 6249000,296500 6249000))',3301)) = 0 and (st_contains(geom,ST_GeomFromText('POINT (25.0353080000000006 59.3267499999999970)',3301)) = TRUE) > > > The contains should be: > > (st_contains(geom,ST_TRANSFORM(ST_GeomFromText('POINT (25.0353080000000006 59.3267499999999970)',4326),3301)) > > > One way to get a result is using WFS 1.0.0. It returns the result in > EPSG:3301 but is correct. > > > https://URL/mapserv?map=/app/gis/infokihid/infolayers_other.map&service=WFS&request=GetFeature&version=1.0.0&typename={{LAYER}}&outputformat=gml3&srsName=EPSG:4326&bbox=24.753586,59.29725,24.773586,59.31725,urn:x-ogc:def:crs:EPSG:4326 > > I have tried different OGC filters, but they all act the same when trying > to do stuff in EPSG:4326. > Tried different WFS versions, coordinate order in OGC filter/manual bbox > etc. > Even with the OGC filter being in EPSG:3301, but request in srs 4326. > Have not yet managed to get it. > > So my questions are: > > 1. Is there something wrong in our MAP/LAYER files? Do we need to > change or add something? > 2. Could/Should it be possible to do what we are trying to do, when > the main projection is something different then all the request parameters? > > > Cheers, > Sander > _______________________________________________ > 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 jukka.rahkonen at maanmittauslaitos.fi Thu Nov 25 01:12:42 2021 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Thu, 25 Nov 2021 09:12:42 +0000 Subject: [mapserver-users] WFS bbox/intersect etc query from custom projection to EPSG:4326 Message-ID: <2f4d2a250048473b943217c335324a10@maanmittauslaitos.fi> (resending to the list without the original mail, list has rather (too?) strict size limits, 40 KB) Hi, Perhaps you fell into the infamous axis order trap. With WFS 1.1.x and 2.0 the coordinates of EPSG:4326 most be in latitude-longiture oreder. I modified you mapfile a bit for my test data that are in EPSG:3067, and this request http://localhost:8060/cgi-bin/mapserv.exe?map=c:/ms4w_data/wfstest.map&service=WFS&version=2.0.0&request=GetFeature&TypeNames=ms:testi_virolaisille&BBOX=60.1870614692821,24.9810192523929,60.2794267964524,25.1561900521738,urn:ogc:def:crs:EPSG::4326 finds buildings from the database. The SQL that Mapserver generates is: [Thu Nov 25 10:23:51 2021].654000 msPostGISLayerWhichShapes query: SELECT "fid"::text,"id"::text,"mtk_id"::text,"sijaintitarkkuus"::text,"aineistolahde"::text,"alkupvm"::text,"kohdeluokka"::text,"korkeustarkkuus"::text,"kayttotarkoitus"::text,"kerrosluku"::text,"pohjankorkeus"::text,"korkeusarvo"::text,ST_AsBinary(("geom"),'NDR') as geom,"fid"::text FROM rakennus WHERE "geom" && ST_GeomFromText('POLYGON((388034.000000002 6673671.81841385,388034.000000002 6684239.6439825,398034 6684239.6439825,398034 6673671.81841385,388034.000000002 6673671.81841385))',3067) Notice that the re-projected polygon seems to be the envelope of the rotated bbox from the transformation and therefore it is bigger than the polygon that would be achieved by connecting the projected corner points as this test with gdaltranform shows. gdaltransform -s_srs epsg:4326 -t_srs epsg:3067 24.9810192523929 60.1870614692821 388034.000000002 6673956 0 25.1561900521738 60.279426796452 398033.999999999 6683955.99999996 0 I add also my mapfile, I apologize that it is just a fast modification of some old mapfile and is not the cleanest possible. MAP CONFIG "MS_ERRORFILE" "/ms4w_data/ms_error.txt" EXTENT 19970 6597278 749676 7785300 PROJECTION "init=epsg:3067" END OUTPUTFORMAT NAME "OGRGML" DRIVER "OGR/GML" FORMATOPTION "STORAGE=stream" FORMATOPTION "LCO:COORDINATE_PRECISION=10" END OUTPUTFORMAT NAME "GeoJSON" DRIVER "OGR/GEOJSON" MIMETYPE "application/json; subtype=geojson; charset=utf-8" FORMATOPTION "STORAGE=stream" FORMATOPTION "FORM=SIMPLE" FORMATOPTION "LCO:COORDINATE_PRECISION=10" END LAYER NAME "testi_virolaisille" STATUS ON DEBUG 10 TYPE polygon PROJECTION "init=epsg:3067" END METADATA "ows_title" "viro_testi" "ows_abstract" "viro_testi" "wfs_getfeature_formatlist" "GeoJSON" # "gml_featureid" "id" "gml_include_items" "all" # "gml_types" "auto" "wfs_srs" "EPSG:3067 EPSG:3857 EPSG:4326" END CONNECTIONTYPE POSTGIS CONNECTION "host=localhost port=5432 dbname= user= password= " DATA "geom from rakennus using SRID=3067" CLASS STYLE COLOR 255 0 0 END END END WEB MINSCALE 10 MAXSCALE 1550000 METADATA "wms_title" "wfs_test" "wfs_onlineresource" http://localhost:8060/cgi-bin/mapserv.exe?map=c:\ms4w_data\wfstest.map "wms_srs" "EPSG:4326 EPSG:900913 EPSG:3857 EPSG:31370" "wms_enable_request" "*" "wms_feature_info_mime_type" "text/html" "wms_format" "image/png" "wfs_title" "wfs_test" "wfs_srs" "EPSG:3067 EPSG:3857 EPSG:4326" "wfs_enable_request" "*" "wfs_precision" "10" #"wfs_feature_info_mime_type" "text/html" END END END -Jukka Rahkonen- -------------- next part -------------- An HTML attachment was scrubbed... URL: From jukka.rahkonen at maanmittauslaitos.fi Thu Nov 25 04:09:00 2021 From: jukka.rahkonen at maanmittauslaitos.fi (Rahkonen Jukka (MML)) Date: Thu, 25 Nov 2021 12:09:00 +0000 Subject: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? Message-ID: <8507856c316f44e3ad231eee426626ec@maanmittauslaitos.fi> Hi Jeff, I wonder how REQUIRES works/should work with other services. I think that with WCS it cannot work and makes no sense either, with WFS it could work (same effect than modifying the &typenames= ) but maybe does not make sense, but how about vector tiles? -Jukka Rahkonen- -----Alkuper?inen viesti----- L?hett?j?: MapServer-users Puolesta Jeff McKenna L?hetetty: keskiviikko 24. marraskuuta 2021 21.18 Vastaanottaja: mapserver-users at lists.osgeo.org Aihe: Re: [mapserver-users] How to Turn off a Layer when other specific Layer is ON in a map file ? Ah! Boy this was tricky to get working. In my tests, it is the logical operators AND and OR that are not working, with MapServer 8.0-dev (I tested mode=map, map2img/shp2img, WMS GetMap, and PHP MapScript). But the great news is that something like the following works well, in all modes : LAYER .. REQUIRES "![yourlayername]" END not working: REQUIRES "![yourlayername] OR ![someotherlayername]" I'll add these notes to the docs today... Thanks for the nudge on this Carlos! -jeff On 2021-11-23 6:07 p.m., Jeff McKenna wrote: > Indeed I think my testing was wrong, as mode=map and layers= was > overriding the REQUIRES parameter, as I see that in msautotest things > are working with shp2img.? So, maybe I should not have sent these > messages ha. > > -jeff > > > > On 2021-11-23 5:42 p.m., Rahkonen Jukka (MML) wrote: >> Hi Jeff, >> >> I know REQUIRES has worked in a positive way (show copyright when a >> layer is on) because I have used that feature but I do not admin that >> service any more and I can't check the details. Probably I used >> version 6.x then. >> >> -Jukka Rahkonen- >> >> -----Alkuper?inen viesti----- >> L?hett?j?: MapServer-users >> Puolesta Jeff McKenna >> L?hetetty: tiistai 23. marraskuuta 2021 23.35 >> Vastaanottaja: mapserver-users at lists.osgeo.org >> Aihe: Re: [mapserver-users] How to Turn off a Layer when other >> specific Layer is ON in a map file ? >> >> To give a more detailed example of what *should* work: >> >> ??? LAYER >> ????? .. >> ????? REQUIRES "![modis] OR ![someotherlayername]" >> ??? END >> >> I'll continue my 8.0-dev testing... >> >> >> -jeff >> >> >> >> -- >> Jeff McKenna >> GatewayGeo: Developers of MS4W, MapServer Consulting and Training >> co-founder of FOSS4G http://gatewaygeo.com/ >> >> >> On 2021-11-23 5:29 p.m., Jeff McKenna wrote: >>> Hi Carlos, >>> >>> I had a great answer drafted for you, tooting my own horn on the >>> recent MapServer tutorial updates for MapServer 8.x, and the demo >>> server updates...as by chance the tutorial mentions that the >>> parameter "REQUIRES" at the LAYER level should do exactly what you need, super : >>> but sadly my tests now fail with MapServer 8.0-dev, I cannot get >>> REQUIRES to work, such as: >>> >>> ? ? LAYER >>> ? ?? .. >>> ? ?? REQUIRES "![modis]" >>> ? ? END >>> >>> ? ?where modis is another layer name. >>> >>> Since I hadn't been testing this feature, and it is only briefly >>> mentioned in the tutorial (and not part of the live demo), I have no >>> way of saying when this should have worked, for what MapServer >>> version.? It is part of the tutorial mapfiles, but the functionality >>> is not working, for my local tests. >>> >>> But your question has made me see more room for improvement in the >>> tutorial, and its mapfiles, so your question has helped. >>> >>> Sorry for my non-news, ha. >>> >>> I'll do more testing on this feature and report back. >>> >>> -jeff >>> >>> >>> >> >> _______________________________________________ >> MapServer-users mailing list >> MapServer-users at lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/mapserver-users >> > > -- Jeff McKenna GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/ _______________________________________________ MapServer-users mailing list MapServer-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users From sander.pukk at gmail.com Thu Nov 25 04:20:29 2021 From: sander.pukk at gmail.com (Sander Pukk) Date: Thu, 25 Nov 2021 14:20:29 +0200 Subject: [mapserver-users] WFS bbox/intersect etc query from custom projection to EPSG:4326 In-Reply-To: <2f4d2a250048473b943217c335324a10@maanmittauslaitos.fi> References: <2f4d2a250048473b943217c335324a10@maanmittauslaitos.fi> Message-ID: Hei! Thanks, guys! I tried all the different coordinate orders ( with the good old axis orientation in mind), but I was missing the layer PROJECTION parameter like Seth suggested. It seems it is a combination of three things here: - PROJECTION missing in LAYER - Coordinate order in the request - Wfs_srs needs to be there like it was, but the main one is only needed. 3301 in my case All in all, got it working, big thanks :) ! Cheers, Sander On Thu, Nov 25, 2021 at 11:12 AM Rahkonen Jukka (MML) < jukka.rahkonen at maanmittauslaitos.fi> wrote: > (resending to the list without the original mail, list has rather (too?) > strict size limits, 40 KB) > > > > Hi, > > > > Perhaps you fell into the infamous axis order trap. With WFS 1.1.x and 2.0 > the coordinates of EPSG:4326 most be in latitude-longiture oreder. I > modified you mapfile a bit for my test data that are in EPSG:3067, and this > request > > http://localhost:8060/cgi-bin/mapserv.exe?map=c:/ms4w_data/wfstest.map&service=WFS&version=2.0.0&request=GetFeature&TypeNames=ms:testi_virolaisille&BBOX=60.1870614692821,24.9810192523929,60.2794267964524,25.1561900521738,urn:ogc:def:crs:EPSG::4326 > > finds buildings from the database. The SQL that Mapserver generates is: > > > > [Thu Nov 25 10:23:51 2021].654000 msPostGISLayerWhichShapes query: SELECT > "fid"::text,"id"::text,"mtk_id"::text,"sijaintitarkkuus"::text,"aineistolahde"::text,"alkupvm"::text,"kohdeluokka"::text,"korkeustarkkuus"::text,"kayttotarkoitus"::text,"kerrosluku"::text,"pohjankorkeus"::text,"korkeusarvo"::text,ST_AsBinary(("geom"),'NDR') > as geom,"fid"::text FROM rakennus WHERE "geom" && > ST_GeomFromText('POLYGON((388034.000000002 > 6673671.81841385,388034.000000002 6684239.6439825,398034 > 6684239.6439825,398034 6673671.81841385,388034.000000002 > 6673671.81841385))',3067) > > > > Notice that the re-projected polygon seems to be the envelope of the > rotated bbox from the transformation and therefore it is bigger than the > polygon that would be achieved by connecting the projected corner points as > this test with gdaltranform shows. > > > > gdaltransform -s_srs epsg:4326 -t_srs epsg:3067 > > 24.9810192523929 60.1870614692821 > > 388034.000000002 6673956 0 > > 25.1561900521738 60.279426796452 > > 398033.999999999 6683955.99999996 0 > > > > I add also my mapfile, I apologize that it is just a fast modification of > some old mapfile and is not the cleanest possible. > > > > MAP > > > > CONFIG "MS_ERRORFILE" "/ms4w_data/ms_error.txt" > > EXTENT 19970 6597278 749676 7785300 > > PROJECTION > > "init=epsg:3067" > > END > > > > OUTPUTFORMAT > > NAME "OGRGML" > > DRIVER "OGR/GML" > > FORMATOPTION "STORAGE=stream" > > FORMATOPTION "LCO:COORDINATE_PRECISION=10" > > END > > > > OUTPUTFORMAT > > NAME "GeoJSON" > > DRIVER "OGR/GEOJSON" > > MIMETYPE "application/json; subtype=geojson; charset=utf-8" > > FORMATOPTION "STORAGE=stream" > > FORMATOPTION "FORM=SIMPLE" > > FORMATOPTION "LCO:COORDINATE_PRECISION=10" > > END > > > > > > > > LAYER > > NAME "testi_virolaisille" > > STATUS ON > > DEBUG 10 > > TYPE polygon > > > > PROJECTION > > "init=epsg:3067" > > END > > > > METADATA > > "ows_title" "viro_testi" > > "ows_abstract" "viro_testi" > > "wfs_getfeature_formatlist" "GeoJSON" > > # "gml_featureid" "id" > > "gml_include_items" "all" > > # "gml_types" "auto" > > "wfs_srs" "EPSG:3067 EPSG:3857 EPSG:4326" > > END > > CONNECTIONTYPE POSTGIS > > CONNECTION "host=localhost port=5432 dbname= user= password= " > > DATA "geom from rakennus using SRID=3067" > > CLASS > > STYLE > > COLOR 255 0 0 > > END > > END > > END > > WEB > > MINSCALE 10 > > MAXSCALE 1550000 > > METADATA > > "wms_title" "wfs_test" > > "wfs_onlineresource" > http://localhost:8060/cgi-bin/mapserv.exe?map=c:\ms4w_data\wfstest.map > > "wms_srs" "EPSG:4326 EPSG:900913 EPSG:3857 EPSG:31370" > > "wms_enable_request" "*" > > "wms_feature_info_mime_type" "text/html" > > "wms_format" "image/png" > > "wfs_title" "wfs_test" > > "wfs_srs" "EPSG:3067 EPSG:3857 EPSG:4326" > > "wfs_enable_request" "*" > > "wfs_precision" "10" > > #"wfs_feature_info_mime_type" "text/html" > > END > > > > END > > END > > > > -Jukka Rahkonen- > _______________________________________________ > 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: