Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using QGIS, GRASS and PostGIS to answer some difficult questions

Similar presentations


Presentation on theme: "Using QGIS, GRASS and PostGIS to answer some difficult questions"— Presentation transcript:

1 Using QGIS, GRASS and PostGIS to answer some difficult questions
How Open Source GIS can help make your life easier and help you find beer on a Sunday

2 PostGIS An extension to PostgreSQL A decendent of InnoDB, like MS SQLServer Highly extendable Pre-made extensions like PostGIS add new fuctionality Make your own: aggregates, extensions, datatypes Interfaces for many programing languages such as PL/Sql, PL/Python, PL/Perl, PL/R, PL/C Open Source license with corporate support from EnterpriseDB and other devlopers available if needed Stores spatial data and allows SQL queries to be run against the data Supports vector and raster data, topology just added with 2.0 release 2D / 3D vector data types are available, M values available as well Vector data can be stored as Geometry or Geography

3 A simple spatial query Simple spatial query. This shows all of the USGS populated places that intersect Vanderburgh County’s boundary. First column is the name, the second column is a Hexadecimal representation of the point. That hexadecimal number represents the Geometry type, projection, and X/Y value of each point. Other databases have this capability, MS-SQL has since 2008, Oracle has spatial Capability at the full Enterprise license level.

4 QGIS Open Source GIS application Opens nearly any vector or raster dataset thanks to OGR/GDAL libraries Wide range of analysis tools both built in and available from 3rd party plugins Runs on all modern desktop platforms, a version is available for Android devices as well GRASS Developed in the 1980s by the Army Corps of Engineers Initially used to do environmental impact studies at Fort Hood Currently Open Source Used as analysis engine for many other OSGeo projects A bit tricky to use as a stand alone app due to somewhat non-intuitive interface Uses OGR/GDAL to import wide range of data formats However, only works directly on its own internal format GRASS's vector format uses topology Some of the best 3d analysis software available Great for hydrological modelling and viewshed analysis

5 Vector data types available through OGR
GDAL / OGR Opens pretty much any GIS data format, raster or vector Libraries available to almost any GIS software, used by QGIS, GRASS, even ESRI software Can also be used as a stand alone via the command line, makes batch operations such as conversions or merges easier

6 Where's the beer?

7 Used the Brewer's Guild of Indiana website to get names and address of breweries around
the state. Used a Ruby script to pull that information from the site and put it into a CSV file that could be imported into a Postgres Database

8 Geocode Query Took the addresses and ran them through the TIGER Geocoder extension. An extension to PostGIS, it consists of a data downloader and a geocoder The downloader sets up batch files that allow you to download TIGER data f or states you select. Data is downloaded as zipped shapefiles, by county per state. The script unzips the zip files, and uploads the shapefiles into your PostGIS database. The geocoder parses address and returns a normalized address, a confidence rating value (the lower the better), and a point geometry in NAD83 long / lat. Above query geocodes address from the brewery table, and reprojects the geometry as UTM16N, via EPSG code.

9 QGIS and the GRASS Plugin
Using the QGIS's GRASS plugin Simplifies setup of GRASS projects Simplifies import of PostGIS data into GRASS

10 GRASS’ Vector to Raster Tool
Take the imported vector layer, convert to raster Run raster through r.grow.distance

11 r.grow Output Run raster map through r.grow.distance
Resulting dataset shows the greatest distance to a brewery is 58.3 miles.

12 Counting all Hoosiers Who Live Within Five Miles of a Microbrewery
SELECT Round(Sum(c.pop10*(ST_Area(ST_Intersection(c.geom, z.the_geom))) / c.totarea)) FROM (SELECT ST_Union(ST_Buffer(b.geom, )) as the_geom FROM breweries.brewery b) as z, indiana.block_pop c WHERE ST_Intersects(z.the_geom, c.geom); Counting all Hoosiers Who Live Within Five Miles of a Microbrewery Query starts by creating a 5 mile buffer around each point and unions those buffers into a single multi polygon. Then it checks to see if a census block intersects the buffer. If it does then it takes a percentage of the area of a population block covered by the buffer and multiplies it by the population in that block to get a weighted average. So if a block has 100 people in it, and the buffer covers half of its area it returns a value of 50 for that block. It adds up all resulting population figures, rounds it off and returns a final value of 2,785,000

13 Multipolygon Buffer

14 QGIS Generated Contours
QGIS can generate contours and TINs from raster sources

15 Current OSGeo Limitations
Cartography / Layout Editing Versioned Editing Mr Sid support File Geodatabase support Layouts in QGIS can be difficult, but are improving with each release Creating polygon datasets is tricky with QGIS; miss many ESRI tools that make those tasks easier No versioned editing for PostGIS yet, some small projects are just getting off the ground Mr. Sid files are supported out of the box for Windows installs of QGIS, but require compiling against LizardTech supplied libraries for support on Mac/Linux FGDB support is similar to Mr. Sid, requires compling against ESRI supplied libraries. Some Windows installs support FGDB out of the box

16 Where to go for help PostGIS: Refractions Research
QGIS: QGIS Foundation PostGIS In Action By Leo Hsu & Regina Obe GIS StackExchange Philip Bernard Mapping & Spatial Solutions Where to go for help


Download ppt "Using QGIS, GRASS and PostGIS to answer some difficult questions"

Similar presentations


Ads by Google