Guest User

Untitled

a guest
Aug 27th, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2. $f = fopen("/tmp/position.cur", 'r');
  3. $line = fgets($f);
  4. fclose($f);
  5. $pieces = explode(":", $line);
  6. $y=$pieces[1];
  7. $x=$pieces[2];
  8. $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");
  9. preg_match('/auto(.*?)>/s', $html, $matches);
  10.  
  11. $tulos = $matches[0];
  12. $tulos = substr($tulos,26,200);
  13. $pit = strlen($tulos);
  14. $tulos = substr($tulos,1,$pit-3);
  15. $tulos = "http://kansalaisen.karttapaikka.fi/".$tulos;
  16. $tulos = str_replace(";", "&", $tulos);
  17. #echo $tulos;
  18. $handle = fopen($tulos, 'rb');
  19. $img = new Imagick();
  20. $draw = new ImagickDraw();
  21. $img->readImageFile($handle);
  22. $draw->setFillColor("#FF0000");
  23. $draw->circle(295, 295, 305, 305);
  24. $img->drawImage($draw);
  25. #$img->writeImage('/tmp/kuva.png');
  26. fclose($handle);
  27. header("Content-Type: image/png");
  28. echo $img;
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment