View Javadoc
1   package org.opentrafficsim.road.network.factory;
2   
3   import nl.javel.gisbeans.io.esri.CoordinateTransform;
4   
5   /**
6    * <p>
7    * Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
8    * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
9    * </p>
10   * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
11   * initial version Nov 30, 2015 <br>
12   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
13   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
14   */
15  public class Test
16  {
17      /**
18       * @param args args
19       */
20      public static void main(String[] args)
21      {
22          // double latCenter = 37.419933552777, lonCenter = -122.05752616111;
23          double latCenter = 37.40897623275873, lonCenter = -122.0246091728831;
24          CoordinateTransform latLonToXY = new CoordinateTransformLonLatToXY(lonCenter, latCenter);
25          // double[] xy = latLonToXY.doubleTransform(37.419933552777, -122.05752616111); // Moffett
26          double[] xy = latLonToXY.doubleTransform(-122.0246091728831, 37.40897623275873);
27          System.out.println(xy[0] + ", " + xy[1]);
28          xy = latLonToXY.doubleTransform(-122.0283934, 37.4025104);
29          System.out.println(xy[0] + ", " + xy[1]);
30          System.out.println();
31          xy = latLonToXY.doubleTransform(-122.0256091728831, 37.40897623275873); // minx,y
32          System.out.println(xy[0] + ", " + xy[1]);
33          xy = latLonToXY.doubleTransform(-122.0246091728831, 37.40997623275873); // maxx,y
34          System.out.println(xy[0] + ", " + xy[1]);
35      }
36  
37  }