<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Puneet<br><br>I suggest you use GMT - the best open source cartographic &amp; grid analysis tool available!&nbsp; <a href="http://gmt.soest.hawaii.edu">http://gmt.soest.hawaii.edu</a><br><br>you may need your SRTM surface as a GMT netCDF grid, which GDAL supports nicely, or you may be able to describe your SRTM grid for GMT to use natively - I'm not sure<br><br>the project command will generate your line, with sample points along it as straight or great circle lines between end points<br><br>grdtrack will turn your XY line coordinates into xyz values, with the Z values derived from your SRTM grid<br><br>psxy will gernerate a nicely annotated graphic (postscript) showing your profile<br>psxyz can (alternatively) render your profile in 3d space (overlaid on a 3D perspective view of the surface if required)<br><br>ps2raster will convert to a raster image such
 as png. <br><br>This can easily be wrapped up in a cgi if required.<br><br>Cheers,<br><br>&nbsp;&nbsp;&nbsp; Brent Wood<br><br>--- On <b>Fri, 4/27/12, Puneet Kishor <i>&lt;punk.kish@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Puneet Kishor &lt;punk.kish@gmail.com&gt;<br>Subject: Re: [mapserver-users] elevation profile<br>To: "Stephen Woodbridge" &lt;woodbri@swoodbridge.com&gt;<br>Cc: mapserver-users@lists.osgeo.org<br>Date: Friday, April 27, 2012, 2:49 PM<br><br><div class="plainMail"><br>On Apr 26, 2012, at 7:20 PM, Stephen Woodbridge wrote:<br><br>&gt; On 4/26/2012 7:35 PM, Puneet Kishor wrote:<br>&gt;&gt; Any suggestions on how something like this could be implemented using MapServer?<br>&gt;&gt; <br>&gt;&gt; <a href="http://viewer.nationalmap.gov/example/elevation_profile.html"
 target="_blank">http://viewer.nationalmap.gov/example/elevation_profile.html</a><br>&gt;&gt; <br>&gt;&gt; <br>&gt;&gt; My front-end is OpenLayers, and the backend data are from SRTM. I'd like to click on the map and create a line, and get back the elevation numbers for that line. I only want the elevation numbers as I can optionally construct the profile via a variety of ways.<br>&gt;&gt; <br>&gt;&gt; I am assuming I could send a line WKT, but how would I query for the values using MapServer?<br>&gt;&gt; <br>&gt;&gt; Fwiw, <a href="http://dev.openlayers.org/sandbox/camptocamp/canvas/openlayers/examples/elevationCanvas.html" target="_blank">http://dev.openlayers.org/sandbox/camptocamp/canvas/openlayers/examples/elevationCanvas.html</a> seems to use a canvas implementation that doesn't seem to be available in my standard-issue OL 2.11. Calling `this.layer.getPixelDataForViewPortPx` croaks with "not a function" message. In any case, I don't really want the
 RGB values under the mouse. I want the actual height values.<br>&gt;&gt; <br>&gt;&gt; Thanks in advance for any suggestions,<br>&gt; <br>&gt; Hi Puneet,<br>&gt; <br>&gt; I have done this in the past and there are a bunch of moving parts. Here is what I did.<br>&gt; <br>&gt; 1. got a copy of NED2 data for the US.<br>&gt; 2. create a gdal .vrt file to pull all the files into a single virtual file<br>&gt; 3. wrote a simple C fcgi program to take an x,y and get the elevation from the the NED2 data.<br>&gt; <br>&gt; <a href="http://imaptools.com:8080/cgi-bin/getElevation.fcgi?lat=32.662864999999996&amp;lon=-86.880096999999992" target="_blank">http://imaptools.com:8080/cgi-bin/getElevation.fcgi?lat=32.662864999999996&amp;lon=-86.880096999999992</a><br>&gt; <br>&gt; 4. I used pgRouting to compute a route and then took the route geometry and added sample point along the edges where needed, and hit the fcgi service to convert the points to elevations and then
 plotted the elevations against the their length along the line that the x,y represented.<br>&gt; <br>&gt; I also think I may have wrote an app where you could pass the route polyline to it an it would generate an image of the elevation plot.<br>&gt; <br>&gt; 5. Then wired it into the web page as an ajax call of as a image url that gets updated.<br>&gt; <br><br><br><br>Thanks for the details, Steve. All this is way more complicated that I was envisioning. And, PostGIS 2 is out of the question, for now, at least.<br><br>Could you send me that gdal .vrt file? I'd like to look at it. Perhaps that will give me some other ideas on how to approach this.<br><br>Many thanks,<br><br><br>--<br>Puneet Kishor<br><br>_______________________________________________<br>mapserver-users mailing list<br><a ymailto="mailto:mapserver-users@lists.osgeo.org" href="/mc/compose?to=mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br><a
 href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div></blockquote></td></tr></table>