From 36d489eb8ca3da0dbe5080b75ce914c5e88bb9cc Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 7 Aug 2024 15:31:27 +0100 Subject: [PATCH] Tweak blog content --- content/blog/batch-import-postgis-rasters.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/content/blog/batch-import-postgis-rasters.md b/content/blog/batch-import-postgis-rasters.md index 8d68881..6e8423b 100644 --- a/content/blog/batch-import-postgis-rasters.md +++ b/content/blog/batch-import-postgis-rasters.md @@ -54,15 +54,15 @@ raster2pgsql -d -M -C -I -s 4326 -t 128x128 -F *.tif dem.srtm | psql --dbname=os {{}} Here's a breakdown of the above command: -- -d This drops an existing table if it already exists. It's useful to include this in case we need to run the command again. -- -M This runs `VACUUM ANALYZE` on the table after the raster tiles have been inserted into the database. This optimizes the table by reclaiming storage space and then collecting table statistics. -- -C This applies raster constraints to the table by using the `AddRasterConstraints` function in PostGIS. This adds several types of constraints to the table which ensures data integrity and enforces rules for consistency. -- -I Creates a spatial index (GiST) on the table. -- -s Assign SRID (Spatial Reference System Identifier) to the raster. -- -t Tile size. This splits the raster into tiles of the specified size. Each tile is a row in the final table. -- -F Creates a filename column. As the raster is split into many smaller tiles, this is useful to help us identify the original file the tile belonged to. -- *.tif Selects all of the .tif files in the directory. -- dem.srtm Defines the schema and name of the table. Remember to create the `dem` schema in the database before running the command. +- `-d` This drops an existing table if it already exists. It's useful to include this in case we need to run the command again. +- `-M` This runs `VACUUM ANALYZE` on the table after the raster tiles have been inserted into the database. This optimizes the table by reclaiming storage space and then collecting table statistics. +- `-C` This applies raster constraints to the table by using the `AddRasterConstraints` function in PostGIS. This adds several types of constraints to the table which ensures data integrity and enforces rules for consistency. +- `-I` Creates a spatial index (GiST) on the table. +- `-s` Assign SRID (Spatial Reference System Identifier) to the raster. +- `-t` Tile size. This splits the raster into tiles of the specified size. Each tile is a row in the final table. +- `-F` Creates a filename column. As the raster is split into many smaller tiles, this is useful to help us identify the original file the tile belonged to. +- ` *.tif` Selects all of the .tif files in the directory. +- `dem.srtm` Defines the schema and name of the table. Remember to create the `dem` schema in the database before running the command. The `raster2pgsql` command will output a sql query which we can then pipe into the `psql` command.