Monday, 19 September 2016

Latitude-longitude Coordinates In Anatrack Ranges

The issue of location coordinate systems comes up a lot in various guises so I thought I would post to the neglected Ranges blog with talk of these and how to convert, within the application, latitude-longitude coordinates to a usable system.

The key point is that, in Ranges, you must use a coordinate system that uses metres and not latitude-longitude degrees! To explain briefly: trigonometry, which Ranges uses heavily to do its calculations, will only run in a Euclidean coordinate system, one where n ticks in the x direction covers the same distance as n ticks in the y direction. Lat-long coordinate systems are not Euclidean not only due to the strange shape of the Earth but because e.g. three degrees of longitude covers a different distance depending on the latitude.

Lat-long coordinates are easily converted to a Euclidean system in metres, the standard system used is Universal Transverse Mercator (or UTM). It is possible that the device you used to collect the lat-long data also collected the UTM data but, actually, there are some advantages to using the new lat-long converter in Ranges as it will retain the UTM grid and allow easy conversion back to lat-long for direct display on Google Maps, for example, or export to KML.

The converter works when you import data. To import the lat-lng data you will first need it in a format Ranges understands which is tab or space delineated columns (one of the Excel output format options). I have created a sample data file with three columns (ID, Lat, Lng) containing some random locations around the Devon coast near to where I live.

Then I clicked import in Ranges, lined up the column headers with the Ranges Attribute (remember E=lng, N=lat!) and selected latitude-longitude to utm towards the bottom (lots more you can do here to collect more relevant data). Most data from GPS devices has a WGS84 ellipsoid but you might want to check yours. The import screen look like this:


Note that because Devon is west of the Greenwich Meridian, the longitudes are negative; coordinates in the southern hemisphere will have negative latitudes. I saved the data as a .loc file and can now view it in Ranges:


You will see the locations have large eastings and northings, now perfect for analysis. Next, I ran Convex Polygons 50/75/95:


If you now click modify you will see the edge file has been saved with the UTM zone data, retrieved during the loc data import:


This means that the edge graphics can be immediately viewed in Google Maps, clicking the Google g in the Ranges map display window:

Tuesday, 10 March 2015

Learning about analysing animal radio-tracking data

Very large numbers of papers have been written on this topic, but some useful simplification is available. The second paragraph of the introduction to Location Analysis in the Ranges tutorial contains two references which remain very comprehensive sources despite their age. The 2001 Manual for Wildlife Radio Tagging is now available also in e-format; this book is compared with another edited by Millspaugh & Marzluff (2001) that focuses on analysis approaches.

The second reference in the Ranges tutorial is a 2001 paper, but for an updated (and similarly concise and citation-rich) review of home-range analysis, just click the Review Of Home Range Analyses. The Tutorial Link (left column) gives you a good idea of what is in Ranges 9, and the Demo Tutorial gives an idea of what the software is like to use if you first download the free Demo of Ranges 9 which operates for either Windows or Apple Mac computers.

Thursday, 19 June 2014

Location Analysis

The ability to display results in a fancy way are all fine features of Ranges 9 but it is nothing if it cannot perform analyses to produce these results in the first place. The new version of the software can now run analyses, and there is a new Location Analysis screen to start this off.

The new screen is functionally similar to the one in Ranges 8. You click to choose a particular location analysis from the list then choose the files that are required. Option boxes appear according to the analysis chosen and the user must select those relevant to his investigation. Particular ranges and locations can be selected for analysis (we have already seen the new selection screen) and there are a few options pertinent to output files created. Hints for the user appear at the bottom of the form as they used to and he is unable to run the analysis until all required files and settings are specified.

But the form has had the Ranges 9 make over. All controls have a consistent size and shape. They have relevant labels with the correct capitalisations and, as they appear, the controls are positioned neatly one above the other.

The analysis window is a popup but it is not "modal" i.e. buttons on the main interface still respond when the analysis window is open. This means you can choose a different analysis window or click to view the statistics without closing the current analysis.

The new location analysis dialog

Friday, 2 May 2014

Background Images

Often researches have a map or satellite image, a jpeg or bitmap, of the area that the tracked animal has travelled over. In this case, it is extremely useful to be able use this image as background for visual analysis and for figures in reports.

