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.

I have a bunch of geotiffs stored in a PostGIS DB that i am mounting on my OpenLayers map.

enter image description here

They all have the geoTransform information in them. I just want to know how i can mount them on my OpenLayers map with the correct affine transformation without running a gdalwarp on all the images. Though i wouldn't mind calling gdalwarp on the fly if possible. I just don't want to store those warped images in the DB (they take up 8x more space).

Can OpenLayers rotate my image based on the GeoTransform info in the GeoTiff? If so how?:

enter image description here

This is the code i'm using to overlay my tiff:

var bounds = MyOrg.UI.Map.Results.Layer.features[array_index].geometry.bounds;

var options = {
    numZoomLevels: 15,
    isBaseLayer: false,
    resolutions: MyOrg.UI.Map.getMap().layers[0].resolutions,
    maxResolution: "auto",
    projection: MyOrg.UI.Map.Projections.Mercator,
    strategies: [new OpenLayers.Strategy.Fixed()]
};

var graphic = new OpenLayers.Layer.Image(
    'test',
    'GranuleImage.ashx?granuleID=' + MyOrg.UI.Map.Results.Data.arrGranules[array_index].id + '&thumb=0',
    bounds,
    bounds.getSize(),
    options
);

MyOrg.UI.Map.getMap().addLayer(graphic);
share|improve this question

1 Answer 1

up vote 4 down vote accepted

No. Openlayers cannot warp your images. OpenLayers reprojection/transform support is for vectors only.

For a raster solution, you will need to do the processing on the server side. You will have to determine if performance is enough of an issue that you decide to pre-process the imagery. If you want to do it on the fly, you could use MapServer or another WMS server. If you pre-process them, you could use MapServer or another WMS server, or you could build up a tile cache.

Raster processing is fairly expensive. You essentially have to determine whether 'disk is cheap' or 'time is cheap'.

share|improve this answer
    
+1: Are you saying i can point geoserver to my table of rasters and then be able to overlay them properly? Will WMS do the transform for me? –  CaptDragon Mar 14 '11 at 19:21
    
nevermind, answered my own question> NO. WMS will not do it directly from PostGIS i need the physical file. –  CaptDragon Mar 14 '11 at 19:59
1  
@capdragon: according to this page, MapServer can serve up rasters (WKT Raster) from a PostGIS db. YMMV, I haven't tested it. –  DavidF Mar 15 '11 at 13:28
    
+1 Thanks, i'll look into it! –  CaptDragon Mar 15 '11 at 13:29
    
Could you please paste the link you're referring to in and edit or comment box. Thanks. –  CaptDragon Mar 15 '11 at 13:32

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.