getLatLonDomain: Determine the geo-location parameters of an arbitrary user...

View source: R/getLatLonDomain.R

getLatLonDomainR Documentation

Determine the geo-location parameters of an arbitrary user selection

Description

The function uses the ‘GeoGrid’ object and the parameters lonLim and latLim passed by loadGridDataset and calculates the corresponding index positions.

Usage

getLatLonDomain(grid, lonLim, latLim, spatialTolerance = NULL)

Arguments

grid

Java class ‘GeoGrid’

lonLim

see loadGridDataset

latLim

see loadGridDataset

Details

In order to deal with the problem of dateline crossing, the selection is partitioned into two, and the part of the domain with negative eastings is put in first place for consistent spatial mapping. The index position of lon and lat in the corresponding axes is returned by pointXYindex, and is passed to the ‘readDataSlice’ method in makeSubset. For single point locations, this is a integer vector of length two defining these positions, while in the case of rectangular domains its value is c(-1L,-1L).

Value

A list with the following items

  • llbbox A list of length 1 or two depending on whether the selected domain crosses or not the dateline and longitude units go from 0 to 360. See details.

  • pointXYindex A vector of length two with the index positions of the selected XY coordinates -in this order- in case of point selections. See details.

  • lonSlice The X coordinates of the domain selected

  • latSlice The Y coordinates of the domain selected

  • revLat Logical. Whether the order of latitudes should be reversed or not in order to map the data properly in the geographical space

Note

The function assumes that datasets have degrees-east and degress-north as units of the corresponding X and Y axes.

Author(s)

J. Bedia, A. Cofino, M. Iturbide, S. Herrera

References

https://www.unidata.ucar.edu/software/thredds/v4.3/netcdf-java/v4.3/javadoc/ucar/nc2/dt/GridCoordSystem.html


SantanderMetGroup/loadeR documentation built on July 4, 2023, 4:29 a.m.