Ranges 8 allows background images but the alignment implementation is very basic. It insists only on two coordinates, the top right and bottom left corners of the image, which is not enough to allow for all the possible distortions:  rotation, shear, scale, and translation. This can be handled by applying an affine transform to the image and for this we need four coordinates.

Ranges 9 gathers these coordinates with a clever new interface. The user loads the image and it is displayed with four markers defining the points on the image. He moves the markers by dragging them into a position on the image that he know the real world coordinate of, then enters these coordinates into the panel against the marker.

The image alignment dialog

Users can drag to scroll and select areas to zoom as well as panning and zooming with the familiar controls, just as they can with the new graphics screen.

Zoomed in to the second alignment marker
Aligned images are saved along with the alignment points in a new file type .ima.These can then be loaded as the background to a location or edge file.

The image as background for an edge file

Thursday, 6 March 2014

Location File Subsampling

Knee deep in location sub sampling today. This is where you can save a sample of a location file, functionality accessed through the modify button then clicking OK and Sample (I think this is a little awkward and would love to hear suggestions for a more obvious place).
In order to get this working, I have written a new version of the Selection screen, one with neatly laid out controls and consistent styling. The functionality remains the same but I have found a bug: if more than one LAV selection is specified e.g. both Activ and Day in the blackbird loc file, only the last selection is applied. This is now fixed!

The new selection screen

Friday, 21 February 2014

Editing Data

Most data used in Ranges will have been created by another tool, a telemetry recorder for location data, perhaps a GIS for vector or raster backgrounds. But there will be occasions where it is necessary to edit data, maybe even create a simple vector file from scratch and for this reason Ranges comes with simple editing tools.

Ranges8 has always allowed users to add locations and draw shape files by clicking on the display and by adding coordinates to the data grids. Ranges9 will also contain this functionality but due to the improved navigation functionality ("drag to position" in particular, users will now press the CTRL button (in draw mode, the cursor changes to a pen) before clicking on the display to create the coordinates.

I has long been possible to tweak rasters by changing the number representing a category in the grid that represents the raster  "pixels". Ranges9 improves on this by allowing users to select the category in the category list and clicking on the raster pixel to be edited on the graphical display. This makes raster editing much more convenient.

Note that shapes and raster points can also be selected, meaning they are highlighted in the data grids and on the display itself, though this now requires that the user holds down the shift key while he clicks on the display.

Saturday, 14 December 2013

Navigating The Graphical Display

Ranges9 will host a much improved graphical display for visualising data and results. In previous Ranges versions, this display was square; on the now ubiquitous wide screens this means that, with Ranges maximised to fill the screen, there is empty space to the right of the display. In the new Ranges, the graphics will fill all the available space

Related to this, there will be times when the user is more interested in the numeric data in the grids to the left of the display than in the display itself. If a grid has many columns, it may be too constricted by the default window to be properly readable. For this reason, users will now be able to move the dividing line between the display and the grids, to the right to show more grid, back to the left to increase the graphical display.

The grid panel has been expanded to see more details (at the expense of the graphical output)


On opening a file or on viewing an edge after an analysis, the display area will contain the entire data, it is "zoomed to fit" as other document viewing software would have it. The "zoom to area" feature of old Ranges is also retained by right clicking and dragging the mouse over the area to be zoomed to but there are new zoom in and out buttons and the scroll wheel (or equivalent gesture on laptop mouse pads) can be used to zoom in and out of the current mouse position. Navigating to a detail in the graphical display is also much easier with left/right/up/down buttons and, notably, with click-mouse-and-drag functionality for precision positioning.

But perhaps most crucially, the graphical display has now been optimised to cope with enormous files. Running on a reasonably specced computer Ranges now happily renders vector files containing over a million points and loc files with as many locations; scrolling and zooming into these files is fast and satisfactory. It can also now handle large images as background but there are other improvements as far as images are concerned and a description of these should wait until another post.

One of our users sent a huge shapefile of the Amazon basin in great detail. Here it has been imported as a Ranges vector file and we have zoomed in.


The biggest raster I have to test with is only 1 MB - this loads quickly and is handled with ease by Ranges9. Does anyone have a bigger raster (in Grid Ascii format) that I can try?