Digitize in GE and Analyze in QGIS

Objective. The purpose of this exercise is to have you create spatial data by digitizing points in Google Earth, and then do some analysis of the point patterns in QGIS. In QGIS, you will experiment with some of the spatial analytic functions under the Vector menu drop downs...
Analysis tools
Research Tools
Geoprocessing tools
Geometry Tools
Data Management

In particular let's take a look at the degree of randomness in the point pattern. (See geographyfieldwork.com/nearest_neighbour_analysis.htm for some background on that.) We'll use Q's nearest neighbor index and interpret indices from 0.0 to about .75 indicate clustering; from .75 to 1.25 suggest randomness; and above 1.25 suggests regular spacing.

What to do:

  1. Pick a theme and a place to study. You might examine for example:
  2. Digitize at least thirty (30) data points for the distribution in Google Earth and save them in a .kml file. (See the how-to notes below.)
  3. Import the .kml data into QGIS as a vector layer.
  4. Calculate some nearest neighbour statistics:
    Vector -> Analysis Tools -> Nearest neighbor analysis
    For you point pattern what are the following numbers:
    Observed mean distance:
    Expected mean distance:
    Nearest neighbor index:
    N:
    Z-score:
    What does that tell you about the randomness of the point pattern?
  5. Calculate the mean center for your points:
    Vector -> Geo Processing Tools -> Convex Hull(s)
  6. Calculate the distance between each of your points and the mean center for your points:
    Vector -> Analysis Tools -> Distance Matrix
    to calculate the "Summary distance matrix"
  7. Calculate the convex bounding hull for your points:
    Vector -> Geo Processing Tools -> Convex Hull(s)
  8. Calculate the Delaunay Triangulation on your points:
    Vector -> Geometry -> Delaunay triangulation
  9. Calculate the Thiessen or Voronoi polygons around your points:
    Vector -> Geometry -> Voronoi Polygons
  10. Extract the nodes from your Voronoi polygons:
    Vector -> Geometry -> Extract Nodes
  11. Calculate the nearest neighbor statistics on those nodes... Are they more or less random than your original points?
  12. Produce a map showing the two point distributions. The map should include a title, both sets of features, and a text box with your name, to print.
  13. A brief (< 1 page) report stating what theme you mapped and whether the original points of the nodes of the voronoi diagram were more random.

Materials. Access to QGIS, the internet, and a web browser.

GIS Data

The world is awash with GIS data available on the web. (See the list at the end of this document for some examples.) These data typically have spatial and attribute components and are provided in GIS-accessible formats such as ASCII text files, shapefiles, and other exchange formats. Some of these data are available through special purpose spatial data servers using specialized web clients (Google Earth is an example) to connect to online databases. Some are expressly in the public domain, and others have proprietary restrictions on their use. GIS data for distribution should come with metadata that describe the data and should help you assess whether the data are suitable for your intended use. Minimally, metadata should identify the coordinate system used for the spatial data and a data dictionary which tells what attributes are included and how they are encoded. Metadata might also include information on data provinence and assessments of its completeness and accuracy.

Digitizing Your Own in Google Earth (is pretty easy!)

Google Earth is amazing for it's ability to provide imagery (and some vector data), but often one wants to record vector coordinates to represent features that one has interpreted from the imagery. Google Earth provides an easy way to do just that. With Google Earth you can capture and export geographic coordinates into .kml, an XML ascii text file format that can be ingested by a number of other GIS applications.

The steps are these:

  1. Get the features you want to digitize on screen in Google Earth.
  2. Clean the unwanted stuff out of the "My Places" node in the table of contents.
  3. Decide whether you are going to digitize the features as points, lines, or polygons.
  4. Choose the tool to digitize points, lines, or polygons as, in GE's vocabulary placemarks, paths, and polygons. (The icons are the second , third, and fourth buttons in the row above image on my screen.)
  5. For each feature, enter an ID or name in the name field, and, if you like, futher attribute information in the description field of the panel that pops up, then click on points that define the features. You can pan and zoom while digitizing in order to better see the thing you are recording. When you've got the data, close the panel.
  6. If you need/want to, you can reopen the panel for a feature and edit its coordinates or attributes by right clicking its name in the table of contents.
  7. Note that you can mix point, line and polygon features under the "My Places" node.
  8. You can also throw-away features by removing their node in the table of contents.
  9. To export the data...
  10. Right click the "My Places" node in the table of contents.
  11. Choose "Save Places as"
  12. Navigate to a directory and supply a file name.
  13. Select .kml rather than .kmz at the bottom of the panel.
  14. Click the "Save" button.
It is that easy to make your own.

QGIS Hints...

Quantum GIS (QGIS) is a free and open source (FOSS) geographic information system (GIS) that is free; runs on MS-Windows, MacOS, and Linux; uses common data file formats; presents a 'typical' point-and-click interface; and provides sufficient spatial analytic capabilities to demonstrate several GIS functions. For this assignment, the data input, data selection and symbolization, and map output functions will be most relevant.

Download and install QGIS. QGIS can be downloaded from www.qgis.org .

Start the QGIS program. Take a few moments to see what is under each menu tab; the names may not make sense at first but reading through them now will make it easier to find things later.

Reading data into QGIS... Reading vector data is in the Menu: Layer -> Add Vector Layer ... (or an icon in the menu bar). In the panel dialog, you will need to navigate to a directory and specify a kind of file to show (e.g., [OGR] KML or SHAPEFILE). Tell it to load the data. You should see the data and an entry in the "TOC" to the left. Reading OSM data requires a plugin. See the section below.

Open the attribute table for your features to explore the data that you have. (Layer:Open Attribute Table) You should see that there are records in the table, for each feature on the map and that you can sort the records on the values in the various fields. You can use the query facility at the bottom of the table panel to select features.

You can export the map as an image file, maybe to add to a document. (File:Save as Image...)

You can set map symbology for your data. In the "TOC" you can check layers on and off, drag layers up and down in the "TOC" so that points and lines appear "on top of" polygons, and can change the colors and symbol sizes for features in layers. There are rudimentary classification tools to produce range-graded graduated color symbols. (Right click the layer in the TOC, choose Properties, then Symbology.)

CRS . When different layers of information are coming from (or are "in") different projections, or coordinate reference systems, you need to enable "on the fly" coordinate conversion, and may need to explicitly set the projection to use for the map display. (Use File:Project Properties:Coordinate Reference System (CRS) tab to select the desired coordinate system for the map display and "check" the "Enable 'on the fly' CRS transformation" if QGIS will need to re-project data sets.

Saving a snapshot of a map from QGIS... from the menu... File:Save as Image will let you save a .jpg (or .bmp etc.) image of the map from your screen which you could then include in a webpage or other document.

The order in the TOC sets the drawing order for layers. You can symbologize the content in each layer, setting line weights and colors (based on data values).

Reading .kml in QGIS

Reading a .kml file, or for that matter many different GIS vector file formats into QGIS is easy.

  1. ...with QGIS open
  2. Use the "Add vector data button", or the menu item... Layer -> Add Vector Layer (or CONTROL + SHIFT + V) to navigate to the panel.
  3. Browse to the directory where your data file is.
  4. Indicate "[OGR] KML" so you can see these types of file.
  5. Select the file, and open it.
  6. The points, lines or polygons from your .kml file should show up in the QGIS display.

At this point, you should be able to work with the geometric and attribute data for your features.

You may want to add further attributes to the tabular data. (toggle editing in the table)

You may want (or even need) to separate point, line, and polygon features for further processing and export to other formats. (Right click the layer in the table of contents and select "Save as..."