24
OpenOceanMap: Deploying cross-platform geospatial desktop applications for decision support utilizing Python, QGIS, and QT Presented at FOSS4G 2007 by Aaron Racicot – GIS Programmer, GISP Ecotrust (www.ecotrust.org) [email protected]

OpenOceanMap :

  • Upload
    ahanu

  • View
    22

  • Download
    0

Embed Size (px)

DESCRIPTION

OpenOceanMap : Deploying cross-platform geospatial desktop applications for decision support utilizing Python, QGIS, and QT Presented at FOSS4G 2007 by Aaron Racicot – GIS Programmer, GISP Ecotrust (www.ecotrust.org) [email protected]. Socio-Economic Data - MLPA. - PowerPoint PPT Presentation

Citation preview

Page 1: OpenOceanMap :

OpenOceanMap:Deploying cross-platform geospatial desktop

applications for decision support utilizing Python, QGIS, and QT

Presented at FOSS4G 2007 by Aaron Racicot – GIS Programmer, GISP

Ecotrust (www.ecotrust.org)[email protected]

Page 2: OpenOceanMap :

Socio-Economic Data - MLPA

Page 3: OpenOceanMap :

Decision Support Pattern

Field Data Collection

Data Analysis

QA/QC/Feedback

Inform Decision Makers

Field Work Back at the Office

Page 4: OpenOceanMap :

Old Version of Tool

Page 5: OpenOceanMap :

New Version of Tool

Page 6: OpenOceanMap :

Being Developed in the Open

Page 7: OpenOceanMap :

Why Open Source?

CostFreedom

CommunityGet Good Karma

Opportunity to innovateVery Fast Development Cycle

Very Low Barrier To Dev Community Entry

Page 8: OpenOceanMap :

Tools Used

PyQTPyQGIS

Page 9: OpenOceanMap :
Page 10: OpenOceanMap :

Requirements to build

QGIS 0.9+

QT 4.3+

SIP 4.7+

PyQT 4.3+

OpenOceanMap 0.1+

Py2Exe/Py2App

NSIS Installer

Page 11: OpenOceanMap :

QT and QGIS API exposed

# PyQt4 includes for python bindings to QT

from PyQt4.QtCore import *from PyQt4.QtGui import *

# QGIS bindings for mapping functions

from qgis.core import *from qgis.gui import *

Page 12: OpenOceanMap :

Windows inherit from QT

# Main window used for houseing the canvas,# toolbars, and dialogs

class MainWindow(QMainWindow, Ui_MainWindow):

def __init__(self,splash): QMainWindow.__init__(self)

# required by Qt4 to initialize the UI self.setupUi(self)

Page 13: OpenOceanMap :

Create a map canvas from QGIS

# create map canvas

self.canvas = QgsMapCanvas(self)self.canvas.setCanvasColor(QColor(255,255,255))self.canvas.enableAntiAliasing(True)self.canvas.useQImageToRender(False)self.canvas.show()

Page 14: OpenOceanMap :

Hook up simple tools…Zoom In

# create a little toolbar for map toolself.toolbar = parent.addToolBar(“MapTool")self.toolbar.addAction(parent.mpActionZoomIn)

self.toolZoomIn = QgsMapToolZoom(self.canvas,False)self.toolZoomIn.setAction(parent.mpActionZoomIn)

# Connect the button signal to a slotQObject.connect(parent.mpActionZoomIn,

SIGNAL("triggered()"), self.zoomIn)

# Signal handler for zoom in buttondef zoomIn(self):

self.canvas.setMapTool(self.toolZoomIn)

Page 15: OpenOceanMap :

Embedded Python Interpreter

Page 16: OpenOceanMap :

Bundle it all up… py2exe

from py2exe.build_exe import py2exefrom distutils.core import setupopts = { "py2exe": { "includes": ["sip"], "packages": ["qgis","PyQt4"], "dist_dir": "bin", }}setup(options = opts, console=[{"script": "openoceanmap.py"}] )

C:\openoceanmap>python setup.py py2exe

Page 17: OpenOceanMap :

OpenOceanMap

Page 18: OpenOceanMap :

Post Interview - Raw Shapes

Page 19: OpenOceanMap :

Post Interview - Sum

Page 20: OpenOceanMap :

Other parts… QA/QC

Field Data Collection

Data Analysis

QA/QC/Feedback

Inform Decision Makers

Field Work Back at the Office

Page 21: OpenOceanMap :

User Driven QA/QC…

Page 22: OpenOceanMap :

Other parts of the process…DST’s

Field Data Collection

Data Analysis

QA/QC/Feedback

Inform Decision Makers

Field Work Back at the Office

Page 23: OpenOceanMap :

What else am I doing…DST’s

Page 24: OpenOceanMap :

Where to go for more infoEcotrust

http://www.ecotrust.orgReprojected

http://www.reprojected.comOSGeo

http://www.osgeo.orgOpenOceanMap

http://trac.infodrizzle.org/openocean/PyQGIS

Bindings - http://wiki.qgis.org/qgiswiki/PythonBindings API - http://svn.qgis.org/api_doc/html/classes.html QT API - http://doc.trolltech.com/4.3/index.html PyQT Docs - http://www.riverbankcomputing.com/Docs/PyQt4/pyqt4ref.html SIP Docs - http://www.riverbankcomputing.com/Docs/sip4/sipref.html

Desktop QGIS - http://qgis.org/ GRASS - http://grass.itc.it/ OSSIM - http://www.ossim.org/ UDIG - http://udig.refractions.net/ JUMP – http://jump-project.org/

Tools PostGIS - http://postgis.refractions.net/ GDAL/OGR - http://gdal.maptools.org/ PROJ.4 - http://proj.maptools.org/ R-Statistics - http://www.r-project.org/ GMT - http://gmt.soest.hawaii.edu/