Configuring a layer with one output with multiple input projections
Peter Schmitt <[email protected]> Fri, 15 Nov 2019 12:02:18 -0700
| Newsgroups | gmane.comp.gis.mapserver.user |
|---|---|
| Message-ID | <CACkcqcW1FKnE-7n=cxi4FY-+xzakSfKkyfYkoGnxw84udSEuig@mail.gmail.com> |
--===============7803983106120314745==
Content-Type: multipart/alternative; boundary="0000000000004b7f4c0597673d04"
--0000000000004b7f4c0597673d04
Content-Type: text/plain; charset="UTF-8"
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
--0000000000004b7f4c0597673d04
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi,<div><br></div><div>Is it possible to configure one ras=
ter layer with a single output projection (epsg:4326) where input rasters a=
re in different UTM zones? I'd like to avoid reprojecting the source da=
ta if possible.</div><div><br></div><div>The rasters will be determined fro=
m 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.=C2=A0 I=
s it possible to pass this projection=C2=A0info from the database to the PR=
OJECTION block?</div><div><br></div><div>I tried an experiment which does n=
ot quite work.=C2=A0 I built a tile index with two tifs in different UTM zo=
nes:</div><div><br></div><blockquote style=3D"margin:0 0 0 40px;border:none=
;padding:0px"><div>gdaltindex -t_srs EPSG:4326 test_tindex.gpkg zone45.tif =
zone46.tif</div></blockquote><div><br></div><div>Then my layers are:</div><=
div><br></div><div>=C2=A0 LAYER<br>=C2=A0 =C2=A0 NAME =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"test_tindex"<br>=
=C2=A0 =C2=A0 TYPE =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0POLYGON<br><br>=C2=A0 =C2=A0 CONNECTIONTYPE =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0OGR<br>=C2=A0 =C2=A0 CONNECTION =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0"test_tindex.gpkg"<br>=C2=A0 =C2=A0 STATU=
S =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OFF<br>=C2=
=A0 =C2=A0 PROJECTION<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 # proj4 config for +in=
it=3Depsg:4326 =C2=A0<a href=3D"http://spatialreference.org/ref/epsg/wgs-84=
/">http://spatialreference.org/ref/epsg/wgs-84/</a><br>=C2=A0 =C2=A0 =C2=A0=
=C2=A0 "+proj=3Dlonglat +ellps=3DWGS84 +datum=3DWGS84 +no_defs"<=
br>=C2=A0 =C2=A0 END<br>=C2=A0 =C2=A0 CLASS<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
STYLE<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 WIDTH 2<br>=C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 OUTLINECOLOR 0 255 0<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 END<br>=C2=A0 =C2=A0 END<br>=C2=A0 END<br><br>=C2=A0 LAYER<br>=C2=A0=
=C2=A0 NAME =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
"test"<br>=C2=A0 =C2=A0 TYPE =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 RASTER<br>=C2=A0 =C2=A0 METADATA<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 "ows_title" =C2=A0 =C2=A0 =C2=A0 =C2=A0 "t=
est"<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 "ows_srs" =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 "EPSG:4326 EPSG:3857"<br>=C2=A0 =C2=A0 END<b=
r>=C2=A0 =C2=A0 TILEINDEX =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
"test_tindex"<br>=C2=A0 =C2=A0 STATUS =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OFF<br><br>=C2=A0 =C2=A0 PROJECTION<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 AUTO<br>=C2=A0 =C2=A0 END<br>=C2=A0 END<br></di=
v><div><br></div><div>When I make a WMS request for test in an area where t=
he images overlap, it seems MapServer stops rendering rasters after the fir=
st image in the tile index is found... so in this case since zone45.tif=C2=
=A0 was the first image in the tile index, that's what I see for a requ=
est bbox in the overlap region.=C2=A0 If I swap the order of files in the c=
ommand to build the tindex, the overlapped area only shows me zone46.tif.</=
div><div><br></div><div>$ mapserv -v</div>MapServer version 7.2.2 OUTPUT=3D=
PNG OUTPUT=3DJPEG SUPPORTS=3DPROJ SUPPORTS=3DAGG SUPPORTS=3DFREETYPE SUPPOR=
TS=3DICONV SUPPORTS=3DFRIBIDI SUPPORTS=3DWMS_SERVER SUPPORTS=3DWFS_SERVER S=
UPPORTS=3DWCS_SERVER SUPPORTS=3DFASTCGI SUPPORTS=3DGEOS SUPPORTS=3DPBF INPU=
T=3DJPEG INPUT=3DPOSTGIS INPUT=3DOGR INPUT=3DGDAL INPUT=3DSHAPEFILE<div><di=
v><br></div><div>Thanks,</div><div>Pete<br></div></div></div>
--0000000000004b7f4c0597673d04--
--===============7803983106120314745==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbWFwc2VydmVy
LXVzZXJzIG1haWxpbmcgbGlzdAptYXBzZXJ2ZXItdXNlcnNAbGlzdHMub3NnZW8ub3JnCmh0dHBz
Oi8vbGlzdHMub3NnZW8ub3JnL21haWxtYW4vbGlzdGluZm8vbWFwc2VydmVyLXVzZXJz
--===============7803983106120314745==--