[gdal-dev] Using VRT images with derived bands (pixel function) with MapServer

Yves Jacolin yjacolin at free.fr
Thu Feb 16 03:31:11 EST 2012


Armin,

I am using such application stack: netcdf > vrt and pixel functions > GDAL > 
MapServer

We have a tiled layer inside PostGIS and we juste configure the layer like all 
other tiled datasource:

LAYER
 STATUS ON
 NAME "layer_idx"
 TYPE POLYGON
 CONNECTION "dbname=mydb host=localhost user=myUser password=mypassword"
 CONNECTIONTYPE postgis
 DATA "the_geom FROM myLayer USING srid=4326"
 PROJECTION
  "init=epsg:4326"
 END
 METADATA
   "wms_srs"   "EPSG:4326"
   "wms_timeextent" "2010-12-20/2010-12-26"
   "wms_timeitem" "datetime" #column in postgis table of type timestamp
   "wms_timedefault" "2010-12-24T00:00:00Z"
   "wms_enable_request" "*"
 END
END

If you want to use the vrt file directly it is also possible as easily as:
DATA "vrt/myLayer.vrt"

About register the plugin, in Apache config you have to use SetEnv this way:
   SetEnv GDAL_DRIVER_PATH  directory/mapserver/misc
   SetEnv MS_MAPFILE directory/mapserver/mymapfile.map
   SetEnv MS_MAPFILE_PATTERN "^directory/mapserver/mymapfile.map"

Hth,

Y.

Le Mercredi 15 Février 2012 19:52:21 Armin Burger a écrit :
> Dear all
> 
> I would be interested in using VRT images with "derived bands" as
> described on the VRT image documentation page. This requires the
> definition of a pixel function and the registration of this function in
> the used application via "GDALAddDerivedBandPixelFunc".
> 
> The provided sample function is already towards what I'm looking for. I
> would just need to adapt it accordingly (calculating band 1 as
> combination of source band 1 and 3).
> 
> Since my main interest is to use such image definition in the context of
> Mapserver, my question is if there could be a way to use this also from
> Mapserver as application? If yes, where would I need to register the
> function and how would I best make the function available to Mapserver
> (maybe via an .o file that is created when compiling)? Maybe somewhere
> inside mapgdal.c ?
> 
> Would such a pixel function be used also in case when not the full
> resolution image (i.e. TIFF file referenced in the VRT file) is read but
> one of the overviews from the .ovr file associated to the Tiff file?
> 
> Thanks in advance for any hints
> 
> Armin
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
-- 
Yves Jacolin

http://yjacolin.gloobe.org


More information about the gdal-dev mailing list