[Gdal-dev] question about AsciiGrid
Stephane Routelous
route at cae.com
Fri Apr 15 11:26:43 EDT 2005
Hi,
In our framework, we are encapsulating GDAL.
For all the raster and elevation formats, we define that the value for a pixel is specified at its center.
This means that, when we are accessing a position in the data with a georeference, we interpolate between the 4 pixels around the requested value.
In my code, I put the 4 corners of the dataset into GCP (GDALCreateGCPTransformer) and I'm using GDALGCPTransform to get the pixel as double.
the problem that I'm facing is for asciigrid.
In an elevation data (asciigrid or dted), the pixels are representing a posting point, and not a surface.
This means that outside the box defined by the lowerleft and the upperleft postings, the data is not defined.
For a DTED, all is fine, because a dted posting is defined a the lowerleft corner of the pixel.
But for the asciigrid, the definition of the pixel posting is
So, if the asciigrid is defined with xllcenter and yllcenter, asking for a pixel between [0,0.5[ or ]nXSize-0.5,nXSize] returns an undefined value (same for y).
in the case where the asciigrid is defined with xllcorner/yllcorner, the undefined values are from ]nXSize-1,nXSize]
In my framework, I change the georeferenced bounding box to take in account this 1/2 pixel deplacement.
But for asciigrid, I need to know if the asciigrid is defined with xllcenter/yllcenter or xllcorner/yllcorner.
Is there a way to get this information, once I have the GDALDataset ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20050415/c7361108/attachment.html
More information about the Gdal-dev
mailing list