address_not_matched__3_ = "Import\\address_not_matched"

# Process: Iterate Feature Selection
arcpy.IterateFeatureSelection_mb(ADMIN_ElectionDistricts, "", "false")

# Process: Select Layer By Location
arcpy.SelectLayerByLocation_management(building_address_w_single, "INTERSECT",
                                       districtIterator, "", "NEW_SELECTION")

# Process: getDistrictNum
arcpy.GetFieldValue_mb(districtIterator, "ELECTION_DISTRICTS", "String",
                       "water")

# Process: rename building_w_single
arcpy.CalculateValue_management(
    "ElectionDistrict (\"%ElectionDistrict%\")",
    "def ElectionDistrict (ElectionDistrict):\\n    outputName=\"\"\"building_address_w_single_ED_%ElectionDistrict%\"\"\"\\n    return outputName",
    "String")

# Process: Feature Class to Feature Class (4)
arcpy.FeatureClassToFeatureClass_conversion(
    building_address_w_single__3_, split, output_value, "",
    "Join_Count \"Join_Count\" true true false 4 Long 0 0 ,First,#,C:\\LocalGIS\\OSM\\OSM-BaCo.gdb\\building_address_w_single,Join_Count,-1,-1;TARGET_FID \"TARGET_FID\" true true false 4 Long 0 0 ,First,#,C:\\LocalGIS\\OSM\\OSM-BaCo.gdb\\building_address_w_single,TARGET_FID,-1,-1;BUILDING \"FEATURE_TYPE\" true true false 50 Text 0 0 ,First,#,C:\\LocalGIS\\OSM\\OSM-BaCo.gdb\\building_address_w_single,BUILDING,-1,-1;ADDR_HOUSE \"ADDR_HOUSENUMBER\" true true false 21 Text 0 0 ,First,#,C:\\LocalGIS\\OSM\\OSM-BaCo.gdb\\building_address_w_single,ADDR_HOUSENUMBER,-1,-1;ADDR_STREE \"ADDR_STREET\" true true false 169 Text 0 0 ,First,#,C:\\LocalGIS\\OSM\\OSM-BaCo.gdb\\building_address_w_single,ADDR_STREET,-1,-1;ADDR_STATE \"ADDR_STATE\" true true false 2 Text 0 0 ,First,#,C:\\LocalGIS\\OSM\\OSM-BaCo.gdb\\building_address_w_single,ADDR_STATE,-1,-1;ADDR_CITY \"ADDR_CITY\" true true false 40 Text 0 0 ,First,#,C:\\LocalGIS\\OSM\\OSM-BaCo.gdb\\building_address_w_single,ADDR_CITY,-1,-1;SHAPE_Leng \"SHAPE_Leng\" false true true 8 Double 0 0 ,First,#,C:\\LocalGIS\\OSM\\OSM-BaCo.gdb\\building_address_w_single,SHAPE_Length,-1,-1;SHAPE_Area \"SHAPE_Area\" false true true 8 Double 0 0 ,First,#,C:\\LocalGIS\\OSM\\OSM-BaCo.gdb\\building_address_w_single,SHAPE_Area,-1,-1;POSTCODE \"POSTCODE\" true true false 50 Text 0 0 ,First,#,C:\\LocalGIS\\OSM\\OSM-BaCo.gdb\\building_address_w_single,POSTCODE,-1,-1",
    "")

# Process: Simplify Polygon
arcpy.SimplifyPolygon_cartography(building_address_w_single_ED_10_shp,
                                  building_address_w_single_ED1,
                                  "POINT_REMOVE", Linear_unit, "0 Unknown",
                                  "NO_CHECK", "NO_KEEP")

# Process: Project
CTX_Final = CTX_Mosaic_Footprints2
CTXmosaic_GBD_gdb = OUTPUT_FOLDER
CTX_Mosaic_Init = CTXmosaic_GBD_gdb
CompleteDownload = "true"
ExpressionTF = "CompleteDown = \"false\""

# Process: Create File GDB
arcpy.CreateFileGDB_management(OUTPUT_FOLDER, MosaicName, "CURRENT")

