source: josm/trunk/src/org/openstreetmap/josm/data/projection/proj/LonLat.java@ 9562

Last change on this file since 9562 was 9124, checked in by bastiK, 8 years ago

guess resonable projection bounds, when they haven't been specified (see #12186)

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.projection.proj;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import org.openstreetmap.josm.data.Bounds;
7import org.openstreetmap.josm.data.projection.ProjectionConfigurationException;
8
9/**
10 * Simple Lat/Lon (pseudo-)projection.
11 */
12public class LonLat implements Proj {
13
14 private double a;
15
16 @Override
17 public String getName() {
18 return tr("Lat/lon (Geodetic)");
19 }
20
21 @Override
22 public String getProj4Id() {
23 return "lonlat";
24 }
25
26 @Override
27 public void initialize(ProjParameters params) throws ProjectionConfigurationException {
28 a = params.ellps.a;
29 }
30
31 @Override
32 public double[] project(double lat_rad, double lon_rad) {
33 return new double[] {Math.toDegrees(lon_rad) / a, Math.toDegrees(lat_rad) / a};
34 }
35
36 @Override
37 public double[] invproject(double east, double north) {
38 return new double[] {Math.toRadians(north * a), Math.toRadians(east * a)};
39 }
40
41 @Override
42 public Bounds getAlgorithmBounds() {
43 return new Bounds(-90, -180, 90, 180, false);
44 }
45}
Note: See TracBrowser for help on using the repository browser.