Re: [mapserver-users] Doubling of labels on high resolution maps

2019-10-17 Thread lars . schylberg
Hi,

The best way is most likely to set up a WMTS service with mapcache.
It handles meta tiling in a more proper way.

There are good examples in the mapproxy documentation how to do labels in 
mapserver. 
https://mapproxy.org/docs/nightly/labeling.html 
(https://mapproxy.org/docs/nightly/labeling.html)
Mapproxy is anotther good alternative instead of mapcache.

Be sure to specify "labelcache_map_edge_buffer" "-10" in the mapfile MAP-WEB 
data section.

You can still run WMS requests from QGIS towards mapcache if You have enabled 
that in the mapcache config.

/Lars S.
17 oktober 2019 kl. 16:04, "Jan Hartmann" mailto:j.l.h.hartm...@uva.nl?to=%22Jan%20Hartmann%22%20)>
 skrev:
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 
(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 
(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  
(mailto:mapserver-users-boun...@lists.osgeo.org) Puolesta Travis Kirstine
Lähetetty: keskiviikko 16. lokakuuta 2019 18.24
Vastaanottaja: Jan Hartmann  
(mailto:j.l.h.hartm...@uva.nl)
Kopio: MapServer-users  
(mailto:mapserver-users@lists.osgeo.org)
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 
(https://mapserver.org/mapfile/label.html) 
On Wed, 16 Oct 2019 at 10:37, Jan Hartmann mailto:j.l.h.hartm...@uva.nl)> 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_072dpi.png)
https://maps.hisgis.nl/marken_300dpi.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 62"
"wms_enable_request" "*"
end
end

extent 13000 301000 279000 62
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
mapserver-users@lists.osgeo.org (mailto:mapserver-users@lists.osgeo.org)
https://lists.osgeo.org/mailman/listinfo/mapserver-users 
(https://lists.osgeo.org/mailman/listinfo/mapserver-users)
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Doubling of labels on high resolution maps

2019-10-17 Thread Jan Hartmann
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  
*Puolesta *Travis Kirstine

*Lähetetty:* keskiviikko 16. lokakuuta 2019 18.24
*Vastaanottaja:* Jan Hartmann 
*Kopio:* MapServer-users 
*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 > 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 62"
    "wms_enable_request" "*"
  end
end

extent 13000 301000 279000 62
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
mapserver-users@lists.osgeo.org

https://lists.osgeo.org/mailman/listinfo/mapserver-users



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Dynamic wfs_onlineresource

2019-10-17 Thread Matthias Müller
Yves,

thanks for the hint - it works, but produces an ugly URL that exposes
the FS-Link of the mapfile to the public:

https://server1.org/mapserver/?map=/opt/service/mapserver/mapfile.map&"/
>

I should have mentioned that a reverse proxy runs in front of
Mapserver, that adds the mapfile to the request:

  location /mapserver {
# Add header for CORS requests
add_header Access-Control-Allow-Origin *;

# Load from /etc/init.d/mapserv
fastcgi_pass 127.0.0.1:;

# Rewrite url to hide mapfile path
rewrite ^(/mapserver.*)?(.*)$
$1?map=/opt/service/mapserver/mapfile.map$2 break;

include fastcgi_params;
fastcgi_param SCRIPT_NAME /usr/bin/mapserv$fastcgi_script_name;
  }

Is there another solution that works in conjunction with my reverse
proxy? Many other server products respect proxy headers and substitute
the filds of the private internal URL scheme with the corresponding
elements of the public URL of the caller.


- Matthias

Am Donnerstag, den 17.10.2019, 11:37 +0200 schrieb Yves Jacolin:
> Matthias,
> 
> Just remove the parameter will imply that MapServer will find the
> correct online resource.
> 
> Y.
> 
> Le jeu. 17 oct. 2019 à 11:35, Matthias Müller <
> matthias_muel...@tu-dresden.de> a écrit :
> > Hi,
> > 
> > we are running WFS services with similar mapfiles on different
> > servers.
> > 
> > Setting the "wfs_onlineresource" is straight forward, but requires
> > a
> > hard coded host name:
> > 
> > First server:
> >   WEB
> > METADATA
> >   "wfs_title"  "myserver"
> >   "wfs_onlineresource" "https://server1.org/mapserver?;
> >   "wfs_srs""EPSG:4326"
> >   "wfs_enable_request" "*"  # necessary
> > END
> >   END
> > 
> > 
> > Second server:
> >   WEB
> > METADATA
> >   "wfs_title"  "myserver"
> >   "wfs_onlineresource" "https://server2.org/mapserver?;
> >   "wfs_srs""EPSG:4326"
> >   "wfs_enable_request" "*"  # necessary
> > END
> >   END
> > 
> > 
> > I there way to let mapserver figure out the hostname from the
> > request
> > and create the appropiate links in the WFS capabilities
> > accordingly?
> > 
> > Something like:
> > 
> >   WEB
> > METADATA
> >   "wfs_title"  "myserver"
> >   "wfs_online
> > resource" "{request protocol and hostname}/mapserver?"
> >   "wfs_srs"  
> >   "EPSG:4326"
> >   "wfs_enable_request" "*"  # necessary
> > END
> >   END
> > 
> > 
> > -Matthias
> > 
> > ___
> > mapserver-users mailing list
> > mapserver-users@lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Dynamic wfs_onlineresource

2019-10-17 Thread Yves Jacolin
Matthias,

Just remove the parameter will imply that MapServer will find the correct
online resource.

Y.

Le jeu. 17 oct. 2019 à 11:35, Matthias Müller <
matthias_muel...@tu-dresden.de> a écrit :

> Hi,
>
> we are running WFS services with similar mapfiles on different servers.
>
> Setting the "wfs_onlineresource" is straight forward, but requires a
> hard coded host name:
>
> First server:
>   WEB
> METADATA
>   "wfs_title"  "myserver"
>   "wfs_onlineresource" "https://server1.org/mapserver?;
>   "wfs_srs""EPSG:4326"
>   "wfs_enable_request" "*"  # necessary
> END
>   END
>
>
> Second server:
>   WEB
> METADATA
>   "wfs_title"  "myserver"
>   "wfs_onlineresource" "https://server2.org/mapserver?;
>   "wfs_srs""EPSG:4326"
>   "wfs_enable_request" "*"  # necessary
> END
>   END
>
>
> I there way to let mapserver figure out the hostname from the request
> and create the appropiate links in the WFS capabilities accordingly?
>
> Something like:
>
>   WEB
> METADATA
>   "wfs_title"  "myserver"
>   "wfs_online
> resource" "{request protocol and hostname}/mapserver?"
>   "wfs_srs"
>   "EPSG:4326"
>   "wfs_enable_request" "*"  # necessary
> END
>   END
>
>
> -Matthias
>
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users



-- 
Yves Jacolin
Training and support manager - Team Manager
Camptocamp

Tel (France) : +33 4 58 48 20 43
Tel (Switzerland) : +41 21 619 10 43
Mob. : +33 6 18 75 42 21

email : yves.jaco...@camptocamp.com
http://www.camptocamp.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Dynamic wfs_onlineresource

2019-10-17 Thread Matthias Müller
Hi,

we are running WFS services with similar mapfiles on different servers.

Setting the "wfs_onlineresource" is straight forward, but requires a
hard coded host name:

First server:
  WEB
METADATA
  "wfs_title"  "myserver"
  "wfs_onlineresource" "https://server1.org/mapserver?;
  "wfs_srs""EPSG:4326"
  "wfs_enable_request" "*"  # necessary
END
  END


Second server:
  WEB
METADATA
  "wfs_title"  "myserver"
  "wfs_onlineresource" "https://server2.org/mapserver?;
  "wfs_srs""EPSG:4326"
  "wfs_enable_request" "*"  # necessary
END
  END


I there way to let mapserver figure out the hostname from the request
and create the appropiate links in the WFS capabilities accordingly?

Something like:

  WEB
METADATA
  "wfs_title"  "myserver"
  "wfs_online
resource" "{request protocol and hostname}/mapserver?"
  "wfs_srs"  
  "EPSG:4326"
  "wfs_enable_request" "*"  # necessary
END
  END


-Matthias

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users