# Process: Create Mosaic Dataset
arcpy.CreateMosaicDataset_management(CTXmosaic_GBD_gdb, MosaicName, "PROJCS['Mars_Equi180',GEOGCS['GCS_Mars_2000_Sphere',DATUM['D_Mars_2000_Sphere',SPHEROID['Mars_2000_Sphere_IAU_IAG',3396190.0,0.0]],PRIMEM['Reference_Meridian',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Equidistant_Cylindrical'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Standard_Parallel_1',180.0],UNIT['Meter',1.0]];-10669600 -16102700 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision", "1", "8_BIT_UNSIGNED", "NONE", "")

# Process: Add Rasters To Mosaic Dataset
arcpy.AddRastersToMosaicDataset_management(CTX_Mosaic_Init, "Raster Dataset", "C:\\Users\\thare\\Documents\\GIT\\ArcGIS_Plugins\\CTX_CreateMosaic_fromASU", "UPDATE_CELL_SIZES", "UPDATE_BOUNDARY", "NO_OVERVIEWS", "", "0", "1500", "", "*.JP2", "NO_SUBFOLDERS", "EXCLUDE_DUPLICATES", "NO_PYRAMIDS", "CALCULATE_STATISTICS", "NO_THUMBNAILS", "", "NO_FORCE_SPATIAL_REFERENCE")

# Process: Define Mosaic Dataset NoData
arcpy.DefineMosaicDatasetNoData_management(CTX_Mosaic_Rasters, "1", "BAND_1 0", "", "", "NO_COMPOSITE_NODATA")

# Process: BuildFootprints_1
arcpy.BuildFootprints_management(CTX_Mosaic_NoDATA, "", "RADIOMETRY", "1", "255", "10", "500", "NO_MAINTAIN_EDGES", "SKIP_DERIVED_IMAGES", "NO_BOUNDARY", "2000", "100", "NONE", "", "20", "0.05")

# Process: BuildFootprints_2
arcpy.BuildFootprints_management(CTX_Mosaic_Footprints1, "", "NONE", "1", "254", "10", "5000", "NO_MAINTAIN_EDGES", "SKIP_DERIVED_IMAGES", "UPDATE_BOUNDARY", "2000", "100", "NONE", "", "20", "0.05")

# Process: Set Mosaic Dataset Properties
arcpy.SetMosaicDatasetProperties_management(CTX_Mosaic_Footprints2, "4100", "15000", "None;LZ77;JPEG;LERC", "None", "75", "0", "BILINEAR", "CLIP", "FOOTPRINTS_MAY_CONTAIN_NODATA", "CLIP", "NOT_APPLY", "", "NONE", "Center;NorthWest;LockRaster;ByAttribute;Nadir;Viewpoint;Seamline;None", "Seamline", "", "", "ASCENDING", "BLEND", "10", "600", "300", "1000", "0.8", "", "FULL", "", "DISABLED", "", "", "", "", "20", "1000", "GENERIC", "1")

# Process: Calculate Value
arcpy.CalculateValue_management(ExpressionTF, "", "Boolean")

