zoukankan      html  css  js  c++  java
  • 通过GP加载卫星云图-雷达图-降雨预报图

    # ---------------------------------------------------------------------------
    # MeteorologicalImageLoad.py
    # Created on: 2014-01-24 08:33:03.00000
    # Created by SmartMap
    # Usage: MeteorologicalImageLoad <analyzeType> <analyzeResult>
    # Description:
    # ---------------------------------------------------------------------------


    import arcpy
    import shutil
    import os,sys

    arcpy.env.overwriteOutput = True


    projectNameSatelliteImage = 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433],AUTHORITY["EPSG",4326]]'
    projectNameWaterReport = 'PROJCS["Asia_North_Equidistant_Conic",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Equidistant_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",95.0],PARAMETER["Standard_Parallel_1",15.0],PARAMETER["Standard_Parallel_2",65.0],PARAMETER["Latitude_Of_Origin",30.0],UNIT["Meter",1.0],AUTHORITY["ESRI",102026]]'
    projectNameWeatherRadar = 'PROJCS["Asia_Lambert_Conformal_Conic",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",105.0],PARAMETER["Standard_Parallel_1",30.0],PARAMETER["Standard_Parallel_2",62.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0],AUTHORITY["ESRI",102012]]'

    analyzeResult = "%scratchworkspace%\analyzeResult.img"

    # Script arguments
    analyzeType = arcpy.GetParameterAsText(0)
    if analyzeType == '#' or not analyzeType:
    analyzeType = "SatelliteImage"

    imageDirectory = "D:\data\SpatialData\sourceDir\" + analyzeType
    copyTargetPath = "D:\data\SpatialData\targetDir\default" + analyzeType + ".jpg"
    inputLinkFile = "D:\data\SpatialData\targetDir\" + analyzeType + "Tic.txt"

    lastTime = 0
    lastFilePath = "#"
    if imageDirectory and imageDirectory != '#':
    fileList = os.listdir(imageDirectory) #列出目录下的所有文件和目录
    for line in fileList:
    filepath = os.path.join(imageDirectory,line)
    if os.path.isfile(filepath):
    # os.stat(filepath).st_ctime
    lastModifyTime = os.path.getctime(filepath)
    if lastModifyTime > lastTime :
    lastTime = lastModifyTime
    lastFilePath = filepath

    if lastFilePath == "#":
    lastFilePath = "D:\data\SpatialData\default" + analyzeType + ".jpg"

    shutil.copy(lastFilePath, copyTargetPath)
    # Process: Register Raster
    arcpy.RegisterRaster_management(copyTargetPath, "REGISTER", "", inputLinkFile, "POLYORDER1", "")

    # Process: Copy Raster
    arcpy.CopyRaster_management(copyTargetPath, analyzeResult, "", "", "256", "NONE", "NONE", "", "NONE", "NONE")

    # Process: 定义投影
    if analyzeType == 'SatelliteImage':
    projectName = projectNameSatelliteImage
    elif analyzeType == 'WeatherRadar':
    projectName = projectNameWeatherRadar
    elif analyzeType == 'WaterReport':
    projectName = projectNameWaterReport
    else:
    projectName = projectNameSatelliteImage

    arcpy.DefineProjection_management(analyzeResult, projectName)

    arcpy.SetParameterAsText(1, analyzeResult)

  • 相关阅读:
    dubbo-Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
    sqlmap基本命令
    Read-Only Tables 只读表
    Oracle Set操作
    OGG-00664
    Oracle 附加日志(supplemental log)
    Oracle 数字转为字符串 to_char()
    Oracle单引号转义符
    OGG开启DDL,约束信息和索引信息会同步过去吗
    OGG-01161
  • 原文地址:https://www.cnblogs.com/gispathfinder/p/5693827.html
Copyright © 2011-2022 走看看