Created
April 14, 2012 14:44
-
-
Save stoermerjp/2384875 to your computer and use it in GitHub Desktop.
DroneMapper.com: USGS Elevation Web Service PHP Integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Uses CURL to return the elevation of a point via USGS Elevation Web Service. | |
*/ | |
$lat = 41.9816730; | |
$lon = -106.0949550; | |
function checkEle($lat, $lon) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "http://gisdata.usgs.gov/xmlwebservices2/elevation_service.asmx/getElevation?X_Value=" . $lon . "&Y_Value=" . $lat . "&Elevation_Units=METERS&Source_Layer=-1&Elevation_Only=true"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
$retValue = curl_exec($ch); | |
curl_close($ch); | |
return $retValue; | |
} | |
print checkEle($lat, $lon); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment