Re: Doubling of labels on high resolution maps
[email protected] Thu, 17 Oct 2019 14:19:15 +0000
| Newsgroups | gmane.comp.gis.mapserver.user |
|---|---|
| Message-ID | <[email protected]> |
--===============5690388377904494308== Content-Type: multipart/alternative; boundary="--=_RainLoop_774_571985851.1571321955" ----=_RainLoop_774_571985851.1571321955 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi,=0A=0AThe best way is most likely to set up a WMTS service with mapcac= he.=0AIt handles meta tiling in a more proper way.=0A=0AThere are good ex= amples in the mapproxy documentation how to do labels in mapserver. =0Aht= tps://mapproxy.org/docs/nightly/labeling.html (https://mapproxy.org/docs/= nightly/labeling.html)=0AMapproxy is anotther good alternative instead of= mapcache.=0A=0ABe sure to specify "labelcache_map_edge_buffer" "-10" in = the mapfile MAP-WEB data section.=0A=0AYou can still run WMS requests fro= m QGIS towards mapcache if You have enabled that in the mapcache config.= =0A=0A/Lars S.=0A17 oktober 2019 kl. 16:04, "Jan Hartmann" <j.l.h.hartman= [email protected] (mailto:[email protected]?to=3D%22Jan%20Hartmann%22%20<j.l.h= [email protected]>)> skrev:=0ANo, neither maxsize nor partials works. I gu= ess that's just the way QGIS requests large WMS-images.=0A=0AThere is a "= tile_metatile_level" configuration directive that should solve this probl= em:=0A=0Ahttps://mapserver.org/output/tile_mode.html (https://mapserver.o= rg/output/tile_mode.html)=0A=0Abut it does not seem to work for WMS layer= s.=0A=0ASo I used the underlying PostGIS layer in QGIS, and that works OK= , of course. Not sure if this is a bug in MapServer, though.=0A=0AThanks = for your help,=0A=0AJan=0AOn 10/16/2019 5:55 PM, Rahkonen Jukka (MML) wro= te: =0A Hi, =0A=0A Print composer is probably making tiled requests from = WMS. That is compulsory for any bigger maps because the default maxsize o= n the Mapserver side is 2048x2048 pixels https://mapserver.org/uk/mapfile= /map.html (https://mapserver.org/uk/mapfile/map.html). It is easy to incr= ease the maxsize but I do not know if print composer as a client can be a= ware of that. =0A=0A Partials FALSE may help, but based on the screenshot= it is possible that print composer is making requests with some overlap.= =0A=0A -Jukka Rahkonen- =0A=0A L=C3=A4hett=C3=A4j=C3=A4: mapserver-user= s <[email protected]> (mailto:mapserver-users-bounc= [email protected]) Puolesta Travis Kirstine=0AL=C3=A4hetetty: keskiviikk= o 16. lokakuuta 2019 18.24=0AVastaanottaja: Jan Hartmann <j.l.h.hartmann@= uva.nl> (mailto:[email protected])=0AKopio: MapServer-users <mapserve= [email protected]> (mailto:[email protected])=0AAihe:= Re: [mapserver-users] Doubling of labels on high resolution maps =0A The= re are a few options you could add to your label but I would start with = =0A MINDISTANCE 200 =0A PARTIALS FALSE =0A See =0A https://mapserver.org/= mapfile/label.html (https://mapserver.org/mapfile/label.html) =0A On Wed,= 16 Oct 2019 at 10:37, Jan Hartmann <[email protected] (mailto:j.l.h.= [email protected])> wrote: =0A Hi,=0A=0AI'm trying to generate high resolu= tion print maps with QGIS, based on a MapServer WMS layer. When displayed= in the regular QGIS application with 72dpi, all looks fine. When using t= he Print Composer based on the same Mapfile, but with 300dpi, some labels= are duplicated (not all). Some duplicates are clipped. The two versions = can be seen here:=0A=0Ahttps://maps.hisgis.nl/marken_072dpi.png (https://= maps.hisgis.nl/marken_072dpi.png)=0Ahttps://maps.hisgis.nl/marken_300dpi.= png (https://maps.hisgis.nl/marken_300dpi.png)=0A=0ABelow the Mapfile. An= y idea what goes wrong here?=0A=0AJan=0A=0Amap=0Aname Markegrenzen=0A=0Aw= eb=0Ametadata=0A"wms_title" "Markegrenzen"=0A"wms_srs" "EPSG:28992 EPSG:3= 857"=0A"wms_extent" "13000 301000 279000 620000"=0A"wms_enable_request" "= *"=0Aend=0Aend=0A=0Aextent 13000 301000 279000 620000=0Aunits meters=0Asi= ze 400 400=0Aresolution 300=0Adefresolution 72=0Aprojection=0A"init=3Deps= g:28992"=0Aend=0A=0Az=0Alayer=0Aname Markegrenzen=0Astatus on=0Atype poly= gon=0Aconnectiontype postgis=0Aconnection "dbname=3Dov options=3D'-c sear= ch_path=3Dhorigheid,public'"=0Adata " the_geom from (=0Aselect gid,the_ge= om,naam from markegrenzen=0A) as foo using unique gid using srid=3D28992= =0A"=0Alabelitem "naam"=0Aclass=0Astyle=0Aoutlinecolor 255 0 0=0Awidth 1= =0Aend=0Alabel=0Acolor 255 0 0=0Asize 4=0Aend=0Aend=0Aend=0Aend =0A _____= __________________________________________=0Amapserver-users mailing list= [email protected] (mailto:[email protected]= g)=0Ahttps://lists.osgeo.org/mailman/listinfo/mapserver-users (https://li= sts.osgeo.org/mailman/listinfo/mapserver-users) ----=_RainLoop_774_571985851.1571321955 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable <!DOCTYPE html><html><head><meta http-equiv=3D"Content-Type" content=3D"t= ext/html; charset=3Dutf-8" /></head><body><div data-html-editor-font-wrap= per=3D"true" style=3D"font-family: arial, sans-serif; font-size: 13px;">H= i,<br><br>The best way is most likely to set up a WMTS service with mapca= che.<br>It handles meta tiling in a more proper way.<br><br>There are goo= d examples in the mapproxy documentation how to do labels in mapserver. <= br><a href=3D"https://mapproxy.org/docs/nightly/labeling.html">https://ma= pproxy.org/docs/nightly/labeling.html</a><br>Mapproxy is anotther good al= ternative instead of mapcache.<br><br>Be sure to specify "labelcache_map_= edge_buffer" "-10" in the mapfile MAP-WEB data section.<br><br>You can st= ill run WMS requests from QGIS towards mapcache if You have enabled that = in the mapcache config.<br><br>/Lars S.<br><br><br>17 oktober 2019 kl. 16= :04, "Jan Hartmann" <<a target=3D"_blank" tabindex=3D"-1" href=3D"mail= to:[email protected]?to=3D%22Jan%20Hartmann%22%20<j.l.h.hartmann@u= va.nl>">[email protected]</a>> skrev:<br> <blockquote><div><div= style=3D"color: #000000;background-color: #FFFFFF">No, neither maxsize n= or partials works. I guess that's just the way QGIS requests large WMS-im= ages.<br><br>There is a "tile_metatile_level" configuration directive tha= t should solve this problem:<br><br><a rel=3D"external nofollow noopener = noreferrer" target=3D"_blank" tabindex=3D"-1" href=3D"https://mapserver.o= rg/output/tile_mode.html">https://mapserver.org/output/tile_mode.html</a>= <br><br>but it does not seem to work for WMS layers.<br><br>So I used the= underlying PostGIS layer in QGIS, and that works OK, of course. Not sure= if this is a bug in MapServer, though.<br><br>Thanks for your help,<br><= br>Jan<br> <div>On 10/16/2019 5:55 PM, Rahkonen Jukka (MML) wrote:</div> = <blockquote type=3D"cite" cite=3D"mid:8322a18c6a834ff3addf1bc9bae56637@C1= 19S212VM042.msvyvi.vaha.local"><div> <p><span style=3D"mso-fareast-langua= ge: EN-US">Hi,</span></p> <p><span style=3D"mso-fareast-language: EN-US" = lang=3D"EN-US">Print composer is probably making tiled requests from WMS.= That is compulsory for any bigger maps because the default maxsize on th= e Mapserver side is 2048x2048 pixels <a moz-do-not-send=3D"true" rel=3D"e= xternal nofollow noopener noreferrer" target=3D"_blank" tabindex=3D"-1" h= ref=3D"https://mapserver.org/uk/mapfile/map.html">https://mapserver.org/u= k/mapfile/map.html</a>. It is easy to increase the maxsize but I do not k= now if print composer as a client can be aware of that.</span></p> <p><sp= an style=3D"mso-fareast-language: EN-US" lang=3D"EN-US">Partials FALSE ma= y help, but based on the screenshot it is possible that print composer is= making requests with some overlap. </span></p> <p><span style=3D"mso-far= east-language: EN-US" lang=3D"EN-US">-Jukka Rahkonen-</span></p> <p><b><s= pan lang=3D"EN-US">L=C3=A4hett=C3=A4j=C3=A4:</span></b><span lang=3D"EN-U= S"> mapserver-users <a rel=3D"external nofollow noopener noreferrer" targ= et=3D"_blank" tabindex=3D"-1" href=3D"mailto:mapserver-users-bounces@list= s.osgeo.org"><[email protected]></a> <b>Puole= sta </b>Travis Kirstine<br><b>L=C3=A4hetetty:</b> keskiviikko 16. lokakuu= ta 2019 18.24<br><b>Vastaanottaja:</b> Jan Hartmann <a rel=3D"external no= follow noopener noreferrer" target=3D"_blank" tabindex=3D"-1" href=3D"mai= lto:[email protected]"><[email protected]></a><br><b>Kopio:= </b> MapServer-users <a rel=3D"external nofollow noopener noreferrer" tar= get=3D"_blank" tabindex=3D"-1" href=3D"mailto:[email protected]= .org"><[email protected]></a><br><b>Aihe:</b> Re: [ma= pserver-users] Doubling of labels on high resolution maps</span></p> <div= > <div><p>There are a few options you could add to your label but I would= start with</p></div> <div></div> <div><p>MINDISTANCE 200</p></div> <div>= <p>PARTIALS FALSE</p></div> <div></div> <div><p>See</p></div> <div><p><a = moz-do-not-send=3D"true" rel=3D"external nofollow noopener noreferrer" ta= rget=3D"_blank" tabindex=3D"-1" href=3D"https://mapserver.org/mapfile/lab= el.html">https://mapserver.org/mapfile/label.html</a></p></div> <div></di= v> <div></div> </div> <div> <div><p>On Wed, 16 Oct 2019 at 10:37, Jan Har= tmann <<a moz-do-not-send=3D"true" rel=3D"external nofollow noopener n= oreferrer" target=3D"_blank" tabindex=3D"-1" href=3D"mailto:j.l.h.hartman= [email protected]">[email protected]</a>> wrote:</p></div> <blockquote styl= e=3D"border: none;border-left: solid #CCCCCC 1.0pt;padding: 0cm 0cm 0cm 6= .0pt;margin-left: 4.8pt;margin-right: 0cm"> <div><div><p style=3D"margin-= bottom: 12.0pt"><span style=3D'font-size: 10.5pt;font-family: "Courier Ne= w"'>Hi,<br><br>I'm trying to generate high resolution print maps with QGI= S, based on a MapServer WMS layer. When displayed in the regular QGIS app= lication with 72dpi, all looks fine. When using the Print Composer based = on the same Mapfile, but with 300dpi, some labels are duplicated (not all= ). Some duplicates are clipped. The two versions can be seen here:<br><br= ><a target=3D"_blank" moz-do-not-send=3D"true" rel=3D"external nofollow n= oopener noreferrer" tabindex=3D"-1" href=3D"https://maps.hisgis.nl/marken= _072dpi.png">https://maps.hisgis.nl/marken_072dpi.png</a><br><a target=3D= "_blank" moz-do-not-send=3D"true" rel=3D"external nofollow noopener noref= errer" tabindex=3D"-1" href=3D"https://maps.hisgis.nl/marken_300dpi.png">= https://maps.hisgis.nl/marken_300dpi.png</a><br><br>Below the Mapfile. An= y idea what goes wrong here?<br><br>Jan<br><br>map<br>name Markegrenzen<b= r><br>web<br>metadata<br>"wms_title" "Markegrenzen"<br>"wms_srs" "EPSG:28= 992 EPSG:3857"<br>"wms_extent" "13000 301000 279000 620000"<br>"wms_enabl= e_request" "*"<br>end<br>end<br><br>extent 13000 301000 279000 620000<br>= units meters<br>size 400 400<br>resolution 300<br>defresolution 72<br><br= ><br>projection<br>"init=3Depsg:28992"<br>end<br><br>z<br>layer<br>name M= arkegrenzen<br>status on<br>type polygon<br>connectiontype postgis<br>con= nection "dbname=3Dov options=3D'-c search_path=3Dhorigheid,public'"<br>da= ta " the_geom from (<br>select gid,the_geom,naam from markegrenzen<br>) a= s foo using unique gid using srid=3D28992<br>"<br>labelitem "naam"<br>cla= ss<br>style<br>outlinecolor 255 0 0<br>width 1<br>end<br>label<br>color 2= 55 0 0<br>size 4<br>end<br>end<br>end<br>end </span><br> </p></div></div>= <p>_______________________________________________<br>mapserver-users ma= iling list<br><a target=3D"_blank" moz-do-not-send=3D"true" rel=3D"extern= al nofollow noopener noreferrer" tabindex=3D"-1" href=3D"mailto:mapserver= [email protected]">[email protected]</a><br><a target= =3D"_blank" moz-do-not-send=3D"true" rel=3D"external nofollow noopener no= referrer" tabindex=3D"-1" href=3D"https://lists.osgeo.org/mailman/listinf= o/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-use= rs</a></p> </blockquote> </div> </div></blockquote> </div></div></blockqu= ote> <br><br><signature></signature> </div></body></html> ----=_RainLoop_774_571985851.1571321955-- --===============5690388377904494308== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbWFwc2VydmVy LXVzZXJzIG1haWxpbmcgbGlzdAptYXBzZXJ2ZXItdXNlcnNAbGlzdHMub3NnZW8ub3JnCmh0dHBz Oi8vbGlzdHMub3NnZW8ub3JnL21haWxtYW4vbGlzdGluZm8vbWFwc2VydmVyLXVzZXJz --===============5690388377904494308==--