Johan Beronius > Geo-SweGrid-1.0 > Geo::SweGrid

Download:
Geo-SweGrid-1.0.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.0   Source  

NAME ^

Geo::SweGrid - Convert coordinates between geodetic WGS84 and Swedish grid RT90 and SWEREF99 systems

SYNOPSIS ^

  use Geo::SweGrid;

  my $grid = Geo::SweGrid->new("rt90_2.5_gon_v") or die "No grid, projection not recognized";

  my ($lat, $lon) = $grid->grid_to_geodetic(7011002, 1299996);

  my ($x, $y) = $grid->geodetic_to_grid(63.1530261140462, 11.8353976399345);

DESCRIPTION ^

Convert coordinates between geodetic WGS84 and Swedish grid RT90 and SWEREF99 systems.

Implementation of "Gauss Conformal Projection (Transverse Mercator), Krügers Formulas".

Parameters for SWEREF99 lat-long to/from RT90 and SWEREF99 coordinates (RT90 and SWEREF99 are used in Swedish maps).

$grid = Geo::SweGrid->new($projection)

Constructor for Geo::SweGrid

Creates an instance and sets up parameters for the given RT90 or SWEREF99TM projection. Note: Parameters for RT90 are choosen to eliminate the differences between Bessel and GRS80-ellipsoides. Bessel-variants should only be used if lat/long are given as RT90-lat/long based on the Bessel ellipsoide (from old maps).

Parameters:

 $projection (string). Must match a recognized projection.

List of supported projections:

  rt90_0.0_gon_v
  rt90_2.5_gon_o
  rt90_2.5_gon_v
  rt90_5.0_gon_o
  rt90_5.0_gon_v
  rt90_7.5_gon_v
  bessel_rt90_0.0_gon_v
  bessel_rt90_2.5_gon_o
  bessel_rt90_2.5_gon_v
  bessel_rt90_5.0_gon_o
  bessel_rt90_5.0_gon_v
  bessel_rt90_7.5_gon_v
  sweref_99_1200
  sweref_99_1330
  sweref_99_1415
  sweref_99_1500
  sweref_99_1545
  sweref_99_1630
  sweref_99_1715
  sweref_99_1800
  sweref_99_1845
  sweref_99_2015
  sweref_99_2145
  sweref_99_2315
  sweref_99_tm

Example:

 my $grid = Geo::SweGrid->new("rt90_2.5_gon_v") or die "No grid, projection not recognized";

Returns:

the created instance;

($x, $y) = $grid->geodetic_to_grid($lat, $lon)

Conversion from geodetic coordinates to grid coordinates.

Parameters:

 $latitude  (number)
 $longitude (number)

Example:

 my ($x, $y) = $grid->geodetic_to_grid(63.1530261140462, 11.8353976399345);

Returns:

the x and y grid coordinates;

($lat, $lon) = $grid->grid_to_geodetic($x, $y)

Conversion from grid coordinates to geodetic coordinates.

Parameters:

 $x (number)
 $y (number)

Example:

 my ($lat, $lon) = $grid->grid_to_geodetic(7011002, 1299996);

Returns:

the latitude and longitude geodetic coordinates;

SEE ALSO ^

Source: http://www.lantmateriet.se/templates/LMV_Entrance.aspx?id=68&lang=EN

COPYRIGHT ^

License: http://creativecommons.org/licenses/by-nc-sa/3.0/

AUTHORS ^

Original Javascript-version: http://mellifica.se/geodesi/gausskruger.js

Author: Arnold Andreasson, 2007. http://mellifica.se/konsult

Rewritten as object-oriented Perl by: Johan Beronius, 2009. http://www.athega.se/

syntax highlighting: