Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(390)  |  Call(378)  |  Derive(0)  |  Import(12)

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/FM5-33CCM.py   defense-and-intel-analysis-toolbox(Download)
 
try:
    if debug == True: arcpy.AddMessage("START: " + str(time.strftime("%m/%d/%Y  %H:%M:%S", time.localtime())))
    scratch = env.scratchWorkspace
    env.overwriteOutput = True
 
    # Load vehicle Parameters Table into a dictionary
    if debug == True: arcpy.AddMessage("Building vehicle table...")
    vehicleTable = {}
    vehicleRows = arcpy.da.SearchCursor(inputVehicleParameterTable,["OID@","classname","name","weight","maxkph","onslope","offslope"])
        vehicleTable[name] = [classname,name,weight,maxkph,onslope,offslope]
    del vehicleRows
    if debug == True: arcpy.AddMessage("vehicleTable: " + str(vehicleTable))
    vehicleParams = vehicleTable[inputVehicleType]
    if debug == True: arcpy.AddMessage("vehicleParams: " + str(vehicleParams))
    axisPoint = str(extAOI.XMin) + " " + str(extAOI.YMax)
    #TODO: check w/ GP, why does this guy not take an arcpy.Point???
    if debug == True: arcpy.AddMessage("fishnet: " + str(time.strftime("%m/%d/%Y  %H:%M:%S", time.localtime())))
    arcpy.CreateFishnet_management(prefishnet,originPoint,axisPoint,10000,10000,numRows,numCols,"#","#","#","POLYGON")
    deleteme.append(prefishnet)

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/RasterOffRoad.py   defense-and-intel-analysis-toolbox(Download)
try:
 
    if debug == True: arcpy.AddMessage("START: " + str(time.strftime("%m/%d/%Y  %H:%M:%S", time.localtime())))
    scratch = env.scratchGDB
    if debug == True: arcpy.AddMessage("scratch: " + str(scratch))
    env.cellSize = max(arcpy.Describe(inputAOI).Extent.width,arcpy.Describe(inputAOI).Extent.height)/2000.0
    #env.cellSize = 90.0
    if debug == True: arcpy.AddMessage("Cell Size: " + str(env.cellSize))
    intersectionList = []
 
    # Load vehicle Parameters Table into a dictionary
    arcpy.AddMessage("Building vehicle table...")
        vehicleTable[name] = [classname,name,weight,maxkph,onslope,offslope]
    del vehicleRows
    if debug == True: arcpy.AddMessage("vehicleTable: " + str(vehicleTable))
    vehicleParams = vehicleTable[inputVehicleType]
    if debug == True: arcpy.AddMessage("vehicleParams: " + str(vehicleParams))

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/RLOS.py   defense-and-intel-analysis-toolbox(Download)
 
if RADIUS2_to_infinity == 'true':
    arcpy.AddMessage("RLOS to infinity will use horizon for calculation.")
    RADIUS2_to_infinity = True
else:
    arcpy.AddMessage("RLOS will use local RADIUS2 values for calculation.")
    removeSPOT = obsMaximums['REMOVE_SPOT']
    if (removeSPOT == True):
        arcpy.AddMessage("Observer SPOT is <NULL>, deleteing field ...")
        arcpy.DeleteField_management(observers,"SPOT")
 
    # Do a Minimum Bounding Geometry (MBG) on the input observers
    observers_mbg = os.path.join(env.scratchWorkspace,"observers_mbg")
    delete_me.append(observers_mbg)
    arcpy.AddMessage("Finding observer's minimum bounding envelope ...")
 
    # Now find the center of the (MBG)
    arcpy.AddMessage("Finding center of observers ...")
    mbgCenterPoint = os.path.join(env.scratchWorkspace,"mbgCenterPoint")
    mbgExtent = arcpy.Describe(observers_mbg).extent

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/RLOSdebug.py   defense-and-intel-analysis-toolbox(Download)
 
if RADIUS2_to_infinity == 'true':
    arcpy.AddMessage("RLOS to infinity will use horizon for calculation.")
    RADIUS2_to_infinity = True
