[mapserver-users] Raster alignment problem

thomas bonfort thomas.bonfort at gmail.com
Thu Oct 9 11:10:12 EDT 2008


there's no subpixel positioning for rasters by default, so for coarse
rasters like the one you're showing, you can force that by adding a
PROCESSING "resample=nearest" to your raster layer

thomas

On Thu, Oct 9, 2008 at 16:20, Graham Carlyle
<graham.carlyle at maplecroft.com> wrote:
> Hi
>
> I'm trying to render some maps using Mapserver that contain both vector and
> raster data. However the raster data doesn't consistently align with the
> vector data at different zoom levels.
>
> I've looked at the combination of raster and vector in qgis 11.0 and it
> displays fine.
>
> When rendering with Mapserver 5.2.0 the raster image positions differently
> at different zoom levels. I've also recreated the problem using a simple
> test raster of alternating values which I created programmatically with
> libgdal.
>
> Does anyone have any suggestions as to what I might be doing wrong or how I
> might debug my problem further? I'm very doubtful that its a bug in
> mapserver as surely other people would have encountered this.
>
> I'm using the PROJECTION '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'
> in the map file for both raster and vector
>
> gdalinfo on the test raster:
> Driver: GTiff/GeoTIFF
> Files: raster/test_qs.tif
> Size is 180, 180
> Coordinate System is:
> GEOGCS["WGS 84",
>    DATUM["WGS_1984",
>        SPHEROID["WGS 84",6378137,298.2572235629972,
>            AUTHORITY["EPSG","7030"]],
>        AUTHORITY["EPSG","6326"]],
>    PRIMEM["Greenwich",0],
>    UNIT["degree",0.0174532925199433],
>    AUTHORITY["EPSG","4326"]]
> Origin = (-90.000000000000000,90.000000000000000)
> Pixel Size = (1.000000000000000,-1.000000000000000)
> Metadata:
>  AREA_OR_POINT=Area
> Image Structure Metadata:
>  INTERLEAVE=BAND
> Corner Coordinates:
> Upper Left  ( -90.0000000,  90.0000000) ( 90d 0'0.00"W, 90d 0'0.00"N)
> Lower Left  ( -90.0000000, -90.0000000) ( 90d 0'0.00"W, 90d 0'0.00"S)
> Upper Right (  90.0000000,  90.0000000) ( 90d 0'0.00"E, 90d 0'0.00"N)
> Lower Right (  90.0000000, -90.0000000) ( 90d 0'0.00"E, 90d 0'0.00"S)
> Center      (   0.0000000,   0.0000000) (  0d 0'0.01"E,  0d 0'0.01"N)
> Band 1 Block=180x45 Type=Byte, ColorInterp=Gray
>
> The shape file prj is...
> GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
>
> thanks,
> Graham
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>


More information about the mapserver-users mailing list