Description Usage Arguments Details Value Examples
First, each LAS tile is read from disk and the function checks that it is
located in one of the map zones supported by the database (each zone's data
is stored in a separate schema). Next, point heights are normalized, any
overlap between flight lines is removed, and the counts of vegetation, ground
and water points are rasterized as vertical layers defined in
CERMBlidar::CERMBstrata
. The point count raster layers are then
imported into the database along with meta-data for tile extent, point
density, etc. Optionally, building points can also be extracted from the LAS
tile and imported.
1 2 3 4 5 6 7 8 9 10 11 12 |
dbsettings |
A named list of database connection settings as returned
by |
las.paths |
The paths and filenames of the LAS source files. This can
be an uncompressed ( |
dem.paths |
The paths and file names of DEM (digital elevation model)
rasters corresponding to the LAS source files. If a vector of paths is
provided it must be the same length as |
mapnames |
Specifies the mapsheet names to store for the imported
LAS tiles. If |
default.epsgs |
Integer EPSG codes for each of the imported LAS tiles.
If |
purpose |
Either |
check.overlap |
If |
buildings |
If |
union.rasters |
See Details for why you probably do not want to
use this argument. If |
union.batch |
If |
Point counts for vertical layers of vegetation are stored in the database
raster table point_counts
, with a raster record for each imported LAS
tile. Typically there will be a lower density of points in edge cells of a
raster than in interior cells due to the relative position of LAS tile
boundaries and raster boundaries. This can be resolved by edge-merging
adjacent rasters, summing overlapping cells (e.g. using the PostGIS ST_UNION
operation with the 'SUM' option). The original intention was to do this by
default as part of the import process, and store an edge-merged copy of the
raster point counts data in a second database table
point_counts_union
. However, we found that the time taken by the
merging operation became excessive as the number of rasters in the database
grew, although we are yet to understand exactly why this is the case. Merging
can be enabled by setting the union.rasters
argument to TRUE
(default is FALSE
) but this is not recommended. Note that when
exporting point count data with function db_export_stratum_counts
, the
rasters for adjacent LAS tiles will be edge-merged.
A vector of integer values giving the result for each input LAS file, where 1 means successfully imported; 0 means skipped because previously imported; -1 means not imported due to error (usually a problem with resolving flight line overlap).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# Establish connection
Sys.setenv(PGPASSWORD = "mypassword")
DB <- db_connect_postgis("cermb_lidar")
# Import a set of LAS files. Point heights will be set relative
# to ground level via Delaunay triangulation.
LAS.FILES <- dir("c:/somewhere/LAS", pattern = "zip$", full.names = TRUE)
imported <- db_import_las(DB, LAS.FILES)
cat(sum(imported == 1), "files were imported\n",
sum(imported == 0), "files already present were skipped\n",
sum(imported == -1), "files failed to be imported\n")
# Import a set of LAS files with corresponding DEM (raster elevation)
# files to be used to normalize point heights.
LAS.FILES <- dir("c:/somewhere/LAS", pattern = "zip$", full.names = TRUE)
DEM.FILES <- dir("c:/somewhere/DEM", pattern = "zip$", full.names = TRUE)
imported <- db_import_las(DB, LAS.FILES, DEM.FILES)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.