8

We are working with different raster datasets, and the pixel coordinates are either stored at the center of the pixel or at one corner. The information is usually provided in the metadata, but sometimes we need to guess and this post illustrates that it is not always easy to find.

As we also produce some layers, I was wondering if there was a standard rule and/or best practices to assign the coordinates for a pixel, ideally with a reference or with pro/cons.

9

This is a bit messy thing. You should read at least this GeoTIFF document

http://www.remotesensing.org/geotiff/spec/geotiff2.5.html#2.5.2.2 and some GDAL considerations

http://trac.osgeo.org/gdal/wiki/rfc33_gtiff_pixelispoint.

As a rule of thumb all rasters (aerial, satellite images) use pixel-is-area and measurement data like DEMs use pixel-is-point. But how it reflects to georeferencing and image extents is unfortunately not so simple. For GDAL the anchor point of the pixel is always at top-left corner of a pixel - if you store a new Ground Control Point (GPC) the given coordinates are always tied to the top-left corner of the corresponding pixel and it does matter if pixels are defined as areas or points. GDAL also reports the same extents for pixel-is-area and pixel-is-point images. It is up to user or software using GDAL to treat them differently if necessary.

The current OGC rule for georeferencing of coverages is to use a grid which is defined in the 437 pages long GML v.3.2.1 specification. That does make half a pixel difference in the location of origin for pixel-is-point and pixel-is-area because in case of area pixels the origin will be set to the middle of a pixel. The following quotation is from GML in JPEG2000 standard:

Note: GMLJP2 follows the definition of grids in GML 3.2.1 [OGC 07-036] clause 19.2.2: “When a grid point is used to represent a sample space (e.g. image pixel), the grid point represents the center of the sample space (see ISO 19123:2005, 8.2.2)”. This corresponds with the pixelInCell value of ImageCRS set to CellCenter as specified in ISO 19111. This can be interpreted as the origin of the RectifiedGrid is the centre point of the corner pixel.

For making things not to appear too simple, some programs like ERDAS imagine (AFAIK) follow internally the pixel-is-point schema as well as MapServer until the next-to-come version 7.0, with trying to change on-the-fly into the pixel-is-area schema. Reading about this: http://mapserver.org/fr/development/rfc/ms-rfc-107.html.

For best interoperability I would recommend to use pixel-is-area and GeoTIFFs for all natural rasters (aerial and satellite images, topographic maps). This is a well-known and thus reliable combination. If you play with DEMs and other measurement/sensor data and half a pixel shift can be meaningful be aware that they may be labeled as pixel-is-point and different programs may or may not introduce the half a pixel shifts.

  • thanks for the answer. didn't you mean pixel-is-point for measurement ? – radouxju Nov 19 '14 at 11:35
  • Sure, corrected now. However, in real life the situation may be different: I just had a look at some GeoTIFF DEM files from couple of countries - all of them have Metadata: AREA_OR_POINT=Area. – user30184 Nov 19 '14 at 11:42
4

Both are common, and neither can be considered entirely standard.

For GeoTIFF, both are possible - see Section 2.5.2.2 for the GTRasterTypeGeoKey that describes the interpretation method. The GeoTIFF FAQ suggests using the default (PixelIsArea) value of that tag for compatibility with older versions of GDAL.

The World File format uses the centre of the pixel.

Image chipping from NITF (using the ICHIPB extension) explicitly encodes the position of the first pixel in the chipped (subset) image as coordinate (0.5. 0.5), and maps that back to a specific coordinate in the parent (superset) image e.g. (2.5, 1.5).

1

I do not know if there is a convention, but coordinates on images normally refer to pixel centres. This can differ in the case of rasters produced from, for instance, computer models.

If you are not sure, you can use GMT, the Generic Mapping Tools, to test you rasters and convert them to some appropriate format, since it explicitly offers the option of specifying either grid or node registration. See this section of the tutorial, and also the manual for the function grdedit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.