-
Notifications
You must be signed in to change notification settings - Fork 7
Batch Import Options
The batch import functionality in Vortex includes optional geoprocessing and writing options. Using Java, the options are passed to the BatchImporter builder as a map. Using Jython, the options are passed to the BatchImporter builder as a dictionary. Both the key and value should be of type String.
An example script that uses both geoprocessing and write options is shown below:
from mil.army.usace.hec.vortex.io import BatchImporter
from mil.army.usace.hec.vortex.geo import WktFactory
from glob import glob
in_files = glob(r'C:/Temp/Test_Data/*.tif')
destination = 'C:/Temp/import.dss'
geo_options = {
'targetCellSize': '2000',
'targetEpsg': '32633'
}
write_options = {
'partA': 'UTM33N',
'partB': 'Sachsen_Kemnitz',
'partC': 'PRECIPITATION',
'partF': 'RADOLAN',
'dataType': 'PER-CUM',
'units': 'MM'
}
myImport = BatchImporter.builder() \
.inFiles(in_files) \
.destination(destination) \
.geoOptions(geo_options) \
.writeOptions(write_options) \
.build()
myImport.process()There are two ways to specify a clipping extent, a shapefile or an envelope, and they are intended to be mutually exclusive. If arguments for both are provided, the shapefile will prevail.
-
pathToShp- Path to a valid shapefile. The shapefile extent will be used to clip the grids on import. The file must exist; if the path does not resolve, Vortex falls through to the envelope options, and if those are absent no clipping is applied. -
minX- The minimum X coordinate for a clipping envelope. -
maxX- The maximum X coordinate for a clipping envelope. -
minY- The minimum Y coordinate for a clipping envelope. -
maxY- The maximum Y coordinate for a clipping envelope. -
envWkt- The well-known-text projection representation for a clipping envelope.
All five envelope options are required together. If any one of them is missing, the envelope is ignored and no clipping is applied.
There are two ways to specify a target projection, a WKT or an EPSG code, and they are intended to be mutually exclusive. If arguments for both are provided, the EPSG code will prevail.
-
targetWkt- The target well-known-text projection representation that the imported data will be projected into. -
targetEpsg- The target EPSG code that the imported data will be projected into. For the Standard Hydrologic Grid (SHG), use5070. UTM North projections start with "326" and are followed by the zone number. For example the EPSG code for UTM zone 33 North is 32633. UTM South projections start with "327" and are followed by the zone number. For example the EPSG code for UTM zone 56 South is 32756.
-
resamplingMethod- The resampling method. Options includenearfor nearest neighbor,bilinearfor bilinear, andaveragefor weighted average. If no method is provided,nearwill be used.bilinearis a good option for the continuous data commonly encountered in hydrology. -
targetCellSize- The target cell size that the imported grids will be resampled into. For example, specifying "2000" against the default units gives grids with a resolution of 2000 meters. -
targetCellSizeUnits- The units the cell size is expressed in. Valid entries areMetersandFeet, capitalised exactly as shown. If not provided, meters are assumed.
-
partA- The A-Part for the DSS record. -
partB- The B-Part for the DSS record. -
partC- The C-Part for the DSS record. -
partD- The D-Part for the DSS record. -
partE- The E-Part for the DSS record. -
partF- The F-Part for the DSS record. -
units- The units for the DSS record. For example "IN" for inches. -
dataType- The DSS data type. Valid entries:INST-VAL,PER-AVER,PER-CUM, andINST-CUM. If not provided, Vortex chooses one from the grid:PER-AVERwhere the grid has an interval, andINST-VALwhere it does not.
Any part may be given as *, which leaves that part as Vortex derived it rather than overriding it. For partF specifically, * carries the F-Part through from the source record, which is useful when importing from one DSS file to another.