I have downloaded DEM data from this page: http://www.viewfinderpanoramas.org/dem3.html. I have written simple program in C++ that takes "bricks" and build resulting height map. Hovewer, I have problem with result. I am using Mercator projection and take every "gps pixel" from DEM data and recalculate its position to real pixels (same for border). It works fine (or at least it seams to).
As you can see on image, there is something weird. That "mess" in lower part is incorrect and I dont know, if data are incorrect, if I am using them incorrect (wrong bricks ?) or something in my program is wrong.

EDIT:
Here is algorithm for reading "bricks" heights:
//iterate all bricks and set its starting coordinates
double startLon = 19;
double startLat = 48;
///-------------------------
int tileSize = 1201;
double step = 1.0 / tileSize;
for (int y = 0; y < tileSize; y++)
{
for (int x = 0; x < tileSize; x++)
{
short height = brick[x + (tileSize - 1 - y) * tileSize];
//tileSize - 1 - y -> reverse brick coordinates
height = swap_endian<short>(height);
if (height == -32768)
{
height = 0;
}
lon = (startLon) + x * step;
lat = (startLat - 1) + y * step;
int pixelX = 0;
int pixelY = 0;
this->helper->ConvertCoordinates(lon, lat, &pixelX, &pixelY);
if (pixelX < 0) { continue;}
if (pixelY < 0) { continue;}
if (pixelX >= this->width) { continue;}
if (pixelY >= this->height) { continue;}
//write it to map
//if multiple height in same pixel, take only last one
this->heightMap[pixelX + pixelY * this->width] = height;
}
}
shorttolongforheight's type? – RomaH Jun 03 '13 at 18:41short(2 bytes / height) – Martin Perry Jun 03 '13 at 18:53