ucar.nc2.dt.grid
Class GridCoordinate2D

java.lang.Object
  extended by ucar.nc2.dt.grid.GridCoordinate2D

public class GridCoordinate2D
extends Object

2D Coordinate System has lat(x,y) and lon(x,y). This class implements finding the index (i,j) from (lat, lon) coord. This is for "one-off" computation, not a systematic lookup table for all points in a pixel array. Hueristically searches the 2D space for the cell tha contains the point.

Since:
Jul 10, 2009
Author:
caron

Method Summary
 boolean findCoordElement(double wantLat, double wantLon, int[] rectIndex)
           
 boolean findCoordElementForce(double wantLat, double wantLon, int[] rectIndex)
           
 boolean findCoordElementNoForce(double wantLat, double wantLon, int[] rectIndex)
          Find the best index for the given lat,lon point.
static void main(String[] args)
           
static void test1()
           
static void test2()
           
static void test3()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findCoordElementForce

public boolean findCoordElementForce(double wantLat,
                                     double wantLon,
                                     int[] rectIndex)

findCoordElement

public boolean findCoordElement(double wantLat,
                                double wantLon,
                                int[] rectIndex)

findCoordElementNoForce

public boolean findCoordElementNoForce(double wantLat,
                                       double wantLon,
                                       int[] rectIndex)
Find the best index for the given lat,lon point.

Parameters:
wantLat - lat of point
wantLon - lon of point
rectIndex - return (row,col) index, or best guess here. may not be null
Returns:
false if not in the grid.

test1

public static void test1()
                  throws IOException
Throws:
IOException

test2

public static void test2()
                  throws IOException
Throws:
IOException

test3

public static void test3()
                  throws IOException
Throws:
IOException

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.