1 / 25

I ♥ Maps: quantum Gis + Python

I ♥ Maps: quantum Gis + Python. Paige Bailey August 6 th , 2014. Three W’s of Geography:. What is where? Why is it there? …and why do I care ?. What is a GIS?.

keren
Download Presentation

I ♥ Maps: quantum Gis + Python

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. I ♥ Maps:quantum Gis + Python Paige Bailey August 6th, 2014

  2. Three W’s of Geography: • What is where? • Why is it there? • …and why do I care?

  3. What is a GIS? • GIS = stands for “geographic information system”, “geographical information science”, or “geospatial information studies”, depending on who you talk to • GIS is an ecoystem of computer software; hardware and data; and personnel to help manipulate, analyze and present information that is tied to a spatial location. • Spatial location – usually a geographic location • Information – visualization of analysis of data • System – linking software, hardware, data • People – a user and analyst of all of the above! • What you’re really after are “Smart Maps” – visualizing, manipulating, analyzing, and displaying spatial data, connected to a database.

  4. …and what is A GIS NOT? • GPS – global positioning system (though these do come into play to obtain geographic coordiantes quite often) • A static, unchanging map – paper or digital • Maps are often the product of a GIS, but are just a way to visualize the analysis • The magic comes by separating the variables and making it dynamic • A specific software package, like QGIS or ArcGIS • Estimates are that 80% of all data has some sort of spatial component

  5. Databases aren’t really all that easy to interpret, connections aren’t easy to see:

  6. …but when mapped:

  7. Inputting and Visualizing Data • Raster – like a grid • Pixels • Each pixel has a location and value • Satelite images and aerial photos are examples • Vector – linear • Comprised of points, lines, and polygons • “Features” (house, lake, etc.) • Features have “attributes”: size, type, length, etc.

  8. What is Quantum GIS? • Quantum GIS (QGIS) is an open-source desktop GIS product that helps you visualize, manage, edit, analyze, and compose maps with geographic data. • Runs on Linux, Unix, Mac OSX, and Windows • Supports vector, raster, and database formats – and these formats can be obtained from anywhere • GNU Public License • Written in C++ • Uses the Qt library • Allows integration of plugins developed using either C++ or Python

  9. History and community • Was started in May 2002 • Has a huge user community, and is constantly growing – web site, source code (SVN), bug tracker, and mailing lists are hosted and partially maintained by OSGeo.org • Project Steering Committee – international team of developers and GIS users who each have a specific area of responsibility (development, release management, community resources, finance & marketing) • Ways for you to contribute (if you want): code contributions, bug fixes, bug reports, contributed documentation, advocacy, supporting other users on mailing lists and the QGIS Forum

  10. Some ways that GIS is Used: • Emergency services: -- rescue groups, firefighters, police • Environmental -- monitoring and modeling • Business – site locations, delivery systems, customer locations, “geotriggers” • Industry – transportation, communication, mining, pipelines, oil, health care • Government – local, state, federal, military • Education – research, as a teaching tool, administration

  11. Specific Case studIES • Networking solutions – route optimization, like Google Maps • Ecosystem Management – tracking deforestation, migration of species, endangered species, protected animals and plants • Oil and mineral exploration – three-dimensional visualization with leases, wells • Environmental monitoring of a toxic plume or oil spill • Modeling of social demographics, -- how populations change over time • Facilities mapping – can show where specific areas are in an office building, where trees are on Rice’s campus, where patients are in a hospital

  12. Route Optimization

  13. Species Patterns

  14. Mapping Oil Contamination

  15. Social Demographics

  16. Rice University Tree map

  17. Geological Modeling

  18. Some beautiful examples of qgis maps • https://www.flickr.com/groups/qgis/pool/ • https://www.flickr.com/groups/qgis-screenshots/

  19. Why is python a good fit for qgis? • Clear, readable syntax • Implemented in many languages (C/C++, but also Java’s Jython and .NET’s IronPython) • Can be used to access tons of OSGeo libraries and software • QGIS • PostGIS • GDAL/OGR • GEOS • JTS • GeoTools • Proj4 • Mapserver • gvSIG

  20. What is qt ? And pyqyt? • Qt helps you build graphical user interfaces • Developed by Nokia • Exists in Google Earth, Virtual Box, Skype, Autodesk, Android smart phones, QGIS • Qt is built using the C++ language – supports a number of compilers • PyQt = Python bindings that wrap C++ Qt libraries,. This is great, because it means that we can build Qt applications without learning C++

  21. Qgis + Python • Plugins – can create your own, or install public or private. Allows users to create / extend editing tools that interact with data inside the QGIS environment • Python console – command line terminal inside QGIS that allows you to test out ideas and make quick one-off jobs. Can interact with layers that are loaded into QGIS, access their attributes and geometry • Python scripts and applications – writing applications from scratch that are built off QGIS and Qt libraries (we’re not doing that today)

  22. Playing with the Python Console • Accessing layers • activeLayer() • QgsMapCanvas • Visible layers vs. layers in the order they’re stacked in the table of contents • Loading layers into QGIS • addVectorLayer() – takes three args(path, basename, provider key) • addRasterLayer() – takes two args (path and basename) • Accessing vector geometry • OgsGeometry • Buffer, intersection, combine, difference • Accessing data attributes • What’s the name of the selected feature? • What values does this raster cell have? • How many features meet this filtering requirement?

  23. Installing qgis plugins • [ open up QGIS, show where the plugins are housed] • [install a random public one] • [show how you can investigate the .py files using a terminal window in /.qgis2/python/plugins] • [encourage folks to change parameters and recompile to see how layers change, once they check out Python QGIS Cookbook]

  24. Let’s make a thing!

  25. Questions? Thanks!

More Related