How to load a raster into a PostGIS database?

How to load a raster into a PostGIS database?

In the latest verson of raster2pgsql there is logic to infer the srid from the georeference info in the tif or other raster file (this version is available as window binary now). Haven’t tried that feature yet, but if it works you can even leave out the srid and it will guess (hopefully correctly). Want to improve this post?

How to insert a raster into a table?

-t TILE_SIZE (Cut raster into tiles to be inserted one per table row. TILE_SIZE is expressed as WIDTHxHEIGHT.) If you don’t use the -t option with size dimensions, then your raster file will come in as a single record. I just noticed an error in the docs which is probably what’s confusing you.

How to calculate the size of a raster file?

-t TILE_SIZE (Cut raster into tiles to be inserted one per table row. TILE_SIZE is expressed as WIDTHxHEIGHT.) If you don’t use the -t option with size dimensions, then your raster file will come in as a single record.

How to add rasters to a QGIS query?

If you tile the rasters (speeds up queries considerably) with -t 128×128 for example, you would have one line per tile. You can add them to QGIS, using the DB manager. You right click on the layer in the DB manager and choose “Add to Canvas”.

How to correct no data layer in PostGIS?

An easy way to correct the layer as sent is simply to use gdal_translate to produce a new layer with the correct no data value. This can be done directly on the command line, or in the GUI by choosing the relevant option in Quantum GIS from the raster menu.

Is there a limit on the size of a PostGIS image?

There is no limit on the size of a single image in PostGIS raster but you will be limited by other factors, such as how much memory you have in your computer.

What is the name of the constraint on a raster column?

Generates constraints on a raster column that are used to display information in the raster_columns raster catalog. The rastschema is the name of the table schema the table resides in.

What do you need to know about addrasterconstraints?

AddRasterConstraints — Adds raster constraints to a loaded raster table for a specific column that constrains spatial ref, scaling, blocksize, alignment, bands, band type and a flag to denote if raster column is regularly blocked. The table must be loaded with data for the constraints to be inferred.

Do you have to have data to infer constraints?

The table must be loaded with data for the constraints to be inferred. Returns true if the constraint setting was accomplished and issues a notice otherwise.