kevin surbella, ma, gispgis3.oit.ohio.gov/ogripweb/ohiogis/2017/... · python + qgis + qt = field...

37
Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS & Columbus State Ohio GIS Conference Hyatt Regency Columbus September 25 27, 2017 Columbus, Ohio

Upload: others

Post on 15-Jul-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

Python + QGIS + Qt = Field Data Collection App

Kevin Surbella, MA, GISP

GIS Manager & Adjunct Instructor

IJUS & Columbus State

Ohio GIS Conference

Hyatt Regency ColumbusSeptember 25 – 27, 2017

Columbus, Ohio

Page 2: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

Presentation Overview

I. Intro/Why?

II. What are Python, QGIS, & QT?

III. How to build collection app?

IV. Use Cases

Page 3: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

Intro/Why?

IJUS who we are:

o Provide services for electric utility and

telecommunication industries

o Engineering design

o Joint Use

o Field Services

o Project Management

ijus.net

Page 4: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

Intro/Why?

Python + QGIS + Qt

1. Existing software not

ideal

2. Hardware

3. Free/open source

ijus.net

4. Smart form logic

5. Quick development cycle

Page 5: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

What are Python, QGIS, & QT?

Page 6: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

What are Python, QGIS, & QT?

Python – programming

language

QGIS – GIS desktop software

QT – Cross platform IDE for

creating form based

applications

ABCDQGIS

cutie?

Page 7: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

What are Python, QGIS, & QT?

Python

o Easy to read and

understand

o Code with less lines

o Got resources?

Page 8: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

What are Python, QGIS, & QT?

QGIS

o Free to use

o Desktop & field app

o Extend with python

o Robust

Page 9: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

What are Python, QGIS, & QT?

QT (Designer)

o Drag and drop

o Set parameters

Page 10: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Page 11: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Default method not ideal

o No validation

o No auto fill

o No customization

Page 12: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Open Qt Designer

*App located:

C:\Program Files\

QGIS 2.18\bin\

designer.exe

Page 13: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Add Controls

Page 14: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Create python file

Page 15: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Life as a developer

challenges

Page 16: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Adding python logic

…living with failure error

Page 17: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Adding python logic

Page 18: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Adding python logic

Imports

Page 19: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Adding python logic

main (first fun. called)

Page 20: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Adding python logic

Define control objects

Page 21: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Adding python logic

Control events (call validate)

Page 22: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Adding python logic

call Populate x/y

Page 23: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Adding python logic

Validate

Page 24: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Adding python logic

Update x/y

Page 25: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Adding python logic

Page 26: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Configuring project

o Simplify user interface

o Add domain

o Connect edit form and

python file

Page 27: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Configuring project

Page 28: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Test it!

Page 29: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

almost there!

Page 30: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

How to build collection app?

Enable GPS

*in QGIS use GPS

Information Panel

Page 31: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

Use Cases

Page 32: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

Use Cases

audit form

Page 33: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

Use Cases

audit form

Page 34: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

Use Cases

data commit

login form

Plugins

Page 35: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

Conclusion

Page 36: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

Conclusion

o If you have the hardware (windows based)

o Easier development path, low learning curve

o Save some cash!

Python + QGIS + Qt = Field Data Collection App

Saving the world one button at a time

Page 37: Kevin Surbella, MA, GISPgis3.oit.ohio.gov/OGRIPWeb/OhioGIS/2017/... · Python + QGIS + Qt = Field Data Collection App Kevin Surbella, MA, GISP GIS Manager & Adjunct Instructor IJUS

That’s all, thank you!!

Questions?

ijus.netcscc.edu

[email protected]