Can't login? ... use the Forgotten your password? link at um.niwa.co.nz
Child pages
  • How to plot a species distribution on a simple map of New Zealand from an Excel file
Skip to end of metadata
Go to start of metadata

This is a very simple step by step guide created by a beginner using QGIS for a beginner using QGIS. It will help you to plot a species distribution exported from the Specify database into an Excel file onto a simple map of New Zealand with some bathymetry lines.

Step-by-step guide

  1. First you will need to find a vector layer for your map.

    A useful NZ and outlying islands inside the EEZ outline can be found here:

    https://data.linz.govt.nz/layer/1153-nz-coastlines-and-islands-polygons-topo-150k/

    You will need to register to download the data layers but it is free and very quick to do.

  2. Open QGIS new project and set your default Coordinate Reference System for this project 

    1. Click on Project in top menu bar

    2. Click on Project Properties

    3. Search for WGS 84 / Mercator 41 EPSG:3994

    4. Enable ‘on the fly’ CRS by ensuring the box is checked.


3.   Add a new vector layer

    1. Click on Layer>Add Layer>Add Vector Layer
    2. Browse to folder of layers that you downloaded from linz and select the .shp file

This plots the outline of New Zealand and the outlying islands:

 

4.    Now to add some bathymetry to our map:

You can download bathymetry layers from the NIWA website:

https://www.niwa.co.nz/our-science/oceans/bathymetry/download-the-data

A useful one for a background map is the New Zealand region 250m gridded bathymetric data set and imagery, CANZ (2008). You can download this as an ESRI shapefile (.shp)

For a wider and more colourful bathymetry the Southwest Pacific Region bathymetry is great and you can download that as a GeoTIFF.

    1. Click on Layer>Add Layer> Add Vector layer
    2. Browse to the .shp file containing the bathymetry that you downloaded from NIWA
    3. It should plot onto the map:


5.  Now to plot simple data onto the map:

    1. Open your excel file and delete out any fields that contain commas (i.e. a comments field).

    2. Save Excel file as .csv (comma delimited text file)

    3. In your QGIS project make sure your coastline and bathymetry layers are plotted ok

    4. Click on Layer>Add Layer> Add delimited text layer

    5. Browse to your .csv file and select it
    6. In the window that pops up click csv for your file format and it should recognise your simple file
    7. Note for this example my latitude and longitude were already in decimal degrees format (ask Brent if you want to try and convert Degrees, decimal minutes format. Do this in excel first! Otherwise for degrees minutes seconds format tick the box DMS coordinates)
    8. QGIS should also automatically recognise which are the columns with your latitude and longitude (if not, then type in the column header for the data you want to plot).
    9. Click ok – any problems with the data QGIS will tell you
    10. In the next pop up box you may need to choose Coordinate Reference System: WSG 84  EPSG:4326 for this layer

 

Now your points should plot onto the map nicely:

 This example is all records of Ophiuroidea species in the NIWA Invertebrate Collection Specify database

 

So what if we want to only plot a subset of the data?

6. As an example I want to only show records of a single species, Ophionereis fasciata

    1. In the layer panel on the left hand side, right mouse click the data layer and select properties
    2. In the general layer properties pop up box scroll down and click on Query Builder
    3. In the Query Builder box double click on the Field name that contains the species you want to plot. In this case it is “Full_taxon_name”
    4. Click on All in the values box to bring up a list of all of the values contained in that column of your data
    5. Select = in the Operators panel
    6. Scroll to and select the species and genus taxon name in the values box or type in the species name in single quotation marks
    7. Click test to check how many rows of data this will display
    8. Then click ok
    9. Click ok to close the query builder
    10. Click apply and ok to close the properties box

The data plotted is now only the species Ophionereis fasciata:

I also changed the colour of the islands to green and the points to red:

  • Right-click on each layer and click on Properties menu
  • Click on the style tab and select the colour and symbol for your marker

7. This is rather a lot of bathymetry so to plot only a few bathymetry lines on the map, for example 50 m, 100 m and 500 m:

    1. Right-click on bathymetry layer, select Properties, click on the Query builder
    2. Double-click on “DEPTH” and the = button
    3. Click to show All layers
    4. Double-click on the depth contour you want to plot on the map
    5. Click OR, then select the next depth etc…
    6. Click test, Ok, apply and OK

Zooming into the map near Wellington looks like this:

 

And my final map with just a single species, just a few bathymetry lines, and some nicer colours for the land and data points looks like this: