Child pages
  • Viewing fisheries acoustic transects and echograms
Skip to end of metadata
Go to start of metadata


This page describes how to plot fisheries acoustics transects from a NIWA WFS service and view echograms of the transects using a QGIS "Action". It is intended for researchers and anyone interested to see where fisheries acoustic surveys (the transects lines) have been carried out and to view the acoustic echogram for a selected transect. NIWA is also working on a website with similar functionality, for similar direct access to the maps of transects and echograms without using QGIS.

Note that the underlying acoustic transect dataset is a subset of all transects undertaken by NIWA. Commercially sensitive and some recent echograms are not included.


To make a useful QGIS map, we need some sort of background to display the transect lines on, In this instance, we will download and use a regional bathymetry map from NIWA. This does not provide coverage of the wider New Zealand area, including Antarctica, but is good for around New Zealand.

In a web browser, go to:  Select your user sector, tick agree (if you do) and click Submit.

Download two files from the NIWA Regional bathymetry, the ESRI shapefile (contour lines) and the ESRI ascii grid (QGIS can also display the binary grid if you prefer that). Unzip these ready for QGIS to open. NIWA created the EPSG:3994 (Mercator 41) Coordinate Reference System (CRS),and recommends it for displaying data in the NZ maritime region in any GIS application.

Open a new raster layer - the .asc file from the unzipped ascii grid file. This is a grid of the NZ region, with each cell storing the depth. QGIS will display this as a grayscale layer - you need to change the layer style to a more appropriate colour map.

Choose the layer Properties -> Style

Change the render type to Singleband pseudocolor and choose a suitable colour map - such as GnBu.

You can apply the style as you prefer, or download and install a new colour ramp (see: Find additional colour ramps). This example uses the GnBu colour  colour ramp, with 10 bands applied to an equal interval distribution, using the full min/max range, with reduced colour saturation. Make sure you click Classify to apply the colour ramp to the layer data, then click OK. You should finish up with something like:

You can now add some bathymetry contours - add a new shapefile vector layer (on top of the bathymetry raster - the shapefile you downloaded and unzipped above. This has contours at very close intervals for this sort of map, so apply a filter to just display contours at selected depths, as below.


Note that if you have alternative context maps (such as the GEBCO WMS service) feel free to use these instead of the NIWA downloads.


Now we overlay the WFS service of fisheries acoustic transect lines. NIWA provides this service as part of its Open Data programme, in association with the Ministry for Primary Industry. There are four layers provided by this service - you must use use TransectAll_180 in this map. It has over 16,000 transects, so can take a few seconds to load.

The WFS service URL is:


With the background layers and the WFS layer TransectAll_180 opened, you should see a map looking something like the one below (left). If you zoom in, for example to the NE Chatham Rise, you will see sets of short transects centered on a pint, like spokes on a wheel (middle) - these are small undersea hills, generally old volcanos, that commercial fish species like orange roughy and oreos often school around. There are also echograms of hoki associated with canyons, like Cook Strait (right) and the Hokitika Canyon.


One of the tools provided in QGIS, is the Actions tool (originally developed by Gavin Macaulay at NIWA some years ago). This allows you to have QGIS issue a system command, with parameters passed from the feature in the map that you click on. In this example, one of the data fields associated with each transect is the "Atlas ID". Atlas is NIWA's image management library. Atlas has a web based tool allowing you to request an image, given the Atlas ID of the image. This describes how to create an Action which will retrieve the echogram image for the transect you clicked on in QGIS. You should ensure you do not click on the map over a point with many transects crossing - QGIS will iterate through them all, retrieving and displaying each image.



Create the QGIS action to retrieve and view echograms.

Generally a Linux system will have a tool like Eye of Gnome (or Eye of Mate) already installed on your computer. You can use any image viewer that accepts a URL as well as a local file as the image to display. On my Linux Mint system, the command is eom (for Eye of Mate).

Windows users can use Media Player, or Chrome, or another image viewing application. I'll show how to use Media Player here.

in QGIS open the Properties dialogue for the transect layer and select Action.

The "Type" of action is Unix (for a Linux system) or Windows (for any MS Windows system).

The name I've given it is "echogram", the command the action sends depends on your operating system & preference (cut and paste the appropriate one below):

Linux: xviewer "[% "atlas_id" %]&SERVICE_REQUEST_PASSKEY=public"

Windows: "C:\Program Files (x86)\Windows Media Player\wmplayer.exe"  "[% "atlas_id" %]&SERVICE_REQUEST_PASSKEY=public"

Add the Action to the Action list and click OK.

On Linux this starts the eom program (my image viewer), or on Windows it starts the Windows Media Player, passing it a URL pointing to the NIWA Atlas image library as the place to find the image to display. The URL is an instruction to Atlas to send the image with the specified image ID. The string '[% "atl;as_id" %]' is an instruction to QGIS to inert the value of the "atlas_id" field into the URL, which it gets from the feature you click on, before QGIS sends the command.

So, what happens is, you zoom in to select a transect, select the action tool (and the echogram action), click on a transect, QGIS gets the "atlas_id", inserts this in the command, issues the command and the system carries out the command. In this case, in an undersea canyon, you get:

Generally the echogram will show the seabed and schools of fish close to the seabed and/or in mid-water.


As always, QGIS provides more than one way to do things. On the TransectAll_180 layer, with the "Info" tool selected, you can click on a transect to highlight the selected transect and open window showing metadata about the transect - the trip, client, target species (eg: HOK for hoki, ORH for orange roughy), etc. This window also has an Actions button, allowing you to start the action for the selected feature from here, as well as via the toolbar Action button. Note that there is no assurance that the fish marks on an echogram are of the target species, often several species may occur in schools on the same transect.

The Action button on the QGIS Info window.


There are over 16,000 transects and echograms available.