Re: Doubling of labels on high resolution maps

Jan Hartmann <[email protected]> Thu, 17 Oct 2019 16:03:47 +0200
Newsgroups gmane.comp.gis.mapserver.user
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============5119072187291797622==
Content-Type: multipart/alternative;
 boundary="------------AD89553AAEC788FC78099381"
Content-Language: nl

This is a multi-part message in MIME format.
--------------AD89553AAEC788FC78099381
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

No, neither maxsize nor partials works. I guess that's just the way QGIS 
requests large WMS-images.

There is a "tile_metatile_level" configuration directive that should 
solve this problem:

https://mapserver.org/output/tile_mode.html

but it does not seem to work for WMS layers.

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.

Thanks for your help,

Jan

On 10/16/2019 5:55 PM, Rahkonen Jukka (MML) wrote:
>
> Hi,
>
> Print composer is probably making tiled requests from WMS. That is 
> compulsory for any bigger maps because the default maxsize on the 
> Mapserver side is 2048x2048 pixels 
> https://mapserver.org/uk/mapfile/map.html. It is easy to increase the 
> maxsize but I do not know if print composer as a client can be aware 
> of that.
>
> Partials FALSE may help, but based on the screenshot it is possible 
> that print composer is making requests with some overlap.
>
> -Jukka Rahkonen-
>
> *Lähettäjä:*mapserver-users <[email protected]> 
> *Puolesta *Travis Kirstine
> *Lähetetty:* keskiviikko 16. lokakuuta 2019 18.24
> *Vastaanottaja:* Jan Hartmann <[email protected]>
> *Kopio:* MapServer-users <[email protected]>
> *Aihe:* Re: [mapserver-users] Doubling of labels on high resolution maps
>
> There are a few options you could add to your label but I would start with
>
> MINDISTANCE 200
>
> PARTIALS FALSE
>
> See
>
> https://mapserver.org/mapfile/label.html
>
> On Wed, 16 Oct 2019 at 10:37, Jan Hartmann <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     Hi,
>
>     I'm trying to generate high resolution print maps with QGIS, based
>     on a MapServer WMS layer. When displayed in the regular QGIS
>     application 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:
>
>     https://maps.hisgis.nl/marken_072dpi.png
>     https://maps.hisgis.nl/marken_300dpi.png
>
>     Below the Mapfile.  Any idea what goes wrong here?
>
>     Jan
>
>     map
>     name Markegrenzen
>
>     web
>       metadata
>         "wms_title" "Markegrenzen"
>         "wms_srs" "EPSG:28992 EPSG:3857"
>         "wms_extent"  "13000 301000 279000 620000"
>         "wms_enable_request" "*"
>       end
>     end
>
>     extent 13000 301000 279000 620000
>     units meters
>     size 400 400
>     resolution 300
>     defresolution 72
>
>
>     projection
>       "init=epsg:28992"
>     end
>
>     z
>     layer
>       name Markegrenzen
>       status on
>       type polygon
>       connectiontype postgis
>       connection "dbname=ov options='-c search_path=horigheid,public'"
>       data " the_geom from (
>             select gid,the_geom,naam from markegrenzen
>         ) as foo using unique gid using srid=28992
>       "
>       labelitem "naam"
>       class
>         style
>             outlinecolor 255 0 0
>             width 1
>         end
>         label
>             color 255 0 0
>             size 4
>         end
>       end
>     end
>     end
>
>     _______________________________________________
>     mapserver-users mailing list
>     [email protected]
>     <mailto:[email protected]>
>     https://lists.osgeo.org/mailman/listinfo/mapserver-users
>


