[mapserver-users] GetFetureInfo with rotated grid

Rousseau Lambert,Louis-Philippe (ECCC) Louis-Philippe.RousseauLambert at ec.gc.ca
Fri Jul 9 11:18:51 PDT 2021


Hi Jeff, 

Thanks for your comment, I updated my test mapfile with STATUS ON and added a better style so we can really see the different values in the file.

I confirm that using the shp2img (shp2img -m test.map -o ttt.png -map_debug 3) command I do get a valid image. 

Here is a link to the image: https://ibb.co/QX7Lnb2 and to the updated mapfile: https://pastebin.com/Xh12y7tN

The GRIB2 data covers only North America, which is normal for this dataset.

Here are the debug lines when I run shp2img:

"""
$ shp2img -m test.map -o ttt.png -map_debug 3
msDrawMap(): rendering using outputformat named png (AGG/PNG).
msDrawMap(): WMS/WFS set-up and query, 0.000s
msDrawRasterLayerLow(TEST): entering.
msResampleGDALToMap in effect: cellsize = 0.090000
msDrawGDAL(TEST): using RAW_WINDOW=0 0 729 599, dst=0,0,729,599
msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,0,0,0
msDrawRasterGDAL_16BitClassification(TEST):
  scaling to 65536 buckets from range=4.58045e-08,1.67861e-06.
msDrawRasterGDAL_16BitClassification() bucket creation time: 0.067s
msNearestRasterResampler: 25000 failed to transform, 11511 actually set.
msDrawMap(): Layer 0 (TEST), 0.177s
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 0.178s
msSaveImage(ttt.png) total time: 0.004s
freeLayer(): freeing layer at 0x55b6b7a27380.
"""

Thanks

LP

-- 
Louis-Philippe Rousseau Lambert, B.Sc.
Spécialiste en géomatique / Geomatics Specialist
Systèmes de données géospatiales et ouvertes
Geospatial and Open Data Systems
Service Météorologique du Canada
Meteorological Service of Canada
Environnement et Changement Climatique Canada
Environment and Climate Change Canada
louis-philippe.rousseaulambert at ec.gc.ca
(450) 775-9714

-----Original Message-----
From: mapserver-users <mapserver-users-bounces at lists.osgeo.org> On Behalf Of Jeff McKenna
Sent: 9 juillet 2021 13:15
To: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] GetFetureInfo with rotated grid

Hi LP,

Can you also confirm through a shp2img command, that you generate a valid map image, in your output EPSG:4326 projection, such as:

   shp2img -m test.map -o ttt.png -map_debug 3

(also, please add "STATUS ON" to your layer)

I would always start with a shp2img command, make sure that MapServer (and GDAL+PROJ in this case) can access your data, reproject it, and return a nice valid image.  Then, after that works, move onto the fun of WMS and OGC service testing.


-jeff



--
Jeff McKenna
GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of FOSS4G http://gatewaygeo.com/



On 2021-07-09 12:13 p.m., Rousseau Lambert,Louis-Philippe (ECCC) wrote:
> Hi all,
> 
> I have an issue with WMS GetFeatureInfo request on a rotated GRIB2 file. 
> When I try to do a GetFeatureInfo request on a valid location on my map, 
> I get: "Search returned no results". I tried the GetFeatureInfo request, 
> using mapscript and the mapserv command, both give me the "Search 
> returned no results".
> 
> The file projection is "+proj=ob_tran +o_proj=longlat +o_lon_p=0 
> +o_lat_p=31.758312 +lon_0=-92.402969 +R=6371229 +no_defs"
> 
> I'm using MapServer version 7.6.2, GDAL 3.1.3 (released 2020/09/01) and 
> proj 7.2.0.
> 
> But If I try to get the value with gdallocationinfo using the -wsg84 
> flag, I get a valid result, so I guess this issue is not with gdal ?:
> 
> ```
> 
> gdallocationinfo -wgs84 rotated.grib2 -75 45
> 
> Report:
> 
>    Location: (578P,373L)
> 
>    Band 1:
> 
>      Value: 3.1022446478346e-07
> 
> ```
> 
> I can get a GetFeatureInfo request to work, but I have to define a 
> custom EPSG code (for example: EPSG:102987), add this EPSG code (102987) 
> to my epsg file and reference it in my mapfile. This way, the 
> GetFeatureInfo only works if requested in this custom EPSG using the 
> rotated grid BBOX, if I do the request in another CRS, it still return 
> no results:
> 
> ```
> 
> mapserv -nh "QUERY_STRING=map= 
> test.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=0,0,1,1&CRS=EPSG:102987&WIDTH=1000&HEIGHT=1000&LAYERS=TEST&INFO_FORMAT=text/plain&QUERY_LAYERS=TEST&I=5&J=5&FORMAT=image/png"
> 
> ```
> 
> Here is a GetFeatureInfo request that returns no results using EPSG:4326:
> 
> ```
> 
> mapserv -nh 
> "QUERY_STRING=map=test.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=45,-74,46,-73&CRS=EPSG:4326&WIDTH=1000&HEIGHT=1000&LAYERS=TEST&INFO_FORMAT=text/plain&QUERY_LAYERS=TEST&I=5&J=5"
> 
> ```
> 
> I have included a small mapfile that shows the previous behavior, you 
> can use this curl command to download a sample GRIB2 data:
> 
> ```
> 
> curl -o rotated.grib2 
> 'https://dd.weather.gc.ca/model_raqdps/10km/grib2/00/013/20210709T00Z_MSC_RAQDPS_PM2.5_EATM_RLatLon0.09x0.09_P013.grib2'
> 
> ```
> 
> Do you have any ideas if I'm doing something wrong or if the issue is in 
> MapServer ?
> 
> Thanks
> 
> LP
> 
> 
> _______________________________________________
> 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



More information about the MapServer-users mailing list