[mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter
Heiko Schröter
schroete at iup.physik.uni-bremen.de
Tue Dec 17 05:09:26 PST 2013
Hello all,
we need to rewarp epsg:4326 to polar i.e. "+proj=ortho +over +lon_0=0
+lat_0=90 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for satellite
data projection.
The problem is that not enough data are read from the source raster
image and the map is "cutout" at the poles.
gdalwarp can be passed a switch i.e. "-wo EXTRA_SOURCE=750", which gives
the correct warped image on the commandline.
To make use of it in mapserver a hint has been given in an old mailing
thread (sorry, lost the source) to adjust the following code snippet in
resample.c:
Version: mapserver-6.4.0
resample.c
<snip>
/* -------------------------------------------------------------------- */
/* Project desired extents out by 2 pixels, and then strip
to */
/* available
data. */
/*
-------------------------------------------------------------------- */
memcpy( &sOrigSrcExtent, &sSrcExtent, sizeof(sSrcExtent) );
sSrcExtent.minx = floor(sSrcExtent.minx-1.0);
sSrcExtent.maxx = ceil (sSrcExtent.maxx+1.0);
sSrcExtent.miny = floor(sSrcExtent.miny-1.0);
sSrcExtent.maxy = ceil (sSrcExtent.maxy+1.0);
<snap>
Changing the -/+1.0 to -/+1250.0, for example, warps the RASTER image
correctly.
Unfortunatly using POSTGIS layer or LINE type layer (i.e. for a grid)
the reprojection is distorted as before for the RASTER layer.
Is there an option or a place in the sources where the POSTGIS or LINE
data layers are handled so that a workaround as above for the RASTER
Layer could be used ?
I could imagine that it would be a good idea to have a parameter
"EXTRA_SOURCE" in the mapfile if need be for polar plots.
Thanks
Heiko
More information about the MapServer-users
mailing list