else:
    arcpy.AddMessage("RLOS will use local RADIUS2 values for calculation.")
    removeSPOT = obsMaximums['REMOVE_SPOT']
    if (removeSPOT == True):
        arcpy.AddMessage("Observer SPOT is <NULL>, deleteing field ...")
        arcpy.DeleteField_management(observers,"SPOT")
 
    # Do a Minimum Bounding Geometry (MBG) on the input observers
    observers_mbg = os.path.join(envscratchworkspace,"observers_mbg")#(envscratchworkspace,"observers_mbg")
    delete_me.append(observers_mbg)
    arcpy.AddMessage("Finding observer's minimum bounding envelope ...")
 
    # Now find the center of the (MBG)
    arcpy.AddMessage("Finding center of observers ...")
    mbgCenterPoint = os.path.join(envscratchworkspace,"mbgCenterPoint")#(envscratchworkspace,"mbgCenterPoint")
    mbgExtent = arcpy.Describe(observers_mbg).extent

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/Trajectory_Path.py   defense-and-intel-analysis-toolbox(Download)
 
    if debug == True:
        arcpy.AddMessage("initialVelocityMPS: " + str(initialVelocityMPS))
        arcpy.AddMessage("elevationAngleDegrees: " + str(elevationAngleDegrees))
        arcpy.AddMessage("azimuthAngleDegrees: " + str(azimuthAngleDegrees))
    prjInputSurface = arcpy.Describe(inputSurface).spatialReference
    if debug == True:
        arcpy.AddMessage("prjInputFeatures: " + str(prjInputFeature.name))
        arcpy.AddMessage("prjInputSurface: " + str(prjInputSurface.name))
 

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/RangeFanByBearingLimits.py   defense-and-intel-analysis-toolbox(Download)
 
    # set some intial stuff
    if debug == True: arcpy.AddMessage("START ....")
    currentOverwriteOutput = env.overwriteOutput
    env.overwriteOutput = True
 
    #Project doesn't like in_memory featureclasses, copy to scratch
    if debug == True: arcpy.AddMessage("CopyFeatures ....")
    copyInFeatures = os.path.join(scratch,"copyInFeatures")
    arcpy.CopyFeatures_management(inFeature,copyInFeatures)
    prjInFeature = os.path.join(scratch,"prjInFeature")
    srInputPoints = arcpy.Describe(copyInFeatures).spatialReference
    arcpy.AddMessage("Projecting input points to Web Mercator ...")
    arcpy.Project_management(copyInFeatures,prjInFeature,webMercator)
    deleteme.append(prjInFeature)
        msg += "\nrightBearing: " + str(rightBearing) + ", rightAngle: " + str(rightAngle)
        msg += "\ntraversal: " + str(traversal) + ", initalBearing: " + str(initialBearing)
        arcpy.AddMessage(msg)
 
    # get a list of range fan center points
    centerPoints = []
    arcpy.AddMessage("Getting centers ....")

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/RangeFanByBearingAndTraversal.py   defense-and-intel-analysis-toolbox(Download)
        outAngle = 360.0 - (inAngle - 90.0)
 
    if debug == True: arcpy.AddMessage("G2A inAngle(" + str(inAngle) + "), outAngle(" + str(outAngle) + ")")
    return outAngle
 
    prjInFeature = os.path.join(scratch,"prjInFeature")
    srInputPoints = arcpy.Describe(copyInFeatures).spatialReference
    arcpy.AddMessage("Projecting input points to Web Mercator ...")
    arcpy.Project_management(copyInFeatures,prjInFeature,webMercator)
    deleteme.append(prjInFeature)
        # put bearing into 0 - 360 range
        geoBearing = math.fmod(geoBearing,360.0)
        if debug == True: arcpy.AddMessage("geoBearing: " + str(geoBearing))
        arithmeticBearing = Geo2Arithmetic(geoBearing) # need to convert from geographic angles (zero north clockwise) to arithmetic (zero east counterclockwise)
        if debug == True: arcpy.AddMessage("arithmeticBearing: " + str(arithmeticBearing))
        if rightBearing < 0.0: rightBearing = 360.0 + rightBearing
 
        if debug == True: arcpy.AddMessage("arithemtic left/right: " + str(leftAngle) + "/" + str(rightAngle))
        if debug == True: arcpy.AddMessage("geo left/right: " + str(leftBearing) + "/" + str(rightBearing))
 

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/LLOSProfileGraphAttachments.py   defense-and-intel-analysis-toolbox(Download)
            sightLineIDs.append(thisID)
    del rows
    if debug == True: arcpy.AddMessage("sightLineIDs list: " + str(sightLineIDs))
    arcpy.AddMessage("Found " + str(len(sightLineIDs)) + " unique sight line IDs ...")
 
            point = 0
            partCount = geometry.partCount
            if debug == True: arcpy.AddMessage("OID: " + str(oid))
            # go through parts in the line
 
            for part in geometry:
                if debug == True: arcpy.AddMessage("Line: " + str(line) + " Part: " + str(partNum) + " PointCount: " + str(len(part)))
                        startX = pnt.X
                        startY = pnt.Y
                        if debug == True: arcpy.AddMessage("startX,startY: " + str(startX) + "," + str(startY))
                        distFromStart = 0
                        partD.append(0.0)

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/RangeRings2.py   defense-and-intel-analysis-toolbox(Download)
 
    result = arcpy.GetCount_management(input_centers)
    arcpy.AddMessage("Using " + str(result) + " centers ...")
 
    # create temp table
 
    # build ring values
    arcpy.AddMessage("Building ring table ...")
    getRows = arcpy.SearchCursor(input_centers)
    addRows = arcpy.InsertCursor(tempTable)
 
    # build ellipses
    arcpy.AddMessage("Constructing " + str(results) + " ring features ...")
    arcpy.TableToEllipse_management(tempTable,outputRings,"POINT_X","POINT_Y","RingRadius","RingRadius",distanceUnits,"#","#","#",inputCentersSR)
 
    # create radials temp table
    if buildRadials == True:
        arcpy.AddMessage("Using " + str(numberOfRadials) + " radials ...")
        tempRadialTable = os.path.join(env.scratchWorkspace,"tempRadialTable")
        delete_me.append(tempRadialTable)
            r += 1
 
        arcpy.AddMessage("Building radial table ...")
        getRows = arcpy.SearchCursor(input_centers)
        addRows = arcpy.InsertCursor(tempRadialTable)

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/ConvertCoordinates.py   defense-and-intel-analysis-toolbox(Download)
    # Script arguments
    Input_Table = arcpy.GetParameterAsText(0)
    arcpy.AddMessage(Input_Table)
    if Input_Table == '#' or not Input_Table:
        Input_Table = "C:\\Workspace\\Data\\Geometry Importers\\linewizard.dbf" # provide a default value if unspecified
 
    Output_Table = arcpy.GetParameterAsText(4)
    arcpy.AddMessage(Output_Table)
    if Output_Table == '#' or not Output_Table:
        pass
 
    # Process: Convert Coordinate Notation (GARS)
    arcpy.AddMessage("Converting & appending GARS ...")
    arcpy.ConvertCoordinateNotation_management(intermed, scratchTable, X_Field__Longitude__UTM__MGRS__USNG__GARS__GeoRef_, Y_Field__Latitude_, Input_Coordinate_Format, "GARS", "JoinID", Spatial_Reference)
    arcpy.JoinField_management(intermed, "JoinID", scratchTable, "JoinID", "GARS")
 
    # Process: Convert Coordinate Notation (DD)
    arcpy.AddMessage("Converting & appending Decimal Degrees ...")
 
    # Process: Convert Coordinate Notation (DDM)
    arcpy.AddMessage("Converting & appending Degrees Decimal Minutes ...")
    arcpy.ConvertCoordinateNotation_management(intermed, scratchTable, X_Field__Longitude__UTM__MGRS__USNG__GARS__GeoRef_, Y_Field__Latitude_, Input_Coordinate_Format, "DDM", "JoinID", Spatial_Reference)
    arcpy.JoinField_management(intermed, "JoinID", scratchTable, "JoinID", "DDMLat;DDMLon")

  1 | 2 | 3 | 4 | 5 | 6 | 7  Next