Opened 6 years ago

Last modified 12 hours 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: trunk
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 Changed 6 years ago by dustymugs

Version: 1.5.Xtrunk

comment:2 Changed 5 years ago by pracine

Milestone: PostGIS Raster FuturePostGIS Future

comment:3 Changed 5 years ago by dustymugs

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 Changed 5 years ago by pracine

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 Changed 5 years ago by dustymugs

Could you provide an example of this wildcarding?

comment:6 Changed 5 years ago by pracine

*_l7_##_utm19.tif

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

comment:7 Changed 5 years ago by dustymugs

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 Changed 12 hours ago by robe

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

Note: See TracTickets for help on using tickets.