Constructor Summary |
|---|
|
Grids
(
)
Create a grids object, uninitialized.
|
Method Summary |
|---|
|
initialize_grid (1)
(
filename
)
Initialize a grid with a built-in grid description
|
|
initialize_grid (2)
(
origin_col
,
origin_row
,
cols_per_map_unit
,
rows_per_map_unit
,
num_cols
,
num_rows
,
mapx_obj
)
Initialize a grid by manually defining the grid parameters.
|
|
copy_grid
(
)
Creates a copy of the object.
|
|
forward_grid
(
lat
,
lon
,
row
,
col
)
Converts a lat/lon coordinate to a row/col coordinate.
|
|
inverse_grid
(
row
,
col
,
lat
,
lon
)
Converts a row/col coordinate to a lat/lon coordinate.
|
var gr = new Grids();
// Creates a new empty Grids object
gr.initialize_grid('East.gpd');
// Initializes the Grids object with the built in "East.gpd"
// grids definitiongr.initialize_grid(2159.5, 1079.5, 12, 12, 4320, 4320, mx)
// Initializes a 4320x4320 grid, in which the map's origin
// is in the center, and each column represents 1/12 of a
// map unit (defined by the projection). Predefined mapx
// object mx is passed in as well.
var newgr = gr.copy_grid();
// Creates a copy of the gr Grids object.
status = gr.forward_grid(20, -30.3, r, c);
// Converts the coordinate 20N,30.3W, puts the row in r[0]
// and the column in c[0]
status = gr.inverse_grid(3.4, 1.1, lat, lon);
// Converts the grid coordinate 3.4,1.1, puts the latitude
// value in lat[0] and the longitude value in lon[0]