Ejemplo n.º 3
0
# Process: Make Feature Layer
arcpy.MakeFeatureLayer_management(
    Clipped_Veg, Clipped_Veg_Layer, "", "",
    "OBJECTID OBJECTID VISIBLE NONE;Shape Shape VISIBLE NONE;fcsubtype fcsubtype VISIBLE NONE;f_code f_code VISIBLE NONE;adr adr VISIBLE NONE;aoo aoo VISIBLE NONE;ara ara VISIBLE NONE;atb atb VISIBLE NONE;awp awp VISIBLE NONE;caa caa VISIBLE NONE;dmbc dmbc VISIBLE NONE;dmbl dmbl VISIBLE NONE;dmbu dmbu VISIBLE NONE;dmt dmt VISIBLE NONE;ffn ffn VISIBLE NONE;ffn2 ffn2 VISIBLE NONE;ffn3 ffn3 VISIBLE NONE;hgt hgt VISIBLE NONE;lmc lmc VISIBLE NONE;lzn lzn VISIBLE NONE;oth oth VISIBLE NONE;pcf pcf VISIBLE NONE;ppo ppo VISIBLE NONE;ppo2 ppo2 VISIBLE NONE;ppo3 ppo3 VISIBLE NONE;pvh pvh VISIBLE NONE;sdsc sdsc VISIBLE NONE;sdsl sdsl VISIBLE NONE;sdsu sdsu VISIBLE NONE;ssr ssr VISIBLE NONE;ssr2 ssr2 VISIBLE NONE;ssr3 ssr3 VISIBLE NONE;tos tos VISIBLE NONE;tre tre VISIBLE NONE;tscc tscc VISIBLE NONE;tscl tscl VISIBLE NONE;tscu tscu VISIBLE NONE;ufi ufi VISIBLE NONE;vcm vcm VISIBLE NONE;vcm2 vcm2 VISIBLE NONE;vcm3 vcm3 VISIBLE NONE;vlm vlm VISIBLE NONE;voi voi VISIBLE NONE;vsp vsp VISIBLE NONE;vsp2 vsp2 VISIBLE NONE;vsp3 vsp3 VISIBLE NONE;wid wid VISIBLE NONE;zi004_rcg zi004_rcg VISIBLE NONE;zi005_fna zi005_fna VISIBLE NONE;zi005_nfn zi005_nfn VISIBLE NONE;zi006_mem zi006_mem VISIBLE NONE;zi013_csp zi013_csp VISIBLE NONE;zi013_csp2 zi013_csp2 VISIBLE NONE;zi013_csp3 zi013_csp3 VISIBLE NONE;zi013_ffp zi013_ffp VISIBLE NONE;zi013_ffp2 zi013_ffp2 VISIBLE NONE;zi013_ffp3 zi013_ffp3 VISIBLE NONE;zi013_fmm zi013_fmm VISIBLE NONE;zi013_fmm2 zi013_fmm2 VISIBLE NONE;zi013_fmm3 zi013_fmm3 VISIBLE NONE;zi013_irg zi013_irg VISIBLE NONE;zi014_ppo zi014_ppo VISIBLE NONE;zi014_ppo2 zi014_ppo2 VISIBLE NONE;zi014_ppo3 zi014_ppo3 VISIBLE NONE;zi018_wit zi018_wit VISIBLE NONE;zsax_rs0 zsax_rs0 VISIBLE NONE;zsax_rx3 zsax_rx3 VISIBLE NONE;zsax_rx4 zsax_rx4 VISIBLE NONE;zvh zvh VISIBLE NONE;created_user created_user VISIBLE NONE;created_date created_date VISIBLE NONE;last_edited_user last_edited_user VISIBLE NONE;last_edited_date last_edited_date VISIBLE NONE;adi adi VISIBLE NONE;cam cam VISIBLE NONE;ccg ccg VISIBLE NONE;cso cso VISIBLE NONE;cul cul VISIBLE NONE;hei hei VISIBLE NONE;hss hss VISIBLE NONE;mcc mcc VISIBLE NONE;mcc2 mcc2 VISIBLE NONE;mcc3 mcc3 VISIBLE NONE;srl srl VISIBLE NONE;ssc ssc VISIBLE NONE;tty tty VISIBLE NONE;zi024_ywq zi024_ywq VISIBLE NONE;zi037_rel zi037_rel VISIBLE NONE;zi037_rfa zi037_rfa VISIBLE NONE;aqn aqn VISIBLE NONE;ba000_vdc ba000_vdc VISIBLE NONE;ba000_vdr ba000_vdr VISIBLE NONE;cet cet VISIBLE NONE;dof dof VISIBLE NONE;fic fic VISIBLE NONE;got got VISIBLE NONE;pfd pfd VISIBLE NONE;pfh pfh VISIBLE NONE;rkf rkf VISIBLE NONE;sad sad VISIBLE NONE;sdcc sdcc VISIBLE NONE;sdcl sdcl VISIBLE NONE;sdcu sdcu VISIBLE NONE;sdo sdo VISIBLE NONE;sdt sdt VISIBLE NONE;sgcc sgcc VISIBLE NONE;sgcl sgcl VISIBLE NONE;sgcu sgcu VISIBLE NONE;shd shd VISIBLE NONE;sic sic VISIBLE NONE;slt slt VISIBLE NONE;srd srd VISIBLE NONE;stp stp VISIBLE NONE;swc swc VISIBLE NONE;trs trs VISIBLE NONE;trs2 trs2 VISIBLE NONE;trs3 trs3 VISIBLE NONE;tsm tsm VISIBLE NONE;tsm2 tsm2 VISIBLE NONE;tsm3 tsm3 VISIBLE NONE;wle wle VISIBLE NONE;ama ama VISIBLE NONE;cct cct VISIBLE NONE;bac bac VISIBLE NONE;hhd hhd VISIBLE NONE;stl stl VISIBLE NONE;stl2 stl2 VISIBLE NONE;stl3 stl3 VISIBLE NONE;wpi wpi VISIBLE NONE;zi005_fna1 zi005_fna1 VISIBLE NONE;zi005_fna2 zi005_fna2 VISIBLE NONE;zi005_nfn1 zi005_nfn1 VISIBLE NONE;zi005_nfn2 zi005_nfn2 VISIBLE NONE;bmc bmc VISIBLE NONE;bmc2 bmc2 VISIBLE NONE;bmc3 bmc3 VISIBLE NONE;boc boc VISIBLE NONE;hyp hyp VISIBLE NONE;sbc sbc VISIBLE NONE;tid tid VISIBLE NONE;veg veg VISIBLE NONE;Shape_Length Shape_Length VISIBLE NONE;Shape_Area Shape_Area VISIBLE NONE;Shape_length Shape_length VISIBLE NONE;Shape_area Shape_area VISIBLE NONE"
)

