xdb->iterRow('SELECT lat, lon FROM geoloc_city AS gc LEFT JOIN adresses AS a ON(gc.id = a.cityid) WHERE a.cityid IS NOT NULL GROUP BY gc.id'); $img = imageCreateFromPng("../images/globe.png"); $coul = imagecolorallocate($img, 0, 0, 0); while ($a = $res->next()) { $x = floor(($a[1]/100000 + 180 )/360*600); $y = floor((90 - $a[0]/100000)/180*300); imagefilledrectangle($img, $x, $y, $x+1, $y+1, $coul); } imagePng($img); imagedestroy($img); // vim:set et sws=4 sw=4 sts=4: ?>