Quantcast

"Bad Request" messages

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

"Bad Request" messages

Martin, Will
All,

I've had an OpenLayers application running smoothly for a couple of years now, but the maps stopped loading right.  I get pink tiles which have messages attached like:

400: Requested horizontal resolution: 0.0439453125 , best match: 0.03333333333333333 exceeds 10% threshold. Perhaps the client is configured with an incorrect set of scales (resolutions), or the DPI setting is off compared to the one in GWC ?

Or:

400: X,Y values for the tile index were calculated to be {8984.413146972656, -1441.95556640625} which had to be rounded to {8984, -1442} and exceeds the threshold of 10%. Perhaps the client is using the wrong origin ?

I don't understand either error message.  Here are live examples:

    http://bygdebok.library.und.edu/

    http://library.und.edu/special-collections/bygdebok/place/16

But sometimes it works fine, as for example in this page:

    http://library.und.edu/special-collections/bygdebok/place/221

The simplest test case I can put together is here:

    http://www.libsys.und.edu/dev/p/bygdebok/test.php

It looks like the error is coming from something on the map server, which is run by the Statens Kartverk (Norwegian Mapping Authority).  I don't have any control over that.  Is there something I can do to my JavaScript to make it work again?

Thanks.

Will Martin

Web Services Librarian
Chester Fritz Library
University of North Dakota


_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
web
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Bad Request" messages

web

Hi Martin,

Well, in the example you show you are accessing a tiled service with a WMS. As you know a tiled service has a set a of fixed scales. The tile service is trying to give back tiles based on your WMS request, at a defined resolution. So I interpret the error message you receive like this, "I can't give you back tiles based on the requested resolution (extend), even with a 10% tolerance". So that's it, you have to call the right resolutions (based on the map options). Cool, but how to find out  correct resolutions?


I guess the best way would be to call a GetCapabilites on the tile service itself (WMTS). But since you maybe don't know the access point and/or the access point itself may not be public it may not work. If you know the WMTS behind this service, call a GetCapabilities on it, and fill in the resolutions on OpenLayers.

The other way  (the ninja one), would be to issue WMS requests and use the error message to find out one correct resolution. (0.000008333) in your example. Then you fill it in (look example below) your OpenLayer's code under the map resolution option. Modify the bbox, get other error messages with other correct resolutions, etc, etc.


I've played a bit around and achieved some correct resolutions:

//Change in your code like this:
map = new OpenLayers.Map("map", {
                controls: [],
     !            projection: new OpenLayers.Projection('EPSG:4326'),
                resolutions: [
                              0.0833333,
                              0.0333333,
                              0.0166666,
                              0.00833333,!
                              0.0041666666,
                              0.001388888,
                              0.0008333333333333333,
                              0.00027777777777777776,
                              0.000138888888 8888889,
         &n! bsp;                    0.000027777777777777776,
                              0.000008333333333333332
                             ]
        });


//And also a valid center:
map.setCenter(new OpenLayers.LonLat(11.21, 64.21));


You will have some valid zoom with this config.

Hope it helps a lot.
Regards


_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Bad Request" messages

Martin, Will
Thanks for taking the time to answer my message!

I can run a GetCapabilities on the server here:

http://opencache.statkart.no/gatekeeper/gk/gk.open?&SERVICE=WMS&REQUEST=GetCapabilities

It looks like the relevant bit is this:

    <Layer>
      <Name>topo2</Name>
      <Title>topo2</Title>
      <SRS>EPSG:4326</SRS>
      <SRS>EPSG:3035</SRS>
      <SRS>EPSG:900913</SRS>
      <SRS>EPSG:32635</SRS>
      <SRS>EPSG:32633</SRS>
      <SRS>EPSG:32632</SRS>
      <LatLonBoundingBox minx="-180.0" miny="-422.0" maxx="332.0" maxy="90.0"/>
      <BoundingBox SRS="EPSG:4326" minx="-180.0" miny="-422.0" maxx="332.0" maxy="90.0"/>
      <BoundingBox SRS="EPSG:3035" minx="2426378.0132" miny="-2288679.69439904" maxx="6293974.62149952" maxy="5446513.5222"/>
      <BoundingBox SRS="EPSG:900913" minx="-2.003750834E7" miny="-2.0037508345578495E7" maxx="2.0037508345578495E7" maxy="2.003750834E7"/>
      <BoundingBox SRS="EPSG:32635" minx="-3500000.0" miny="3500000.0" maxx="2045984.0" maxy="9045984.0"/>
      <BoundingBox SRS="EPSG:32633" minx="-2500000.0" miny="3500000.0" maxx="3045984.0" maxy="9045984.0"/>
      <BoundingBox SRS="EPSG:32632" minx="-2000000.0" miny="3500000.0" maxx="3545984.0" maxy="9045984.0"/>
    </Layer>

I'm not entirely sure which of these values need to be plugged into the resolutions property in order to make it work right.  Is it the ones in the LatLonBoundingBox, or in the BoundingBox for the EPSG:4326 projection?  Do I also need to specify a maxExtent?

I wish I knew why this happened all of a sudden.  It worked fine for years, and then just stopped.  Sigh.

Thanks again!

Will Martin

Web Services Librarian
Chester Fritz Library
University of North Dakota


P.S.  "Martin" is my family name -- I go by "Will".
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
web
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Bad Request" messages

web

Unfortunately this service is a WMS and will not show any resolutions.

I've seen the layer you were using is also accessible on this web site:

http://www.norgeskart.no/adaptive2/default.aspx?gui=1&lang=2

May you could use some configuration used there?

Regards


_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Bad Request" messages

Martin, Will
In reply to this post by web
I've kept working at it, and the resolutions you've specified below work, but only partially.

I've updated my test case, here:

    http://www.libsys.und.edu/dev/p/bygdebok/test.php

The initial screen loads okay, but it behaves erratically as you zoom in.  Some zoom levels always work, some levels always fail, and some work only partially:

zoom level 0 = okay
zoom level 1 = okay
zoom level 2 = okay
zoom level 3 = okay
zoom level 4 = BAD
zoom level 5 = okay
zoom level 6 = BAD
zoom level 7 = okay
zoom level 8 = PARTIAL
zoom level 9 = PARTIAL
zoom level 10 = okay

The "partial" levels show up as a mixture of correct map tiles and pink ones.

The pink tiles on the BAD and PARTIAL levels give error messages like these:

    400: X,Y values for the tile index were calculated to be {181.999997088,
    -24.750002304000002} which had to be rounded to {182, -25} and exceeds
    the threshold of 10%. Perhaps the client is using the wrong origin ?

That's from this tile:

    http://tinyurl.com/pink-tile-1

Thanks for the help.  I appreciate it.  At the same time, I wish I didn't have to ask.  I mean, this site worked just fine for years without messing around with resolutions or anything.  I don't know why it suddenly got so finicky.

Will


-----Original Message-----
From: web [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 3:51 PM
To: Martin, Will; [hidden email]
Subject: Re: [OpenLayers-Users] "Bad Request" messages

Hi Martin,

Well, in the example you show you are accessing a tiled service with a WMS. As you know a tiled service has a set a of fixed scales. The tile service is trying to give back tiles based on your WMS request, at a defined resolution. So I interpret the error message you receive like this, "I can't give you back tiles based on the requested resolution (extend), even with a 10% tolerance". So that's it, you have to call the right resolutions (based on the map options). Cool, but how to find out  correct resolutions?


I guess the best way would be to call a GetCapabilites on the tile service itself (WMTS). But since you maybe don't know the access point and/or the access point itself may not be public it may not work. If you know the WMTS behind this service, call a GetCapabilities on it, and fill in the resolutions on OpenLayers.

The other way  (the ninja one), would be to issue WMS requests and use the error message to find out one correct resolution. (0.000008333) in your example. Then you fill it in (look example below) your OpenLayer's code under the map resolution option. Modify the bbox, get other error messages with other correct resolutions, etc, etc.


I've played a bit around and achieved some correct resolutions:

//Change in your code like this:
map = new OpenLayers.Map("map", {
                controls: [],
     !            projection: new OpenLayers.Projection('EPSG:4326'),
                resolutions: [
                              0.0833333,
                              0.0333333,
                              0.0166666,
                              0.00833333,!
                              0.0041666666,
                              0.001388888,
                              0.0008333333333333333,
                              0.00027777777777777776,
                              0.0001388888888888889,
         &n! bsp;                    0.000027777777777777776,
                              0.000008333333333333332
                             ]
        });


//And also a valid center:
map.setCenter(new OpenLayers.LonLat(11.21, 64.21));


You will have some valid zoom with this config.

Hope it helps a lot.
Regards

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Bad Request" messages

Andreas Hocevar-2
In reply to this post by web
The service is WMS-C and also provides resolutions in the
GetCapabilities response when requested with &tiled=true:

http://opencache.statkart.no/gatekeeper/gk/gk.open?&SERVICE=WMS&REQUEST=GetCapabilities&tiled=true

Sorry if this answer isn't appropriate - I didn't read the whole
thread, but it seemed that this piece of information might help.

Andreas.

On Wed, Sep 12, 2012 at 11:55 PM, web <[hidden email]> wrote:

> Unfortunately this service is a WMS and will not show any resolutions.
>
> I've seen the layer you were using is also accessible on this web site:
>
> http://www.norgeskart.no/adaptive2/default.aspx?gui=1&lang=2
>
> May you could use some configuration used there?
>
> Regards
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Bad Request" messages

Martin, Will
Thanks, Andreas -- that is useful to know, though it doesn't solve the problem (which has morphed a bit, but the gist is that I'm still getting pink tiles at some zoom levels).

Will Martin

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Andreas Hocevar
Sent: Thursday, September 13, 2012 2:48 PM
To: web
Cc: Martin, Will; [hidden email]
Subject: Re: [OpenLayers-Users] "Bad Request" messages

The service is WMS-C and also provides resolutions in the GetCapabilities response when requested with &tiled=true:

http://opencache.statkart.no/gatekeeper/gk/gk.open?&SERVICE=WMS&REQUEST=GetCapabilities&tiled=true

Sorry if this answer isn't appropriate - I didn't read the whole thread, but it seemed that this piece of information might help.

Andreas.

On Wed, Sep 12, 2012 at 11:55 PM, web <[hidden email]> wrote:

> Unfortunately this service is a WMS and will not show any resolutions.
>
> I've seen the layer you were using is also accessible on this web site:
>
> http://www.norgeskart.no/adaptive2/default.aspx?gui=1&lang=2
>
> May you could use some configuration used there?
>
> Regards
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Loading...