Download PDF
Download page ProjectTinToGrid.
ProjectTinToGrid
DESCRIPTION
This utility is used to take an input TIN, optionally translate and rotate
the TIN to a new geographic position, and write the resultant TIN to a new
record, normally a file or DSS path in one of the supported output formats.
The output grid definition is obtained from a combination of the specified
PRJ file and the grid spacing. In addition to reprojecting a TIN or grid onto
a new grid, this utility can also be used to read a grid from one supported
format and write it to a different format using the -copyOnly option.
USAGE
ProjectTinToGrid ( (-inFile file -outFile file) &| -controlFile file ) [-inPath path]
[-sTime time] [-dTime timespan] [-eTime time] [-readTimeZone timeZone}
[-tinInputInterval timeInterval]
[-maxTins numTins] [-extentsShapefile shapefile]
( -prjFile file [-gridSpacing number] )
[-units units]
[ [-center lon:lat] | -centroid (tin | storm) ]
[ [-move (lon:lat:rot | x:y:rot:units) ] | [-moveToCenterOfSubbasin subBasinShapefile,subBasinColumnName,subBasinName,rot] ]
[-zAdd valueToAdd,units] [-zMultiply valueToMultiplyBy]
[ -samplingMethod ( inverseDistSq | surfaceInterp ) ] [ -nearestNeighbor [dist] ]
[-writeTimeZone timeZone]
[-?writeProvider] [-writeProvider provider]
[-writeType writeType]
[-outPath path]
OPTIONS
-inFile file
Multiple filespecs can be used. The filespec can be a simple filename or can
contain masks.
-outFile file
Specifies the filename for the target TIN.
-controlFile file
Designates input file that contains a list of argument blocks.
Each block is delimited by an empty line, and all contents in between
specify additional operations to perform beyond what is specified at the
command line, and any missing necessary arguments within a block are
filled with command line arguments.
Example Control File Block:
infile: inputFile.nc
outfile: outputFile.dss
outpath: /a/b/c/d/e/f/
-inPath path
The input path if using DSS. Optionally the path can use masks.
-sTime time
See Command Line Time Specifications
-dTime timespan
See Command Line Time Specifications
-eTime time
See Command Line Time Specifications
-readTimeZone timeZone
Override of the read time zone. If specified, the time zone specified
in the input file's metadata will be ignored, and replaced with the
time zone specified at the command line.
A listing of the available time zones can be found at
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. The TZ
database name should be passed in as the argument. It's preferred to use
time zone specifications with the Canonical status if possible.
-tinInputInterval timeInterval
Used to constrain the TINs to the specified time interval. This option is only needed
when using file/path masks.
Refer to -dTime option for applicable formats. Use this option to ensure that the program
uses only TINs with a specific time interval for computations.
For example use '-tinInputInterval 1Hour' to ensure that files or paths which
match the given file/path masks are also 1 hour time interval.
-maxTins numTins
Specify the maximum number of TINs that can be processed during the
invocation of the command. All the possible variations of the command
options may result in an unintentionally large set of TINs to be processed.
For example, if an erroneous time span was entered, the program can appear
to freeze as it iterates through all the possibilities.
By default this value is set at 100,000.
-extentsShapefile shapefile
Shapefile that specifies the extent to read data. This is equivalent
to the extent read constraints in the read dialogs within the program.
-prjFile file
A file that contains a valid WKT for the desired output projection. If
undefined, the data will remain in the input projection.
Certain -writeProvider and -writeType combinations imply a specific
coordinate system projection, such as using a DSS provider and a write
type of HRAP or SHG, which must match with this option to be successful.
Some write providers may infer a valid projection definition, but may
still require a gridSpacing to be defined.
-gridSpacing number
Desired output grid spacing in the units defined by the output projection.
If undefined, the a default value of 0.1 will be used.
-units units
Specifies the measurement units of the input file. This overrides the
units defined, if any.
-center lon:lat
Specifies the storm center, in decimal degrees, to be used if the
rotation is non-zero when using the -move argument.
e.g. '-center -95.9264:36.0426'.
The -centroid argument is an alternative method for specifying the
center for storm rotation.
-centroid (tin | storm)
Specifies the method for computing the storm center to be used
if the rotation is non-zero when using the -move argument. If "tin" is
specified, the geographic center of the TIN is used as the rotation
centerpoint. If "storm" is specified, the precipitation mass weighted
center of the TIN is used as the rotation center.
The -center argument is an alternative method for specifying the
center for storm rotation.
-move (lon:lat:rot | x:y:rot:units)
Specifies how to move the TIN prior to performing any computation.
Leaving a value blank will set it to zero.
-move ::30 will rotate the TIN 30 degrees CCW.
-move 2:1:0 will move the TIN 2 degrees east and 1 degree north.
-move -22:-18:30:miles will rotate the TIN 30 degrees CCW and then
translate the TIN 22 miles west and 18 miles south.
If both a translation and rotation is specified, the rotation will occur
prior to the translation. Also, if a non-zero translation is specified,
the -center or -centroid argument must be used to specify the rotation centerpoint.
-moveToCenterOfSubbasin subBasinShapefile,subBasinColumnName,subBasinName,rot
As opposed to specifying the x and y distances to move with the -move
argument, this option will automatically allign the specified center
(from the -move or -centroid argument) to the center of the subbasin, and
apply rotation
-moveToCenterOfSubBasin shapefile.shp,Name,SubBasinName,30 will compute
the center of the subasin named "SubBasinName" within the shapefile
"shapefile.shp", for column "Name", and rotate it 30 degrees CCW.
-zAdd valueToAdd,units
Adds a constant value to the entire TIN prior to projection. "valueToAdd"
is the value to add to the entire TIN, and "units" is the unit of that
value being added.
-zMultiply valueToMultiplyBy
Multiplies the entire TIN prior to projection. "valueToMultiplyBy" is the
value to multiply each value in the TIN by.
value being added.
-samplingMethod (inverseDistSq | surfaceInterp)
Specifies the methodology used to sample the source TIN.
Inverse distance squared weighting (inverseDistSq) uses the source grid
cells surrounding each target grid cell to set the target grid cell value.
Surface Interpolation (surfaceInterp) computes the value of each target
grid cell by using the centerpoint location of the cell on the corresponding
source TIN triangle element.
If not specified, the default is dependant on the source TIN. If the source
TIN is a gridded dataset, the inverseDistSq option is used. If the source
TIN is an ungridded dataset, the program uses the surfaceInterp option. Both
methods give similar resultant target grids, however the inverseDistSq method
is much faster when it can be used. Legacy versions of MetVue used only the
surfaceInterp method.
Note: The program will ignore this option when processing ungridded source
TINs and use surfaceInterp for the sampling method.
-nearestNeighbor dist
Specified to use the 'nearest neighbor' point on the
source TIN when setting the value for the grid cell on the target TIN,
instead of using the specified sampling method. If no point is found
within range the value is determined using the -samplingMethod option.
The 'dist' portion of the argument is optional (defaults to 1.0) and
specifies the distance in target grid cells that the nearest neighbor
point must be to be used.
-nearestNeighbor would use the closest point found if the centerpoint
of the source TIN was within 1/2 cell distance of the target TIN.
-nearestNeighbor 3 would use the closest point found if the centerpoint
of the source TIN was within 1 1/2 cells distance of the target TIN.
-nearestNeighbor .5 would use the closest point found if the centerpoint
of the source TIN was within +/-1/4 cells distance of the target TIN.
-writeTimeZone timeZone
Specifies the time zone for which the output data will be written. If
not specified, the output will be written in the time zone of the input data.
A listing of the available time zones can be found at
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. The TZ
database name should be passed in as the argument. It's preferred to use
time zone specifications with the Canonical status if possible.
-?writeProvider
See Grid and TIN Writing Arguments
-writeProvider provider
See Grid and TIN Writing Arguments
-writeType writeType
See Grid and TIN Writing Arguments
-outPath path
The output path if using DSS. When an output path is specified the -writeProvider
option is not required since defining a DSS path implies using the DSS write provider.
If some other write provider other than DSS is defined, the output path will be ignored.
SAMPLE COMMAND LINE ARGUMENTS
Project into DSS HRAP projection with surface interpolation
-controlfile C:\wgrfcqpe_ctrl.txt -SamplingMethod surfaceInterp
-writeProvider dss -writeType HRAP
-outfile C:\DSSOut.dss -outpath /HRAP/GRIDLOAD/PRECIP///PROJECT_INTERPSURFACE/
Project into ASCII grid with projection file using inverse distance squared weighting
-controlfile C:\wgrfcqpe_ctrl.txt
-SamplingMethod inverseDistSq -prjfile C:\ll.prj -gridSpacing 0.1
-writeProvider ascii_grid -writeType ASC_GRID
-outfile C:\asc_%yyyyMMdd_HH%_ASC_GRID.asc
Display the available write providers for projection
-?writeProvider
Display the available write providers in the input DSS record's projection
-infile E:\file.dss -inpath /HRAP/GRID/PRECIP/13OCT2014:0000/13OCT2014:0100/V1/"
-?writeProvider
NOTE ON PERFORMANCE
This program may utilize a significant amount of memory depending on datasets specified.
For extra intensive data operations, it may be necessary to increase the memory allocated
to the jvm. This can be performed by setting the -Xmx argument, which can be altered
easily in the "memory_setting" variable in the ProjectTinToGrid.cmd example file provided.