# Process: Select Layer By Attribute
arcpy.SelectLayerByAttribute_management(
    Clipped_Veg_Layer, "NEW_SELECTION",
    "f_code = 'BH135' OR f_code = 'DA020' OR f_code = 'EA010' OR f_code = 'EB010' OR f_code = 'EB015' OR f_code = 'EB020' OR f_code = 'EC040' OR f_code = 'EE020' OR f_code = 'BH150' OR f_code = 'BJ030' OR f_code = 'BJ100' OR f_code = 'BJ110' OR f_code = 'GB055' OR f_code = 'GB075' OR f_code = 'AK160' OR f_code = 'AK120' OR f_code = 'AK040' OR f_code = 'AK100' OR f_code = 'AK101' OR f_code = 'AK090'"
)

# Process: Calculate Value: Cell Size
arcpy.CalculateValue_management(
    "CalcCellSize(r\"%AOI%\")",
    "def CalcCellSize(ds):\\n   desc = arcpy.Describe(ds)\\n   mx = max(desc.extent.width,desc.extent.height)\\n   return float(mx/2000.0)",
    "Cell Size")

# Process: Extract by Mask
tempEnvironment0 = arcpy.env.cellSize
arcpy.env.cellSize = "1"
arcpy.gp.ExtractByMask_sa(Slope_Layer, AOI, clippedelev)
arcpy.env.cellSize = tempEnvironment0

# Process: Query for Max Slope Value
arcpy.Statistics_analysis(Aircraft_Specifications,
                          Aircraft_Specifications_Stat,
                          "Ground_Slope_Max_Degrees MAX", "")

