One way to extract the points from adf is to open this adf file in QGIS and export it to a .xyz format and then use this file to match ur point to the point in the .xyz file
other way is to convert this adf file to a tif file using QGIS and then import this file to POSTGIS database using raster2pgsql command line tool.
this is how u import raster data (tif) to postgis
Install postgresql with postgis plugin
open command line and navigate to bin folder of postgresql normaly is it located here C:\Program Files\PostgreSQL\9.3\bin
STEP 1:
raster2pgsql -F -I -M -C "PATH of tif file with extension" public.your_tablename > your_output_file.sql
STEP 2 (in the same directory)
excute the following
psql -U postgresql_database_Username -d Database_name -W -f your_output_file.sql
your_output_file.sql is the file generated in step 1.
importing raster file to postgis is one time process n den u can use this raster table generated after importing ur tif file from the database for ur future raster queries
after this is done
u can use the postgis function (ST_Value) to get the pixel value of the raster u imported
*
SELECT ST_VALUE(e.rast, ST_SetSRID(St_MakePoint(Your_Longitude, Your_Latitude ), 4326))
FROM Your_Imported_raster_table_Name e
WHERE ST_Intersects(e.rast, ST_SetSRID(St_MakePoint(Your_Longitude, Your_Latitude), 4326));
*
Hope this will help you..
i would suggest that u go for 2nd method.
For tricky (and scriptable) image manipulation, my tool of choice is ImageMagick.
It's not a particularly easy-to-learn tool, but it can do things like changing the bit depth of images, or convert from grayscale to a colour ramp, control the number of channels of the output file (RGB/greyscale/etc), or anything, really. With a bit of work, it should be able to do things like automatically trim the range of values from the GeoTIFF and map that to 8-bit channels.
Please note that ImageMagick (and GIMP, for this matter) strip the GeoTIFF information off the files. Use listgeo
and geotifcp
if you need to preserve that information.
Also, you mention
...and the resulting PNG file will not display in Leaflet
What happens if you try to load that file directly in your web browser? Also, double-check uppercase/lowercase filenames!
Best Answer
You will have to dump that tiff file (or whatever) into a
<canvas>
and read the values of whatever pixels you want. Be aware of cross-origin issues.Do read:
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Using_images
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas