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.
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?