--------------AD89553AAEC788FC78099381
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    No, neither maxsize nor partials works. I guess that's just the way
    QGIS requests large WMS-images.<br>
    <br>
    There is a "tile_metatile_level" configuration directive that should
    solve this problem:<br>
    <br>
    <a href="https://mapserver.org/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>
    <br>
    <div class="moz-cite-prefix">On 10/16/2019 5:55 PM, Rahkonen Jukka
      (MML) wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:[email protected]">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.Shkpostityyli18
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-US">Print composer is probably making tiled
            requests from WMS. That is compulsory for any bigger maps
            because the default maxsize on the Mapserver side is
            2048x2048 pixels
            <a href="https://mapserver.org/uk/mapfile/map.html"
              moz-do-not-send="true">https://mapserver.org/uk/mapfile/map.html</a>.
            It is easy to increase the maxsize but I do not know if
            print composer as a client can be aware of that.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-US">Partials FALSE may help, but based on the
            screenshot it is possible that print composer is making
            requests with some overlap.
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><b><span lang="EN-US">Lähettäjä:</span></b><span
            lang="EN-US"> mapserver-users
            <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a>
            <b>Puolesta </b>Travis Kirstine<br>
            <b>Lähetetty:</b> keskiviikko 16. lokakuuta 2019 18.24<br>
            <b>Vastaanottaja:</b> Jan Hartmann
            <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a><br>
            <b>Kopio:</b> MapServer-users
            <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a><br>
            <b>Aihe:</b> Re: [mapserver-users] Doubling of labels on
            high resolution maps<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <div>
          <div>
            <p class="MsoNormal">There are a few options you could add
              to your label but I would start with<o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal"><o:p> </o:p></p>
          </div>
          <div>
            <p class="MsoNormal">MINDISTANCE 200<o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal">PARTIALS FALSE<o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal"><o:p> </o:p></p>
          </div>
          <div>
            <p class="MsoNormal">See<o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal"><a
                href="https://mapserver.org/mapfile/label.html"
                moz-do-not-send="true">https://mapserver.org/mapfile/label.html</a><o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal"><o:p> </o:p></p>
          </div>
          <div>
            <p class="MsoNormal"><o:p> </o:p></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <div>
            <p class="MsoNormal">On Wed, 16 Oct 2019 at 10:37, Jan
              Hartmann &lt;<a href="mailto:[email protected]"
                moz-do-not-send="true">[email protected]</a>&gt;
              wrote:<o:p></o:p></p>
          </div>
          <blockquote style="border:none;border-left:solid #CCCCCC
            1.0pt;padding:0cm 0cm 0cm
            6.0pt;margin-left:4.8pt;margin-right:0cm">
            <div>
              <div>
                <p class="MsoNormal" style="margin-bottom:12.0pt"><span
                    style="font-size:10.5pt;font-family:&quot;Courier
                    New&quot;">Hi,
                    <br>
                    <br>
                    I'm trying to generate high resolution print maps
                    with QGIS, based on a MapServer WMS layer. When
                    displayed in the regular QGIS application 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 href="https://maps.hisgis.nl/marken_072dpi.png"
                      target="_blank" moz-do-not-send="true">https://maps.hisgis.nl/marken_072dpi.png</a><br>
                    <a href="https://maps.hisgis.nl/marken_300dpi.png"
                      target="_blank" moz-do-not-send="true">https://maps.hisgis.nl/marken_300dpi.png</a><br>
                    <br>
                    Below the Mapfile.  Any idea what goes wrong here? <br>
                    <br>
                    Jan <br>
                    <br>
                    map <br>
                    name Markegrenzen <br>
                    <br>
                    web <br>
                      metadata <br>
                        "wms_title" "Markegrenzen" <br>
                        "wms_srs" "EPSG:28992 EPSG:3857" <br>
                        "wms_extent"  "13000 301000 279000 620000" <br>
                        "wms_enable_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=epsg:28992" <br>
                    end <br>
                    <br>
                    z <br>
                    layer <br>
                      name Markegrenzen <br>
                      status on <br>
                      type polygon <br>
                      connectiontype postgis <br>
                      connection "dbname=ov options='-c
                    search_path=horigheid,public'" <br>
                      data " the_geom from ( <br>
                            select gid,the_geom,naam from markegrenzen <br>
                        ) as foo using unique gid using srid=28992 <br>
                      " <br>
                      labelitem "naam" <br>
                      class <br>
                        style <br>
                            outlinecolor 255 0 0 <br>
                            width 1 <br>
                        end <br>
                        label <br>
                            color 255 0 0 <br>
                            size 4 <br>
                        end <br>
                      end <br>
                    end <br>
                    end <br>
                    <br>
                    <o:p></o:p></span></p>
              </div>
            </div>
            <p class="MsoNormal">_______________________________________________<br>
              mapserver-users mailing list<br>
              <a href="mailto:[email protected]"
                target="_blank" moz-do-not-send="true">[email protected]</a><br>
              <a
                href="https://lists.osgeo.org/mailman/listinfo/mapserver-users"
                target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></p>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>

--------------AD89553AAEC788FC78099381--

--===============5119072187291797622==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbWFwc2VydmVy
LXVzZXJzIG1haWxpbmcgbGlzdAptYXBzZXJ2ZXItdXNlcnNAbGlzdHMub3NnZW8ub3JnCmh0dHBz
Oi8vbGlzdHMub3NnZW8ub3JnL21haWxtYW4vbGlzdGluZm8vbWFwc2VydmVyLXVzZXJz

--===============5119072187291797622==--