GIS2BIM Image from Tile combine

Hello everyone,
After I have retrieved the pictures (tile) from the Internet, I now try to combine the photos. It works well when the photos are in a row. But if the photos are in several rows, the Python script still puts all the photos in a row.

Could you please help me edit python script to put the photos in the right place

The aim is to get a combined photo.
I am very grateful for your help


Uploading: Test Tile Image combine…dyn…
Test Tile Image combine…dyn (201.9 KB)

Hello omar,

I don’t know if you got it all ready, but I’m using this script for a similar purpose.
To combine Image tiles you only need the bottom left corner, see below:

import sys

sys.path.append("C:\Program Files (x86)\IronPython 2.7\Lib")
from math import *
import itertools
from itertools import islice

import clr

clr.AddReference("System.Drawing")
from System.Drawing import Image
from System.Drawing import Bitmap
from System.Drawing import Graphics
from System.Drawing.Imaging import ImageFormat
from System.IO import Path
from os import listdir

# The inputs to this node will be stored as a list in the IN variables.
bitmaps=IN[0]
x=IN[1]
y=IN[2]
pixels=IN[3]
TMS_WMTS=IN[4]

xcount=len(x)
xfirst_half=x[:(xcount//2)]

ycount=len(y)
yfirst_half=y[:(ycount//2)]

TotalWidth= xcount*pixels
TotalHeight= ycount*pixels

# create image object for the new image
img = Bitmap(TotalWidth,TotalHeight)
g= Graphics.FromImage(img)

LPx=[]
n=0
for i in xfirst_half:
	LPx.append(n*pixels)
	n=n+1

LPy=[]
n=0
for i in yfirst_half:
	LPy.append(n*pixels)
	n=n+1

LPx2=[]
n=len(LPy)
for i in LPx:
	LPx2.append([i]*n)

LPx3=[]
for sublist in LPx2:
    for item in sublist:
        LPx3.append(item)

LPy2=[]
#n=len(LPy)
for i in LPx:
	LPy2.append(LPy)

LPy3=[]
for sublist in LPy2:
    for item in sublist:
        LPy3.append(item)
        
LPy4=reversed(LPy3)

if TMS_WMTS:
	for i,j,k in zip(bitmaps,LPy3,LPx3):
		g.DrawImage(i,j,k)
else:
	for i,j,k in zip(bitmaps,LPx3,LPy4):
		g.DrawImage(i,j,k)
#h= Bitmap(512,512,g)

OUT = img

thanks for sharing