NAME

Geo::OSM::Imager - simplifies plotting onto OpenStreetMap tiles

SYNOPSIS

my $g=Geo::OSM::Imager->new(ua => 'MyApplication');
my $image=$g->init(\@points);
...
my ($x,$y)=$g->latlon2xy($lat,$lon);
$image->circle(x=>$x,y=>$y,r=>50,color=>$blue);
...
$image->circle($g->latlon2hash($lat,$lon),r=>50,color=>$blue);
...
$image->write(file => 'test.png');

DESCRIPTION

This module sets up an Imager object made of OpenStreetMap tiles, for drawing of geographic data.

Beware of over-using OpenStreetMap tile servers, and see the usage policy at https://operations.osmfoundation.org/policies/tiles/ .

Be hesitant about drawing straight lines over long distances, as map projections will cause distortion. Over more than a few hundred metres, the author prefers to break the line into a series of points and plot individual line segments.

USAGE

OTHER CONSIDERATIONS

Note that you need not draw directly onto the supplied object: you can create a new transparent image using the width and height of the one provided by the module, draw onto that, and copy the results with a rubthrough or compose command. See Imager::Transformations for more.

BUGS

Won't work to span +/- 180 degrees longitude.

LICENSE

Copyright (C) 2017 Roger Bell_West.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Roger Bell_West roger@firedrake.org

SEE ALSO

Imager