1

We could see the below error from GeoServer when zooming out the map, because the bbox sending request more than the MONGO DB accepted range(-180,-90,180,90).

"Query failed with error code 2 and error message 'longitude/latitude is out of bounds"

But our data is within the range, do we need to do any configuration or any workaround.

The below URL is not working:

http://localhost/geoserver/mongoworkspace/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng8&TRANSPARENT=true&LAYERS=mongoworkspace%3Asample11&exceptions=application%2Fvnd.ogc.se_inimage&TILED=false&CRS=EPSG%3A4326&STYLES=&WIDTH=1454&HEIGHT=728&BBOX=-127.96875%2C-255.5859375%2C127.96875%2C255.5859375

The below URL is working:

http://localhost/geoserver/mongoworkspace/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng8&TRANSPARENT=true&LAYERS=mongoworkspace%3Asample11&exceptions=application%2Fvnd.ogc.se_inimage&TILED=false&CRS=EPSG%3A4326&STYLES=&WIDTH=1454&HEIGHT=728&BBOX=-63.984375%2C-127.79296875%2C63.984375%2C127.79296875

  • what is the exact request you are making? the version of the WFS affects the axis order of 4326 – Ian Turton Sep 19 at 6:41
  • Have updated both the working and not working request in the question. – user3474541 Sep 19 at 6:48
  • So the error actually comes from mongodb? If so, the code of the mongodb store should be modified to clip the bounds accordingly. Most data sources don't care actually, so there is no general clipping functionality that applies to all. – Andrea Aime Sep 19 at 9:37
  • Yes. Actually, correct place to handle this at MongoDB. Seems the issue is not yet fixed by GeoTools checking for any alternative in openlayers . Basically, we need to clip the coordinates if any one is going out the limits. Is there anyway to get the control of BBox so that we can update these if it is not falling in the range? – user3474541 Sep 19 at 10:00
  • Well the BBOX extent is definitely wrong in the non-working example. EPSG:4326 is lat long, so 1st and 3rd values should be between +/- 90, and 2nd and 4th value between +/- 180, but the BBOX requested (by OpenLayers?) is BBOX=-127.96875,-255.5859375,127.96875,255.5859375 – nmtoken Nov 7 at 19:05
2

Try specifying extent in the OpenLayers layer settings (it needs to be in view projection units regardless of the projection the WMS is using)

new ol.layer.Image({
  source: new ol.source.ImageWMS({
    ...
  }),
  extent: [-180, -90, 180, 90]
})
  • Have tried below but no luck ` this.wmsLayer = new Image({` source: new ol.source.ImageWMS({ url: 'localhost/geoserver/mongoworkspace/wms', params: { 'LAYERS': 'mongoworkspace:sample11', 'FORMAT': 'image/png8', 'TILED': false }, serverType: 'geoserver', visible: true }), extent: [-180, -90, 180, 90] }); – user3474541 Sep 19 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.