Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $f = fopen("/tmp/position.cur", 'r');
- $line = fgets($f);
- fclose($f);
- $pieces = explode(":", $line);
- $y=$pieces[1];
- $x=$pieces[2];
- $html = file_get_contents("http://kansalaisen.karttapaikka.fi/kartanhaku/koordinaattihaku.html?y=$y&x=$x&srsName=EPSG%3A4258&scale=8000&tool=siirra&styles=normal&lang=fi");
- preg_match('/auto(.*?)>/s', $html, $matches);
- $tulos = $matches[0];
- $tulos = substr($tulos,26,200);
- $pit = strlen($tulos);
- $tulos = substr($tulos,1,$pit-3);
- $tulos = "http://kansalaisen.karttapaikka.fi/".$tulos;
- $tulos = str_replace(";", "&", $tulos);
- #echo $tulos;
- $handle = fopen($tulos, 'rb');
- $img = new Imagick();
- $draw = new ImagickDraw();
- $img->readImageFile($handle);
- $draw->setFillColor("#FF0000");
- $draw->circle(295, 295, 305, 305);
- $img->drawImage($draw);
- #$img->writeImage('/tmp/kuva.png');
- fclose($handle);
- header("Content-Type: image/png");
- echo $img;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment