Geo::OSM::Render::Viewport - Project OSM latitudes and longitudes into x, y coordinate pairs to be rendered by Geo::OSM::Render.


This is an abstract base class. So, I am hard pressed to write a synopsis here.


After projecting OSM coordinates onto a coordinate system with Geo::OSM::Render::Projection, the resulting coordinates migth be translated onto the coordinate system of the map. This can be done with an instance of viewport.



    my $vp = Geo::OSM::Render::Viewport->new();

Create an instance of a viewport. Use it in a derived class.


    my ($map_x, $map_y) = $vp->x_y_to_map_x_y($x, $$y);

Because this is an abstract base class, calling this method on <Geo::OSM::Render::Viewport> just croaks.


René Nyffenegger <rene.nyffenegger at>

COPYRIGHT AND LICENSE Copyright © 2017 René Nyffenegger, Switzerland. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

Source Code

The source code is on github. Meaningful pull requests are welcome.