CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
|
Various GIS-related functions, requires GDAL. More...
#include <assert.h>
#include <iostream>
#include <cmath>
#include <cfloat>
#include <gdal_priv.h>
#include <ogrsf_frmts.h>
#include "cme.h"
#include "simulation.h"
#include "coast.h"
#include "raster_grid.h"
Go to the source code of this file.
Various GIS-related functions, requires GDAL.
Note re. coordinate systems used
We assume that the grid CRS and external CRS have parallel axes. If they have not, see http://www.gdal.org/classGDALDataset.html which says that:
To convert between pixel/line (P,L) raster space, and projection coordinates (Xp,Yp) space Xp = padfTransform[0] + padfTransform[1] + padfTransform[2]; Yp = padfTransform[3] + padfTransform[4] + padfTransform[5];
In a north-up image, padfTransform[1] is the pixel width, and padfTransform[5] is the pixel height. The upper left corner of the upper left pixel is at position (padfTransform[0], padfTransform[3]).
Usually, raster grid CRS values are integer, i.e. they refer to a point which is at the centroid of a cell. They may also be -ve or greater than m_nXGridSize-1 i.e. may refer to a point which lies outside any cell of the raster grid.
Definition in file gis_utils.cpp.