Package firetools :: Module GP_Util
[hide private]
[frames] | no frames]

Module GP_Util

source code

Geoprocessing Utility Functions

General Utility functions used by other modules within the tool
        Import and provide access to the geoprocessor object (gp)  
        raster file format conversion functions
        generic shapefile utilities (fields, etc)
        generic utilities

Classes [hide private]
  ProgDots
Progress Bar Class with calculated averate eta...
Functions [hide private]
 
JoinDateRasters(npylist, outfile, cleanup=False)
Load the .npy files in npylist and join them as columns in the output table
source code
 
NpySeriesToRaster(study, baseseries)
Convert a npy series to esri rasters
source code
 
RasterToNpySeries(inlist, cleanup=True) source code
 
NpyListToAscii(inlist)
Covert .npy files to import ready ascii rasters
source code
 
DatListToAscii(inlist)
Convert Dat files to import ready ascii rasters
source code
 
AsciiListToRaster(inlist, cleanup=True, outtype='INTEGER')
Convert Ascii rasters to ESRI rasters
source code
 
DatListToNpy(inlist)
Convert DAT files to npy files
source code
 
AddAsciiHeader(infile, nrow=1024, ncol=768, xll=1, yll=1, cellsize=1, nodata=-1)
Add the required import header for txt>raster
source code
 
ExportShapeTable(inshape='datagrid.shp', fieldlist=[], outfile='table', sortexpr='')
export the table data for a shapefile inshape = input shape file fieldlist = list of fields to export outfile = output table name without ".csv" sortexpr = sorting of the table
source code
 
GetShpField(inshape, field) source code
 
PointsFromShpExtent(inshape, outpoints, cellsize)
Create a point grid based on cellsize and the extent of a shapefile
source code
 
GetShpVals(inshape, fields, sortexpr='')
Retrieve the values from select fields in a shapefile returns dictionary with vector for each field key
source code
 
ExtractRasterData(points, fieldname, raster)
Extract data from a raster into point shapefile
source code
 
CalculateShpArea(shapefile)
Get total area of a shapefile
source code
 
ShapeBuffer(inshape, datafield, selectvalue, buffdist, buffshape) source code
 
FilterFields(shapefile, keepfields)
Remove fields except for FID,Shape and those specified in keepfields
source code
 
ConvertDateField(inshape, field, datetype)
apply date conversion to all rows of a field
source code
 
CopyField(inshape, newfield, oldfield)
Copy existing field to new field
source code
 
MakeFolder(target)
makes or overwrites target directory and contained files
source code
 
ArrayToCSV(outfile, inarray, header=[])
Export an array
source code
 
AsciiRaster2Array(inraster, ndval=-9999, nansub=True) source code
 
convertdates(datein, intype='YYYYMMDD', outtype='YYYY', defdate=0, dateprecision=3)
convert one date format to another assign default dates as specified round to dateprecision as specified intype/outtype options: 'YYYY' 'YYYYMMDD'
source code
Variables [hide private]
  log = logging.getLogger('firetools'.ljust(10))
try:...
Variables Details [hide private]

log


try:
        import arcgisscripting
        gp = arcgisscripting.create(9.3)
        gp.SetProduct("ArcInfo")
        gp.CheckOutExtension("spatial")
        gp.OverWriteOutput = 1
except:
        log.info('GP import Fail')
        gp = 'gp'

Value:
logging.getLogger('firetools'.ljust(10))