Using Python as the third GIS: entry procedure-stargui.py

Source: Internet
Author: User

"""
GUI start file for space-time analysis of regional Systems
#STARS的图形用户界面入口 (advanced users can operate directly by using the command line method)
----------------------------------------------------------------------
AUTHOR (S): Serge Rey
Mark v. Janikas
Boris Dev
----------------------------------------------------------------------
Copyright (c) 2000-2006 Sergio J. Rey
======================================================================
This source code was licensed under the GNU general public License,
Version 2. See the file COPYING for more details.
======================================================================

Overview:

Top module for stars GUI. All modules should is imported into the This module.
Methods can attached to menu callbacks.
#顶层程序, the file needs to be run in a unified directory with other calling files

"""

Import sys, OS, string
From Tkinter Import * # widget Classes
From guimixin Import * # mix-in methods
From guimaker Import * # frame, plus Menu/toolbar Builder
From Numeric Import *
Import Pickle
Import Os.path
Import version
Import time

Version = version. VERSION
Versiondate = version. DATE
#以上为系统自带的包

From Stars Import *

Import ESDA
Import Markov
Import inequality
Import Mobility
Import Data
Import Markov
Import EDA
From table Import table as Rtable
From the history import *
From Sdialog Import *
From PDF Import *
Import Help
Import Dataviewer as DV
From Kmean import Kmeans
Import Sdialogue as SD
Import Utility
Import starssmoothing as Smooth
#以上为stars目录下的包

Starshome=options.getstarshome ()
Platform=options.getplatform ()
Sstop = Tk ()
Sstop.title ("Welcome to Stars!")

Ss=splashscreen (Master=sstop)
#启动欢迎界面

# view Modules
From Gview Import *

Class Sproject (Project):
...

Class Sbroadcast:
...

Class SMap (Map,sbroadcast):
...

Class STable (Table,sbroadcast):
...

Class Smoranscatter (Moranscatter,sbroadcast):
...

Class Sdensity (Density,sbroadcast):
...

Class SCDF (Cdf,sbroadcast):
...

Class Shistogram (Histogram,sbroadcast):
...

Class Stimeseries (Timeseries,sbroadcast):
...

Class Sboxplot (Boxplot,sbroadcast):
...

Class Spacetimebuttonmatrix (View):
...

Class Stimepath (Timepath):
...

Class SPCP (PCP):
...

Class App (Guimixin, Guimaker): # or Guimakerframemenu
"" "Application Level Class" "
#其中包含菜单定义与操作
...

if __name__ = = ' __main__ ':
Import Tkinter
Import Sys
main = APP ()
Main.disablemenus ()
If Len (sys.argv) = = 1:
Main.mainloop ()
Sys.exit ()
Else
# below here is wrapper functions for Shell
Def openproject ():
Main.openproject ()

def example ():
Main.example ()
DEF catalogue ():
Print Main.project.catalogue ()
Def matrixnames ():
Print Main.getmatrixnames ()
Def openproject ():
Main.openproject ()
def getvariable (name):
return main.project.getVariable (name)
def map (Variable,t=[0]):
T=T[0]
title = "%s%s"% (Variable.name,variable.timestring[t])
coords = Main.project.coords
Poly2cs = Main.project.poly2cs
Cs2poly = Main.project.cs2poly
Main.drawmap (Title,coords,variable[:,t],variable.name,t,
Poly2cs,cs2poly)

        def boxplot (variable,timeperiod = [0]):
             t = timeperiod[0]
             x = variable[:,t]
            Sboxplot (Variable.name,main.project,main.master,
                     x= x,
                     csids = Range (len (x)),
                     tsids = [t ],
                     allx = variable)

def density (variable,timeperiod = [0]):
T=TIMEPERIOD[0]
yall = variable
Tsids = [t] * yall.t
Sdensity ("Density", Main.master,
Main.project,y.name,y[:,t],csid=range (len (y)),
TSID = Tsids,
title = "Dtitle", Xlabel=yall.name,
Xmin = None,
Xmax = None)
def quit ():
Main.master.destroy ()
Sys.exit (0)
Def disablemenus ():
Main.disablemenus ()

Using Python as the third GIS: Entry procedure-stargui.py

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.