batch wms download tiles

4 zpráv
Zpět na přehled

batch wms download tiles

4 zpráv HJT 3 účastníků 2 min čtení
  1. hanoj ehanoj na gmail.com #mf8416e
    Ahoj nemate nekdo napsany skript (treba bash, python, perl) pro stahovani vetsich oblasti pomoci WMS? Napr ten co byl u UHUL lesu. diky hanoj
  2. Jachym Cepicky jachym.cepicky na gmail.com #m864a3c
    http://tilecache.org by nepomohlo? j 2008/9/22 hanoj <ehanoj na gmail.com>:
  3. Tomas Kolda kolda na web2net.cz #md58a34
    Tady je skript se kterym jsem downloadnul UHUL lesy. T Jachym Cepicky writes:
    http://tilecache.org by nepomohlo? j 2008/9/22 hanoj <ehanoj na gmail.com>:
    Ahoj nemate nekdo napsany skript (treba bash, python, perl) pro stahovani vetsich oblasti pomoci WMS? Napr ten co byl u UHUL lesu. diky hanoj
    import urllib, os.path from PIL import Image crRect = (12, 51.1, 19, 48.5) def getMapSize(): return (1 + int((crRect[2] - crRect[0]) / 0.1), 1 + int((crRect[1] - crRect[3]) / 0.1)) def tile2wgs(x, y): return (crRect[0] + x * 0.1, crRect[1] - y * 0.1, crRect[0] + (x + 1) * 0.1, crRect[1] - (y + 1) * 0.1) def getFilename(x, y): return os.path.join("cache", "%03dx%03d.png" % (x, y)) def cacheImage(x, y): filename = getFilename(x, y) if os.path.isfile(filename): return rect = tile2wgs(x, y) print "Downloading ", x, y url = "http://geoportal2.uhul.cz/cgi-bin/oprl.asp?SERVICE=WMS&VERSION=1.1.1&" + \ "REQUEST=GetMap&SRS=EPSG:4326&LAYERS=Les_OPRL&STYLES=default&FORMAT=image/png&" + \ "TRANSPARENT=TRUE&BBOX=%.1f,%.1f,%.1f,%.1f&WIDTH=2000&HEIGHT=2000" % \ (rect[0], rect[3], rect[2], rect[1]) data = urllib.urlopen(url).read() f = open(filename, "wb") f.write(data) f.close() def main(): (w, h) = getMapSize() for x in range(w): for y in range(8, h): cacheImage(x, y) if __name__ == '__main__': main()
  4. hanoj ehanoj na gmail.com #m70c32d
    O, dekuji, * o tilecache jsem vedel, ale nemohl prijit na jmeno * ten pythonovsky skript se mi zda pekne jednoduchy, tak bych si ho s dovolenim naklonoval k potrebe vlastni. ha hanoj 2008/9/22 Tomas Kolda <kolda na web2net.cz>:
Napsat odpověď e-mailem… Odpovědět

Otevře váš e-mailový klient. Odpovědi pak sledujte zde na webu.