[Users] geoext Printprovider bad request

Ralph Dell RDell at CatawbaCountyNC.gov
Fri Aug 26 16:15:26 CEST 2011


Unfortunately I am still unable to  print my layers from geowebcache. Here is some code snippets and a link to a demo page.

 Any more pointers will be appreciated.  The pdf will not contain my gwc layers, otherwise all is well.

 

My gwc layer

 

baseLayer = new OpenLayers.Layer.WMS(

'gwc', 'http://gis.catawbacountync.gov/geoserver/gwc/service/wms', {

layers: ['catawba:nc_cities2'],

transparent:'true',

format: 'image/png',

tiled:true

   },{

isBaseLayer: true,

buffer: 1,

tileSize: new OpenLayers.Size(256,256),

//tileOrigin: (-20037508, -20037508),

visibility: true,

displayInLayerSwitcher: false

});

 

My print provider and print page

printProvider = new GeoExt.data.PrintProvider({

method: "POST",

url: 'http://gis.catawbacountync.gov/geoserver/pdf',

autoLoad: true,

listeners: {

 "loadcapabilities": function () {

printProvider.setLayout(printProvider.layouts.getAt(0));

    },

"printexception": function(printProvider,response) {

      alert("An error has occurred: " + response.statusText);

    }}

});

 

printPage = new GeoExt.data.PrintPage({

printProvider: printProvider,

customParams: {

mapTitle: "gwc print",

comment: ""

}});

 

My print tool

 

action = new Ext.Action({

text: "Print",

scale: 'medium',

tooltip: "Print map - PDF",

handler: function() {

printPage.setCenter(map.getCenter());

printPage.fit(map, {mode: "closest"});

printProvider.print(mapPanel, printPage);

},…

 

Link to a demo

 

http://www.gis.catawba.nc.us/gwc/print_gwc.html

 

Ralph Dell

 

From: Matt Priour [mailto:mpriour at kestrelcomputer.com] 
Sent: Wednesday, August 24, 2011 4:19 PM
To: Ralph Dell; users at geoext.org
Subject: Re: [Users] geoext Printprovider bad request

 

You can use gwc’s wms, just not as a single tile layer:

tileSize: new OpenLayers.Size(256,256)

is a _required_ config property of the layer(s) you are trying to print.

 

Your other option is to use an XYZ layer type with your gwc layers.

 

Matt Priour
Kestrel Computer Consulting

 

From: Ralph Dell <mailto:RDell at CatawbaCountyNC.gov>  

Sent: Wednesday, August 24, 2011 2:22 PM

To: users at geoext.org 

Subject: [Users] geoext Printprovider bad request

 

I did not know if this list or the geoserver list would be a better forum for this question. I decided to start here.

 

After adding layers to my map from geowebcache and generating a pdf with the Printprovider  the gwc layers were not showing up in the generated pdf.

My straight up wms layes etc, were printing fine as usual.

 

In my geoserver logs I found the following information that indicated a bad request. 

 

2011-08-24 13:27:21,287 WARN [org.mapfish.print.PDFUtils] - 

Server returned an error for http://gis.catawbacountync.gov/geoserver/gwc/service/wms?

BBOX=-9079690.0%2C4218281.5%2C-9006310.0%2C4294718.5&HEIGHT=694&WIDTH=667&TRANSPARENT=true&

map_resolution=100&VERSION=1.1.1&FORMAT=image%2Fpng&TILED=true&SERVICE=WMS&format_options=dpi%3A100&

LAYERS=ncgroup&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913:

Error (status=400) while reading the image from http://gis.catawbacountync.gov/geoserver/gwc/service/wms?

BBOX=-9079690.0%2C4218281.5%2C-9006310.0%2C4294718.5&HEIGHT=694&WIDTH=667&TRANSPARENT=true&

map_resolution=100&VERSION=1.1.1&FORMAT=image%2Fpng&TILED=true&SERVICE=WMS&format_options=dpi%3A100&

LAYERS=ncgroup&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913: Bad Request

 

2011-08-24 13:27:21,287 WARN [org.mapfish.print.PDFCustomBlocks] - 

Error while adding a PDF elementjava.io.IOException: 

Error (status=400) while reading the image from http://gis.catawbacountync.gov/geoserver/gwc/service/wms?

BBOX=-9079690.0%2C4218281.5%2C-9006310.0%2C4294718.5&HEIGHT=694&WIDTH=667&TRANSPARENT=true&

map_resolution=100&VERSION=1.1.1&FORMAT=image%2Fpng&TILED=true&SERVICE=WMS&format_options=dpi%3A100&

LAYERS=ncgroup&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913: Bad Request

 

I did not know why it was a bad request but I was suspicious of the HEIGHT and WIDTH

 

Pasting the url into my browser confirmed that by returning the error

400: The requested tile dimensions 694x667 do not match those of the grid set (256x256)

http://gis.catawbacountync.gov/geoserver/gwc/service/wms?BBOX=-9079690.0%2C4218281.5%2C-9006310.0%2C4294718.5&HEIGHT=694&WIDTH=667&TRANSPARENT=true&map_resolution=100&VERSION=1.1.1&FORMAT=image%2Fpng&TILED=true&SERVICE=WMS&format_options=dpi%3A100&LAYERS=ncgroup&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913

 

 

OK great. What can I do to resolve the issue? Can I use my gwc layers with the printProvider? Do I have deeper issues?

 

Ralph Dell

 

________________________________

_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110826/74de03fe/attachment-0001.htm 


More information about the Users mailing list