3

I've started a new project that involves a ESRI ASCII grid. As far as i know it is a map of Germany or the UK (I'm not sure which one). This is how the header looks like:

NCOLS 8083
NROWS 12952
XLLCORNER -59900
YLLCORNER -58100
CELLSIZE 100
NODATA_value 0

I decided to use POSTGIS to import it into a raster table (I named the table testraster). The import worked smoothly, and I managed to play around with it, using some postgis functions.

For example:

SELECT x, y, val, ST_AsText(geom) FROM (SELECT (ST_PixelAsCentroids(rast, 1, true)).*
FROM testraster WHERE rid = 1) foo;

This select returns all the center points of my cells(cell = a value in the raster). Only the cells that have values are taken in consideration. The very small part of the result looks like this:

x       y       val     st_astext
4955    353 -109    POINT(435550 -51050)
4956    353 -112    POINT(435650 -51050)
4957    353 -112    POINT(435750 -51050)
4958    353 -114    POINT(435850 -51050)
4959    353 -115    POINT(435950 -51050)

This takes me to my question.

How do i know the latitude and longitude of any of these points? What is the equivalent of 435940 and -51050? Or, a more realistic scenario: I'm in Berlin at (52.52001, 13.40495), what is the cell that i should be looking for in my raster?

  • Do you know what co-ord system your original ASCII grid is in? – Matt Jun 29 '16 at 13:29
  • Not really. :|. I just have the file. – Luci0 Jun 29 '16 at 13:44
  • 1
    After using select ST_SRID(rast) from testraster;(This returns the co-ord system) i get the result 0. I think, i have to ask the guys that gave me the file, to tell me what is the co-ord system. – Luci0 Jun 29 '16 at 13:58
  • Use ST_Transform(geom, 4326) – Mike T Jun 30 '16 at 9:10
  • If i run this: select ST_Transform(rast, 4326) from testraster i get ERROR: RASTER_GDALWarp: Input raster has unknown (0) SRID – Luci0 Jun 30 '16 at 12:38
3

You have ~800 km east to west and ~1300 km north to south. This sounds like a perfect bounding box for the UK particularly if you include the islands to the north and south. Anything but meters (say feet, km, degrees) would be unreasonable. It is a so-so fit for Germany but could work. I think we have our linear units (m) but what system? Five digits, both negatives in the lower left, I smell a rat.

For Germany they only approve UTM and Gauss-Krueger. Neither makes sense due to your values and the other one I suspect it may in Germany is EPSG:4038 but you are missing a digit before the decimal place for this to work.

So by deduction what remains is the British National Grid EPSG:27700 and those numbers look like an excellent lower left corner and this is really the only approved UK mapping grid system.

could it be

Whoever gave you this as a first mapping task (using the UK national grid in this way) may be out to get you. Just a thought. But stick your grid on this system and although not traditional it should work.

Please feedback as I am interested to see if it works, or even post your data if allowable.

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.