I want to a store GeoTIFF file pixel by pixel in the database. I need to store pixel values along with the lat/lon of that pixel on the GeoTIFF image. Is it possible to do that?
Tell me more
×
Geographic Information Systems Stack Exchange is a question and answer site for
cartographers, geographers and GIS professionals. It's 100% free, no registration required.
|
|
This may be a bit archaic: Convert the pixels to points, add lat and long fields, and populate with lat and long values. |
|||
|
|
|
The world file (.tfw) that accompanies a GeoTIFF contains:
|
|||||||
|
|
In a generic sense, use the affine transform parameters, which should be available with any raster file format. With GDAL, this is available with GetGeoTransform(), or PostGIS' ST_GeoReference() function. After finding these six parameters, one only needs to determine which ones they are, then a function can be made to transform in linear space. E.g., with Python:
For example, if there is a pixel at x=10, y=22, then it's real-world coordinates are:
Something similar can be cooked up for PostGIS with ST_Affine(). |
|||
|
|