码迷,mamicode.com
首页 > 其他好文 > 详细

更新定时生成等值面数据

时间:2016-08-17 13:38:55      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:

# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# updateIsosurface.py
# Created on: 2014-06-12 09:49:56.00000
# (generated by ArcGIS/ModelBuilder)
# Description:
# ---------------------------------------------------------------------------
# Import arcpy module
import os
import httplib
import urllib
import threading
import time
import datetime
urlInfo = "127.0.0.1"
portInfo = 8888
addressInfo = "/watf/gisAction.jsp?method=isoAnalyzeTask"
startTime = 2014-08-20 08:00:00
endTime = 2014-08-20 08:00:00
sleepTimeSpan = 60 / 4

#
timeInfo = datetime.datetime.strptime(startTime, %Y-%m-%d %H:%M:%S)
timespan = datetime.timedelta(days=1)


def createIsosurface(timeStringInfo, actionInfo, timeSpanInfo):
    para = {action:actionInfo, timeSpan:timeSpanInfo, dateTime:timeStringInfo}
    pageUrl = addressInfo + "&" + urllib.urlencode(para)
    print para
    conn = httplib.HTTPConnection(urlInfo,portInfo)
    conn.request("GET", pageUrl)
    res = conn.getresponse()
    print res.read()
    return
while True:    
    dateTimeStr = timeInfo.strftime(%Y-%m-%d %H:%M:%S)
    # isosurfaceTaskPzh     
    createIsosurface(dateTimeStr, isosurfaceTaskPzh, 1day)
    time.sleep(sleepTimeSpan) # 
    #
    createIsosurface(dateTimeStr, isosurfaceTaskPzh, 10day)
    time.sleep(sleepTimeSpan) #     
    #
    createIsosurface(dateTimeStr, isosurfaceTaskPzh, 30day)
    time.sleep(sleepTimeSpan) #
    #
    # isosurfaceTaskPzhWarn
    createIsosurface(dateTimeStr, isosurfaceTaskPzhWarn, 1day)
    time.sleep(sleepTimeSpan) # 
    #
    createIsosurface(dateTimeStr, isosurfaceTaskPzhWarn, 10day)
    time.sleep(sleepTimeSpan) # 
    #
    createIsosurface(dateTimeStr, isosurfaceTaskPzhWarn, 30day)
    time.sleep(sleepTimeSpan) # 
    #
    # isosurfaceTaskRainfallDeparture
    createIsosurface(dateTimeStr, isosurfaceTaskRainfallDeparture, 10day)
    time.sleep(sleepTimeSpan) # 
    #
    createIsosurface(dateTimeStr, isosurfaceTaskRainfallDeparture, 30day)
    time.sleep(sleepTimeSpan) # 
    #
    # isosurfaceTaskRainfallDepartureWarn
    createIsosurface(dateTimeStr, isosurfaceTaskRainfallDepartureWarn, 10day)
    time.sleep(sleepTimeSpan) # 
    #
    createIsosurface(dateTimeStr, isosurfaceTaskRainfallDepartureWarn, 30day)
    time.sleep(sleepTimeSpan) # 
    #
    # isosurfaceTaskNoRainDay
    createIsosurface(dateTimeStr, isosurfaceTaskNoRainDay, ‘‘)
    time.sleep(sleepTimeSpan) # 
    #
    # isosurfaceTaskSoilMoisture
    createIsosurface(dateTimeStr, isosurfaceTaskSoilMoisture, average)
    time.sleep(sleepTimeSpan) # 
    #
    createIsosurface(dateTimeStr, isosurfaceTaskSoilMoisture, 10cm)
    time.sleep(sleepTimeSpan) # 
    #
    createIsosurface(dateTimeStr, isosurfaceTaskSoilMoisture, 20cm)
    time.sleep(sleepTimeSpan) # 
    #
    createIsosurface(dateTimeStr, isosurfaceTaskSoilMoisture, 40cm)
    time.sleep(sleepTimeSpan) # 
    #
    # isosurfaceTaskSoilWaterRate
    createIsosurface(dateTimeStr, isosurfaceTaskSoilWaterRate, 10cm)
    time.sleep(sleepTimeSpan) # 
    #
    createIsosurface(dateTimeStr, isosurfaceTaskSoilWaterRate, 20cm)
    time.sleep(sleepTimeSpan) # 
    #
    createIsosurface(dateTimeStr, isosurfaceTaskSoilWaterRate, 40cm)
    time.sleep(sleepTimeSpan) # 

    print ------------------------- + dateTimeStr +  End------------------------------
    print -------------------------------------------------------------------------------
    if dateTimeStr == endTime:
        break
    timeInfo = timeInfo + timespan

更新定时生成等值面数据

标签:

原文地址:http://www.cnblogs.com/gispathfinder/p/5779379.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!