[GIS] How to extract elevation data from binary .ADF elevation format at given coordinates

arcgis-10.0arcgis-desktopcoordinatesdemesri-grid-format

I have a high resolution digital elevation model available. The ground resolution is 1 meter and the file format is adf which is some binary ESRI grid raster format.

I have a script the outputs x/y- or lat/lon-coordinates and as a next step I have to extract the elevation of the given coordinate from the binary adf file. But that's a huge one. The file is like 1.5 GB in size and I haven't found a way yet how to access the data via a headless command line or script.

How to access adf files via script? Is there any programmes available or are there any known libraries I could use?

Or should I rather convert the adf to some ASCII text files? But that will cost a lot of disk space and performance.

I've been reading about elevation databases. How to create one from my elevation model? Is it worth a try regarding performance?

Update: To break this down, in short – How to access adf files or elevation data most efficient using a script with coordinates as parameters?

Best Answer

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.

Related Question