Re: Configuring a layer with one output with multiple input projections
Peter Schmitt <[email protected]> Fri, 15 Nov 2019 16:54:30 -0700
| Newsgroups | gmane.comp.gis.mapserver.user |
|---|---|
| Message-ID | <CACkcqcV38zh0H5F4RX3FuW_uk_nb989Pq1ALpa_2pRdQW_stwg@mail.gmail.com> |
--===============7613177624971926063== Content-Type: multipart/alternative; boundary="0000000000004dd41405976b520f" --0000000000004dd41405976b520f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Jukka! I was looking at https://www.mapserver.org/mapfile/projection.html, which doesn't mention TILESRS. I just submitted a PR to address that: https://github.com/mapserver/docs/pull/293 Cheers, Pete On Fri, Nov 15, 2019 at 12:19 PM Rahkonen Jukka (MML) < [email protected]> wrote: > Hi, > > > > Please read > https://mapserver.org/optimization/tileindex.html#tileindex-mixed-srs and > https://mapserver.org/development/rfc/ms-rfc-100.html? > > > > -Jukka Rahkonen- > > *L=C3=A4hett=C3=A4j=C3=A4:* mapserver-users <mapserver-users-bounces@list= s.osgeo.org> *Puolesta > *Peter Schmitt > *L=C3=A4hetetty:* perjantai 15. marraskuuta 2019 21.02 > *Vastaanottaja:* [email protected] > *Aihe:* [mapserver-users] Configuring a layer with one output with > multiple input projections > > > > 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=3Depsg:4326 > http://spatialreference.org/ref/epsg/wgs-84/ > "+proj=3Dlonglat +ellps=3DWGS84 +datum=3DWGS84 +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, i= t > 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 i= n > 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=3DPNG OUTPUT=3DJPEG SUPPORTS=3DPROJ SUPPOR= TS=3DAGG > SUPPORTS=3DFREETYPE SUPPORTS=3DICONV SUPPORTS=3DFRIBIDI SUPPORTS=3DWMS_SE= RVER > SUPPORTS=3DWFS_SERVER SUPPORTS=3DWCS_SERVER SUPPORTS=3DFASTCGI SUPPORTS= =3DGEOS > SUPPORTS=3DPBF INPUT=3DJPEG INPUT=3DPOSTGIS INPUT=3DOGR INPUT=3DGDAL INPU= T=3DSHAPEFILE > > > > Thanks, > > Pete > --=20 Pete --0000000000004dd41405976b520f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Thanks Jukka! I was looking at=C2=A0<a href=3D"https://www= .mapserver.org/mapfile/projection.html">https://www.mapserver.org/mapfile/p= rojection.html</a>, which doesn't mention TILESRS. I just submitted a P= R to address that:<div><a href=3D"https://github.com/mapserver/docs/pull/29= 3">https://github.com/mapserver/docs/pull/293</a><br></div><div><br></div><= div>Cheers,</div><div>Pete</div></div><br><div class=3D"gmail_quote"><div d= ir=3D"ltr" class=3D"gmail_attr">On Fri, Nov 15, 2019 at 12:19 PM Rahkonen J= ukka (MML) <<a href=3D"mailto:[email protected]">jukka= [email protected]</a>> wrote:<br></div><blockquote class=3D= "gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2= 04,204,204);padding-left:1ex"> <div lang=3D"FI"> <div class=3D"gmail-m_-5201482515972775930WordSection1"> <p class=3D"MsoNormal"><span>Hi,<u></u><u></u></span></p> <p class=3D"MsoNormal"><span><u></u>=C2=A0<u></u></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US">Please read =C2=A0<a href=3D"ht= tps://mapserver.org/optimization/tileindex.html#tileindex-mixed-srs" target= =3D"_blank">https://mapserver.org/optimization/tileindex.html#tileindex-mix= ed-srs</a> and <a href=3D"https://mapserver.org/development/rfc/ms-rfc-100.html" target=3D= "_blank">https://mapserver.org/development/rfc/ms-rfc-100.html</a>?<u></u><= u></u></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US"><u></u>=C2=A0<u></u></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US">-Jukka Rahkonen-<u></u><u></u><= /span></p> <p class=3D"MsoNormal"><b><span lang=3D"EN-US">L=C3=A4hett=C3=A4j=C3=A4:</s= pan></b><span lang=3D"EN-US"> mapserver-users <<a href=3D"mailto:mapserv= [email protected]" target=3D"_blank">mapserver-users-bounces= @lists.osgeo.org</a>> <b>Puolesta </b>Peter Schmitt<br> <b>L=C3=A4hetetty:</b> perjantai 15. marraskuuta 2019 21.02<br> <b>Vastaanottaja:</b> <a href=3D"mailto:[email protected]" ta= rget=3D"_blank">[email protected]</a><br> <b>Aihe:</b> [mapserver-users] Configuring a layer with one output with mul= tiple input projections<u></u><u></u></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US"><u></u>=C2=A0<u></u></span></p> <div> <p class=3D"MsoNormal">Hi,<u></u><u></u></p> <div> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> </div> <div> <p class=3D"MsoNormal">Is it possible to configure one raster layer with a = single output projection (epsg:4326) where input rasters are in different U= TM zones? I'd like to avoid reprojecting the source data if possible.<u= ></u><u></u></p> </div> <div> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> </div> <div> <p class=3D"MsoNormal">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.=C2=A0 Is it possible to p= ass this projection=C2=A0info from the database to the PROJECTION block?<u></u><u></u></p> </div> <div> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> </div> <div> <p class=3D"MsoNormal">I tried an experiment which does not quite work.=C2= =A0 I built a tile index with two tifs in different UTM zones:<u></u><u></u= ></p> </div> <div> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> </div> <blockquote style=3D"margin-left:30pt;margin-right:0cm"> <div> <p class=3D"MsoNormal">gdaltindex -t_srs EPSG:4326 test_tindex.gpkg zone45.= tif zone46.tif<u></u><u></u></p> </div> </blockquote> <div> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> </div> <div> <p class=3D"MsoNormal">Then my layers are:<u></u><u></u></p> </div> <div> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> </div> <div> <p class=3D"MsoNormal">=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&q= uot;test_tindex.gpkg"<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> =C2=A0 =C2=A0 PROJECTION<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 # proj4 config for +init=3Depsg:4326 =C2=A0<a h= ref=3D"http://spatialreference.org/ref/epsg/wgs-84/" target=3D"_blank">http= ://spatialreference.org/ref/epsg/wgs-84/</a><br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "+proj=3Dlonglat +ellps=3DWGS84 +datum=3DW= GS84 +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 "test"<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<br> =C2=A0 =C2=A0 TILEINDEX =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &q= uot;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<u></u><u></u></p> </div> <div> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> </div> <div> <p class=3D"MsoNormal">When I make a WMS request for test in an area where = the images overlap, it seems MapServer stops rendering rasters after the fi= rst 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 request bbox in the overlap region.=C2=A0 If I= swap the order of files in the command to build the tindex, the overlapped= area only shows me zone46.tif.<u></u><u></u></p> </div> <div> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> </div> <div> <p class=3D"MsoNormal">$ mapserv -v<u></u><u></u></p> </div> <p class=3D"MsoNormal">MapServer version 7.2.2 OUTPUT=3DPNG OUTPUT=3DJPEG S= UPPORTS=3DPROJ SUPPORTS=3DAGG SUPPORTS=3DFREETYPE SUPPORTS=3DICONV SUPPORTS= =3DFRIBIDI SUPPORTS=3DWMS_SERVER SUPPORTS=3DWFS_SERVER SUPPORTS=3DWCS_SERVE= R SUPPORTS=3DFASTCGI SUPPORTS=3DGEOS SUPPORTS=3DPBF INPUT=3DJPEG INPUT=3DPOSTGIS INPUT=3DOGR INPUT=3DGDAL INPUT=3DSHAPEFILE<u></u><u></u></= p> <div> <div> <p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p> </div> <div> <p class=3D"MsoNormal">Thanks,<u></u><u></u></p> </div> <div> <p class=3D"MsoNormal">Pete<u></u><u></u></p> </div> </div> </div> </div> </div> </blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"= class=3D"gmail_signature">Pete</div> --0000000000004dd41405976b520f-- --===============7613177624971926063== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbWFwc2VydmVy LXVzZXJzIG1haWxpbmcgbGlzdAptYXBzZXJ2ZXItdXNlcnNAbGlzdHMub3NnZW8ub3JnCmh0dHBz Oi8vbGlzdHMub3NnZW8ub3JnL21haWxtYW4vbGlzdGluZm8vbWFwc2VydmVyLXVzZXJz --===============7613177624971926063==--