Opened 13 years ago

Last modified 7 years ago

#1379 new enhancement

[raster] raster2pgsql: load a raster as a band(s) of an existing raster

Reported by: chdemars Owned by: pracine
Priority: medium Milestone: PostGIS Fund Me
Component: raster Version: master
Keywords: Cc:

Description

It would be nice to be able to load a raster as a band of an existing raster table. For instance, landsat data comes with each band a separate single band raster. I am currently loading each band as a separate table, merging them into a multi-band raster using AddBand, then removing the individual band tables. Seems like a kludgy way to do a common task.

Change History (8)

comment:1 by dustymugs, 13 years ago

Version: 1.5.Xtrunk

comment:2 by pracine, 13 years ago

Milestone: PostGIS Raster FuturePostGIS Future

comment:3 by dustymugs, 12 years ago

raster2pgsql does not have any connection to the database to verify that there is a raster (and the raster's attributes) to append to. It would need access to the database to even check which raster the new band should be added to (especially for tiles).

The lack of database connection is by design (specifically following the design and behavior of shp2pgsql).

comment:4 by pracine, 12 years ago

What would be possible however is to have an extra option to "interpret 1, 2, 3, or 4 '#' characters in wildcard based input filenames as a search for band numbers and load corresponding bands as a one multiple band raster"…

Would not be possible to append to existing rasters, but would be able to load landsat easily.

comment:5 by dustymugs, 12 years ago

Could you provide an example of this wildcarding?

comment:6 by pracine, 12 years ago

*_l7_##_utm19.tif

## would be 01, 02, 03, 04, 05, 06…

comment:7 by dustymugs, 12 years ago

That probably won't work. The filenames (and usage of wildcards) are depending upon the environment in which raster2pgsql is called. As for pulling specific bands, -b already exists for that purpose.

comment:8 by robe, 7 years ago

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

Note: See TracTickets for help on using tickets.