Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could use <a href="http://www.python.org/" rel="nofollow noreferrer">Python</a> with <a href="http://www.pythonware.com/products/pil/" rel="nofollow noreferrer">Python Imaging Library (PIL)</a>.</p> <p>First I'd make a list of filename and their coordinates. Extract the integer coordinates from the filenames with regular expressions and store them in a list of dictionaries:</p> <pre><code>&gt;&gt;&gt; filename = 'x=92664y=48131zoom=17.png' &gt;&gt;&gt; imagePattern = re.compile(r'^x=(\d{5})y=(\d{5})zoom=17.png$') &gt;&gt;&gt; x,y = map(int, imagePattern.search(filename).groups()) &gt;&gt;&gt; {'x':x, 'y':y, 'filename':filename} {'y': 48131, 'x': 92664, 'filename': 'x=92664y=48131zoom=17.png'} </code></pre> <p>Having a list of dictionaries enables you to sort them according to either dimensions:</p> <pre><code>tileListSortedByX = sorted(tileList, key = lambda i: i["x"]) </code></pre> <p>and also filter them:</p> <pre><code>fileListWhereX48131 = [tile for tile in tileList if tile["x"]==48131] </code></pre> <p>With these two operations you can easily imagine the <em>for</em> loops to iterate over tiles line by line.</p> <p>The last thing you need to create a big empty image (with PIL) where you'll paste the small tile images into. Its size will be a multiple of the tile size.</p> <pre><code>&gt;&gt;&gt; from PIL import Image &gt;&gt;&gt; bigImage = Image.new('RGB',(300,300),(255,255,255)) #creates a white 300x300 image </code></pre> <p>Pasting the small images into the big one looks like this:</p> <pre><code>&gt;&gt;&gt; smallImage = Image.open(tile["filename"]) &gt;&gt;&gt; bigImage.paste(smallImage,(0,0)) </code></pre> <p>Hope you get the idea.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload