The Global Positioning System (GPS) is a network of about 30 satellites orbiting the Earth at an altitude of 20,000 km. The system was originally developed by the US government for military navigation but now anyone with a GPS device, be it a SatNav, mobile phone or handheld GPS unit, can receive the radio signals that the satellites broadcast.
Wherever you are on the planet, at least four GPS satellites are βvisibleβ at any time. Each one transmits information about its position and the current time at regular intervals. These signals, travelling at the speed of light, are intercepted by your GPS receiver, which calculates how far away each satellite is based on how long it took for the messages to arrive.
I use this script for my various map making efforts when I use LiDAR data in making hillshades and contours. I have automated the calling of this script from QGIS by using PyQGIS plugin that I developed.
Here is a brief PHP script I use to download LiDAR data from NYGIS website. You simply supply it a list of quads on the command line like php getlidar.php u_3592573775_1m_DEM.img u_3600073175_1m_DEM.img then execute the below script. This script requires PHP and the dbase extension. If you use PHP7, you can download a version of dbase for PHP7 .
#!/usr/bin/php -q
array_shift($argv); // remove program name
$lidarDir = "/home/andy/Documents/GIS.Data/lidar";
$tomerge = "";
$merged = "";
$conDir = "/tmp";
foreach ($argv as $quad) {
$wgetCommand = "wget -c -P $lidarDir \"ftp://ftporthos.dhses.ny.gov/lidar/nysdop/dem/$quad\"";
#echo "$wgetCommand\n";
system($wgetCommand);
$tomerge .= "$lidarDir/$quad ";
$merged = "merge".substr($quad,1,-4);
}
$mergeLidarCommand = "gdalwarp -co \"COMPRESS=LZW\" $tomerge $conDir/$merged.tif -r average -overwrite";
#echo "$mergeLidarCommand\n";
system($mergeLidarCommand);
// produce hillshade
system("gdaldem hillshade {$conDir}/{$merged}.tif {$conDir}/{$merged}hillshade.tif -z 2.0 -s 1.0 -az 315.0 -alt 45.0 -compute_edges");
// produce deeper hillshade
system("gdaldem hillshade {$conDir}/{$merged}.tif {$conDir}/{$merged}hillshade.6x.tif -z 6.0 -s 1.0 -az 315.0 -alt 45.0 -compute_edges &");
$minor = 5;
$major = 25;
$minorMeters = $minor * 0.3048;
$majorMeters = $major * 0.3048;
// produce contours
if (file_exists("{$conDir}/{$merged}{$major}ft-contour.shp")) {
unlink("{$conDir}/{$merged}{$major}ft-contour.shp");
}
if (file_exists("{$conDir}/{$merged}{$minor}ft-contour.shp")) {
unlink("{$conDir}/{$merged}{$minor}ft-contour.shp");
}
system("gdal_contour -a elev -i {$majorMeters} {$conDir}/{$merged}.tif {$conDir}/{$merged}{$major}ft-contour.shp");
system("gdal_contour -a elev -i {$minorMeters} {$conDir}/{$merged}.tif {$conDir}/{$merged}{$minor}ft-contour.shp");
// convert contour elevation to feet from meters
foreach (array("{$conDir}/{$merged}{$minor}ft-contour.dbf", "{$conDir}/{$merged}{$major}ft-contour.dbf") as $file) {
$db = dbase_open("$file", 2);
if ($db) {
$record_numbers = dbase_numrecords($db);
for ($i = 1; $i <= $record_numbers; $i++) {
// gets the old row
$row = dbase_get_record($db, $i);
// Update the date field with feet instead of meters
$row[1] = ceil($row[1] * 3.280839);
// remove the 'deleted' entry
unset($row['deleted']);
// replace record and save
dbase_replace_record($db, $row, $i);
}
}
dbase_close($db);
}
"Local folklore has it that the tree grew when George Washington planted his walking stick while he and the Continental Army were encamped in nearby Newburgh during the final years of the Revolutionary War but core samples of the tree have dated its growth to 1699, well before American independence. Franklin Roosevelt often came to visit the tree."
The tree was cut down in 2015 when it was in terminal decline and ready to collapse on the road and surrounding houses. This summer though, the energy in the roots have allowed it to spring new branches and come back alive. While not uncommon for a large cut tree to do this, it's still a wonderful story of rebirth.
I often need zero-centered color ramps in QGIS. Here is how to quickly make them:
Open up the Layer Styling Dialog.
Select the column you want to use and number of classes.
Select the color ramp you want to use — typically a two or three color ramp — such as green-white-red or blue-white-red.
Click classify.
Note the highest or lowest value in the classes (such as -152 or 80).
You will want to use the largest absolute value — in this case -152.
Put in the column box, rand(-152, 152) and click classify. If you a using a simple shapefile without many objects, you may have to expand the range slightly, e.g. rand(-200,200),Β to ensure a full ramp is generated.
Select the column you want to use. Do not click classify.
You will now have a nice, zero centered, balanced color ramp for displaying your data.