[Mapproxy-java] SF.net SVN: mapproxy:[32] tms
Brought to you by:
pborissow
From: <pbo...@us...> - 2011-05-16 14:25:52
|
Revision: 32 http://mapproxy.svn.sourceforge.net/mapproxy/?rev=32&view=rev Author: pborissow Date: 2011-05-16 14:25:43 +0000 (Mon, 16 May 2011) Log Message: ----------- Fixed bug in the ServiceResponse getTile() method for non-cached tile sources Modified Paths: -------------- core/ServiceResponse.java kml/server/KMLServer.java tms/TileServer.java Modified: core/ServiceResponse.java =================================================================== --- core/ServiceResponse.java 2011-05-16 11:59:14 UTC (rev 31) +++ core/ServiceResponse.java 2011-05-16 14:25:43 UTC (rev 32) @@ -312,7 +312,7 @@ //Set local variables String url = this.url.toString(); - +//System.out.println(url); //Check whether this request is in the http cache mapproxy.tms.TileRequest req = new mapproxy.tms.TileRequest(url); key = req.id(); @@ -335,9 +335,8 @@ if (fileCache==null){ TileGrid grid = new TileGrid(4326, new int[]{256,256}); //<--Maybe there's a way to encode these parameters in the URL? Need to check the TMS spec... - double[] bbox = grid.tile_bbox(req.tile[0], req.tile[1], req.tile[2]); + double[] bbox = grid.tile_bbox(req.tile[0], req.tile[1], req.tile[2]+1); //<--Note the the z value is incremented by 1 rsp = layer.getImage(grid.tile_size[0], grid.tile_size[1], format, bbox, grid.srs.toString()).getByteArray(format); - //rsp = getImage(layer, grid.tile_size[0], grid.tile_size[1], format, bbox, grid.srs.toString()).getByteArray(format); } else{ @@ -367,7 +366,6 @@ //Create image and update cache double[] bbox = grid.tile_bbox(req.tile[0], req.tile[1], req.tile[2]); rsp = layer.getImage(grid.tile_size[0], grid.tile_size[1], fileCache.file_ext, bbox, grid.srs.toString()).getByteArray(format); - //rsp = getImage(layer, grid.tile_size[0], grid.tile_size[1], fileCache.file_ext, bbox, grid.srs.toString()).getByteArray(format); } } Modified: kml/server/KMLServer.java =================================================================== --- kml/server/KMLServer.java 2011-05-16 11:59:14 UTC (rev 31) +++ kml/server/KMLServer.java 2011-05-16 14:25:43 UTC (rev 32) @@ -101,8 +101,8 @@ int[] tile_coord = request.tile; - tile_coord[2] = tile_coord[2]+1; //<-- This wasn't in the original mapproxy code. - //Note that this tile_coord and the subtile coord is later updated in the kml + tile_coord[2] = tile_coord[2]+1; //<-- Note the the z value is incremented by 1 + //The z value for the tile_coord and the subtile coord is then updated in the kml TileGrid grid = (TileGrid) layer.getParam("grid"); Modified: tms/TileServer.java =================================================================== --- tms/TileServer.java 2011-05-16 11:59:14 UTC (rev 31) +++ tms/TileServer.java 2011-05-16 14:25:43 UTC (rev 32) @@ -80,6 +80,8 @@ TileGrid grid = (TileGrid) layer.getParam("grid"); if (grid!=null){ grid = new TileGrid(4326, new double[]{-180,-90,180,90}, new int[]{256,256}, null, true, 21); + //SRS srs = new SRS(layer.getSRS()[0]); + //grid = new TileGrid(srs.get_epsg_num(srs), layer.getBBox().toArray(), new int[]{256,256}, null, srs.isGeographic(), 21); } int[] tileSize = grid.tile_size; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |