Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Given a WMS service, is there a ready-made script that, for a given extent, creates a tile-pyramid that is compliant with:

http://leaflet.cloudmade.com/reference.html#tilelayer

That is urls on the form:

'http://{s}.somedomain.com/blabla/{z}/{x}/{y}.png'

EDIT: I think what I want is MapProxy. I can configure a TMS layer that caches my WMS service, and copy the files that it generates.

share|improve this question
    
You might want to upvote emacgillavry. Or accept it if it solves your problem. –  R.K. Feb 25 '12 at 15:36

2 Answers 2

MapProxy is certainly a good option. If it is just a script you require, TileCache is another option. It's not as configurable as MapProxy, but it is a nice, light-weight solution. If you are already serving your WMS using GeoServer, then I'd recommend GeoWebCache.

share|improve this answer

with openlayers you can get your wms xyz result as below code. i think with some changes this code will work for you.

leaflet_wms.getURL(Bounds)


function getURL (bounds) {
   var res = this.map.getResolution();
   var x = Math.round ((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
   var y = Math.round ((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));
   var z = this.map.getZoom();

   var path = z + "/" + x + "/" + y + "." + this.type;
   var url = this.url;
    if (url instanceof Array) {
       url = this.selectUrl(path, url);
   }
   return url + path;
}
share|improve this answer
    
I was looking for a script that generates the tiles. Not quite sure what the idea with the javascript you posted is? –  Pimin Konstantin Kefaloukos Feb 24 '12 at 23:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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