SRTM Elevation Data in PHP

SRTM Logo

[October 2024 update] The code shown here uses the old SRTM 3 arc second (90m) GeoTIFF data files. These now appear to be no longer available, and it seems that even the 1 arc second (30m) files very hard to come by these days. So this code won't be updated as my interest is mainly in UK elevations which are now covered by my OS Terrain 50 page.


This page is a demo of my PHP code to read elevation data from the freely-available 5°x5° SRTM v4.1 GeoTIFF data files which provide worldwide elevations at roughly 90m intervals. The code (along with demo usage) is available on Github at https://github.com/bobosola/PHP-SRTM.

So why bother rolling your own code? Elevation data is already available from a number of online sources, but most restrict the number of data requests you can make. So to get the flexibility and speed to do whatever you like with the data you will need to read the raw data files yourself. I expect the main use for the code will be to generate elevation data or profile charts for hiking or cycling.

Click or tap any two points on the map to generate an elevation profile image under the map. Try more clicks pairs on different locations to generate new profiles. The PHP code can return thousands of elevations in milliseconds. The graph software (JpGraph) may be a little slower.

 Latitude   Longitude  Elevation (m)
Location 1
Location 2
OS maps logo

chart