[mapserver-users] Configuring a layer with one output with multiple input projections

Peter Schmitt pschmitt at gmail.com
Fri Nov 15 11:02:18 PST 2019


Hi,

Is it possible to configure one raster layer with a single output
projection (epsg:4326) where input rasters are in different UTM zones? I'd
like to avoid reprojecting the source data if possible.

The rasters will be determined from a Postgis-based tile index where raster
extents are stored in epsg:4326. The database will also track what UTM zone
the source raster is in.  Is it possible to pass this projection info from
the database to the PROJECTION block?

I tried an experiment which does not quite work.  I built a tile index with
two tifs in different UTM zones:

gdaltindex -t_srs EPSG:4326 test_tindex.gpkg zone45.tif zone46.tif


Then my layers are:

  LAYER
    NAME                    "test_tindex"
    TYPE                    POLYGON

    CONNECTIONTYPE          OGR
    CONNECTION              "test_tindex.gpkg"
    STATUS                  OFF
    PROJECTION
        # proj4 config for +init=epsg:4326
http://spatialreference.org/ref/epsg/wgs-84/
        "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
    END
    CLASS
        STYLE
            WIDTH 2
            OUTLINECOLOR 0 255 0
        END
    END
  END

  LAYER
    NAME                   "test"
    TYPE                   RASTER
    METADATA
        "ows_title"         "test"
        "ows_srs"           "EPSG:4326 EPSG:3857"
    END
    TILEINDEX               "test_tindex"
    STATUS                  OFF

    PROJECTION
        AUTO
    END
  END

When I make a WMS request for test in an area where the images overlap, it
seems MapServer stops rendering rasters after the first image in the tile
index is found... so in this case since zone45.tif  was the first image in
the tile index, that's what I see for a request bbox in the overlap
region.  If I swap the order of files in the command to build the tindex,
the overlapped area only shows me zone46.tif.

$ mapserv -v
MapServer version 7.2.2 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG
SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER
SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS
SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

Thanks,
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20191115/44f78f00/attachment.htm>


More information about the MapServer-users mailing list