# Process: Get Max Slope Value
arcpy.GetFieldValue_mb(Aircraft_Specifications_Stat,
        # Process: Remove Rasters From Mosaic Dataset
        arcpy.RemoveRastersFromMosaicDataset_management(
            gdbideam_raster_GOES16_C13, g_ESRI_variable_8, "UPDATE_BOUNDARY",
            "MARK_OVERVIEW_ITEMS", "DELETE_OVERVIEW_IMAGES",
            "DELETE_ITEM_CACHE", "REMOVE_MOSAICDATASET_ITEMS",
            "UPDATE_CELL_SIZES")
        # Process: Make Table View
        try:
            arcpy.MakeTableView_management(gdbideam_raster_GOES16_C13,
                                           raster_GOES16_C13_View, "", "",
                                           g_ESRI_variable_9)
        except:
            pass
        # Process: Delete Identical
        try:
            arcpy.DeleteIdentical_management(raster_GOES16_C13_View,
                                             g_ESRI_variable_10, "", "0")
        except:
            pass
        # Process: Calculate Value (3)
        arcpy.CalculateValue_management(
            g_ESRI_variable_11,
            "# Variables locales\\nzOrderField = \"zorder\"\\ndateField = \"Fecha\"\\n\\n# Importar librerias\\nimport arcpy\\ntry:\\n def evaluateZorder(table):\\n     # Creación de cursor de actualización\\n     sqlClause = (None, 'ORDER BY {0} DESC'.format(dateField))\\n     flag = 0\\n     with arcpy.da.UpdateCursor(table, [zOrderField, dateField], sql_clause = sqlClause) as cursor:\\n         for row in cursor:\\n             if flag == 0:\\n                 row[0] = -10\\n                 flag = 1\\n             else:\\n                 row[0] = 0\\n             cursor.updateRow(row)\\n     return True\\nexcept:\\n pass",
            "Boolean")

        # Process: Repair Mosaic Dataset Paths
        arcpy.RepairMosaicDatasetPaths_management(gdbideam_raster_GOES16_C13,
                                                  RPATHS, "")

arcpy.AddMessage("Finished script")
count_overlaps = "in_memory\\overlap_count"
Features_to_Delete = "features_to_delete"
Features_Deleted = Features_to_Delete
Delete_succeeded = "false"

# Process: Create Feature Class
arcpy.CreateFeatureclass_management(in_memory, "empty", "POINT", "",
                                    "DISABLED", "DISABLED", "", "", "0", "0",
                                    "0")

# Process: Feature To Polygon
arcpy.FeatureToPolygon_management("''", Spaghetti, "", "NO_ATTRIBUTES", empty)

# Process: Calculate Value
arcpy.CalculateValue_management(
    "GetOidFieldName(r\"%Spaghetti%\")",
    "import arcpy\\ndef GetOidFieldName(path):\\n  fc = arcpy.Describe(path)\\n  return fc.oidfieldname\\n\\n  ",
    "Field")

# Process: Feature To Point
arcpy.FeatureToPoint_management(Spaghetti, Meatballs, "INSIDE")

# Process: Spatial Join
arcpy.SpatialJoin_analysis(Meatballs, Input_Features, count_overlaps,
                           "JOIN_ONE_TO_ONE", "KEEP_ALL", "", "WITHIN", "", "")

# Process: Join Field
arcpy.JoinField_management(Spaghetti, oidfield, count_overlaps, "ORIG_FID",
                           "Join_Count")

# Process: Make Feature Layer
arcpy.MakeFeatureLayer_management(
vshed = Output_Viewshed
vshed__2_ = vshed
Output_above_ground_level_raster = ImageServer_Layer
obs = Observer_location
Observer__2_ = obs
Output_Feature_Class__2_ = Observer__2_
Refractivity_coefficient = "0.13"
Use_earth_curvature_corrections = "true"
Input_Image_Service = "http://stlpatrick.esri.com:6080/arcgis/services/ElevationServices/afghanistan/ImageServer"
fc = wkid

# Process: Buffer
arcpy.Buffer_analysis(Observer_location, Buffer__2_, Distance__value_or_field_, "FULL", "ROUND", "NONE", "")

# Process: Calculate Cell Size
arcpy.CalculateValue_management("CalcCellSize(r\"%Buffer (2)%\")", "def CalcCellSize(ds):\\n   width = arcpy.Describe(ds).extent.width\\n   height = arcpy.Describe(ds).extent.height\\n   cellsize = str(max(float(max(width,height))/2000.0,30.0))\\n   #return cellsize + \" \" + cellsize\\n   return cellsize", "Double")

# Process: Calculate Value
arcpy.CalculateValue_management("%Cell Size%", "", "Cell Size")

# Process: Make Image Server Layer
tempEnvironment0 = arcpy.env.cellSize
arcpy.env.cellSize = "30"
arcpy.MakeImageServerLayer_management(Input_Image_Service, ImageServer_Layer, Buffer__2_, "", "NORTH_WEST", "Name", "0", "", Cell_Size)
arcpy.env.cellSize = tempEnvironment0

# Process: Copy Features
arcpy.CopyFeatures_management(Observer_location, obs, "", "0", "0", "0")

# Process: Add Field (2)
arcpy.AddField_management(obs, "OFFSETA", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")