[MapServer-users] WMS GetCapabilities map minx, miny etc transposed

Jody Klymak jklymak at gmail.com
Sun Nov 27 13:10:20 PST 2022


Hi,

I am a new user, using mapserver 8.0.0:

I have been going through the tutorials and have trouble making rasters work on my WMS server.  The same map file works fine in QGIS, so I think there is a bug in mapserver, but wanted to write here in case I am doing anything silly.

If I query the server I get layers that have minx miny in the BoundingBox that are transposed with respect to lat and lon:

```
<Layer queryable="0" opaque="0" cascaded="0">
<Name>modis</Name>
<Title>modis</Title>
<CRS>EPSG:4326</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>-97.238976</westBoundLongitude>
<eastBoundLongitude>-82.122902</eastBoundLongitude>
<southBoundLatitude>41.619778</southBoundLatitude>
<northBoundLatitude>49.385620</northBoundLatitude>
</EX_GeographicBoundingBox>

<BoundingBox CRS="EPSG:4326" minx="41.619778" miny="-97.238976" maxx="49.385620" maxy="-82.122902"/>

<MetadataURL type="TC211">
<Format>text/xml</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="https://cproof.uvic.ca/cgi-bin/mapserv?map=/usr/local/opt/mapserver/cproof/mapserver_raster.map&request=GetMetadata&layer=modis"/>
</MetadataURL>
</Layer>
```

If I query the wms server with 

`https://cproof.uvic.ca/cgi-bin/mapserv?map=/usr/local/opt/mapserver/cproof/mapserver_raster.map&SERVICE=WMS&VERSION=1.3&REQUEST=Map&Layers=modis&CRS=EPSG:4326&BBOX=-97.238976,41.619778,-82.122902,49.385620&FORMAT=png&WIDTH=360&HEIGHT=270`

I get a blank image

If I swap lat for lon in the BBOX=41.619778,-97.238976,49.385620,-82.122902, then it works, but is of course distorted. 

Maybe I’m really mis-understanding the BBOX parameter, but it seems that there is a bug where someone has said x is equivalent to latitude, where they meant longitude. 

Again, this map works fine in QGIS, I assume because it doesn’t look at the BoundingBox and just uses the <westBoundLatitude> etc. 

The map file is 

```
MAP
  NAME "MAPSERVER_RASTER"
  IMAGETYPE      PNG24
  EXTENT        -97.238976 41.619778 -82.122902 49.385620
  SIZE           360 270
  SHAPEPATH      "./data/"
  IMAGECOLOR     200 200 200

  PROJECTION
    "init=epsg:4326"
  END

  WEB
    METADATA
      ows_title "MapServer Raster"
      ows_enable_request "*"
      ows_srs "EPSG:4326"
      ows_onlineresource  "https://cproof.uvic.ca/cgi-bin/mapserv?map=/usr/local/opt/mapserver/cproof/mapserver_raster.map"
    END
  END
  LAYER # MODIS raster layer begins here
    NAME         "modis"
    DATA         "ugl_ref2.png"
    STATUS       DEFAULT
    TYPE         RASTER
    EXTENT        -97.238976 41.619778 -82.122902 49.385620
    OFFSITE      71 74 65
    PROJECTION
      "init=epsg:4326"
    END
  END # MODIS raster layer ends here
END
```

Thanks,   Jody



More information about the MapServer-users mailing list