| 373 | '''Storing in-db raster or registering out-db raster?''' |
| 374 | |
| 375 | One of the major PostGIS WKT Raster features is the ability to store raster data in the database or merely register them as external files residing in the filesystem. When registering a raster, only the raster metadata are stored in the database (width, height, number of band, georeference and path to the file), not the values associated with the pixels. Registering is done via the loader’s –R option. |
| 376 | |
| 377 | e.g. >gdal2wktraster –r c:/imagesets/landsat/image01.tif –t landsat -R |
| 378 | |
| 379 | '''Out-db raster''' is targeted at read-only applications. It has the following advantages: |
| 380 | |
| 381 | * '''Access Speed -''' Speeds up the reading (and transmission) of web-ready rasters (JPEG, GIF, PNG) files for web applications as there is no need to convert them from the PostGIS raster type to a web friendly format. |
| 382 | |
| 383 | * '''Seemless SQL Operators and Functions –''' All the operators and functions (except those involving write operations to the raster like ST_SetValue()) work seamlessly with out-db rasters. |
| 384 | |
| 385 | * '''Simplified Backup –''' Rasters residing in the filesystem can be backed up once forever since they are not expected to be edited. |
| 386 | |
| 387 | * '''Faster Database Loading –''' Initial table creation is faster since data do not have to be loaded/copied in the database. |
| 388 | |
| 389 | '''In-db raster''' is targeted at editing and analysis applications. It has the following advantages: |
| 390 | |
| 391 | * '''Fast Analysis –''' Analysis operations involving pixel per pixel interpretation (ST_AsPolygon(), ST_Intersections(), etc…) are faster on in-db rasters since there is no need to read and extract the actual data from a JPEG or a TIFF format. |
| 392 | |
| 393 | * '''Single storage solution –''' Provide a single vector/raster datasets storage solution. There is no need to backup the raster datasets separately from the vector datasets. |
| 394 | |
| 395 | * '''Multi-Users Edition – T'''he database handles concurrent editing on raster only for in-db rasters. |