Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

how can I create a polygon, containing the actual outlines (aka footprint) of a raster file with postgis?

I just need the outlines of the data containing parts of the raster.

ST_PixelAsPolygon creates a complex polygons - but I just need the footprint.

There is a similar question here How do I create a shapefile showing footprints of Rasters?, but the answers do not cover postgis.

D3

share|improve this question

1 Answer 1

Use the ST_Envelope function:

SELECT ST_Envelope(rast)
  FROM raster_table;

This will return a rectangular bounding box for your raster(s). PostGIS describes what this function returns as:

Returns the polygon representation of the extent of the raster.

share|improve this answer
    
This gives me just a rectangular envelope (bounding box). I'm looking for a polygon which describes the data area of the raster. With satellite pictures the resulting polygon will be a trapezoidal shape in most cases. –  dodiddone Sep 11 '13 at 7:52
1  
The shape can be projection-dependent. Why don't you try ST_PixelAsPolygon followed by ST_ConvexHull? –  Arthur Sep 11 '13 at 17:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.