Description Usage Arguments Details Value See Also
View source: R/dbconnect_functions.R
This function first checks that PostgreSQL version 11 and the PostGIS extension are installed on the local system and available from the command line. It then creates a new database containing the PostGIS extension and the required schemas and tables for data derived from LIDAR images. Note that the PostGIS extension is presently stored in the 'public' schema rather than a separate schema to allow users to connect with ArcMap versions prior to 10.7.1.
1 2 3 4 5 6 7 8 9 | db_create_postgis(
dbname,
mga.zones = c(54, 55, 56),
host = "localhost",
port = 5432,
username = "postgres",
password = NULL,
pgpath = "c:/Program Files/PostgreSQL/11/bin"
)
|
dbname |
Database name. |
mga.zones |
MGA map zones (two digit integer) for which schema should
be created. Presently, only GDA94 map zones 49-56 are supported (EPSG 28349
- 28356). The default is |
host |
Host name. Defaults to |
port |
Port number to use for database commands. Defaults to |
username |
User name for this session. Defaults to |
password |
Database password for the specified user. If |
pgpath |
The path to the |
Schemas are created for each of the MGA zones to be supported (default: zones
54, 55 and 56). Within each schema, two raster data tables are created to
store multi-band rasters of integer point counts within voxels. Each table
has two columns: rid
: an auto-incremented integer record number;
rast
raster tiles (i.e. PostGIS storage tiles rather than LAS images).
The first table, 'point_counts', holds rasters derived from individual LAS
images. The PostGIS tile size for each record corresponds to the dimensions
of the input poinit counts raster. The second table, 'point_counts_union',
holds rasters that have been mosaiced by summing the values of overlapping
edge pixels. The reason for holding duplicate data is to allow for deletion
and re-import of data (e.g. to fix problems in a particular LAS tile) that
would otherwise be difficult with just the mosaiced data.
A vector data table, 'las_metadata', is created in each schema to store metadata LAS images including source file name, capture date and times, point counts and average point density. The table also has a geometry column for the bounding rectangle of each LAS image.
Records in the 'las_metadata' and 'point_counts' tables are related by a common integer identifier (las_metadata.id = point_counts.metadata_id). No field explicitly links raster records in the point_counts_union table to those in other tables. Instead, records can be related via spatial queries.
A named list of database settings for use with other db_xxx
functions.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.