File size: 450 Bytes
076108a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from PIL import Image, ImageDraw

def generate_map(lat, lon):
    # Create a blank world map canvas
    img = Image.new("RGB", (400, 200), "white")
    draw = ImageDraw.Draw(img)

    # Project lat/lon onto the canvas (simple equirectangular projection)
    x = int((lon + 180) / 360 * 400)
    y = int((90 - lat) / 180 * 200)

    # Draw a red dot at the predicted location
    draw.ellipse((x - 4, y - 4, x + 4, y + 4), fill="red")

    return img