Discussion:
WMS rendering
Francesco Palermo
2014-10-16 15:04:18 UTC
Permalink
Hello,
I'm experimenting the use of Mapserver as WMS and I'm encountering some
problems on map rendering. I'm using a shapefile as a map source and
it's a map of points (generated by a csv using ogr2ogr - Could I use
directly csv with Mapserver? I don't know). I can't get the rendering of
this map using for example QGIS or this URL in the browser (which I hope
it's correct):
http://localhost/cgi-bin/mapserv?map=/home/francesco/shared/mapserver/wms.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:4326&BBOX=9.2990,43.0105,9.4894,43.0524&WIDTH=500&HEIGHT=300&FORMAT=image/png&LAYERS=test&

This is the mapfile:
MAP
NAME "test"
STATUS ON
SIZE 500 300
IMAGETYPE PNG
EXTENT 9.2990 43.0105 9.4894 43.0524
UNITS METERS
DEBUG 5
PROJECTION
"init=epsg:4269"
END
WEB
TEMPLATE "template.html"
IMAGEPATH "/var/www/html/tmp/"
IMAGEURL "/tmp/"
METADATA
"wms_title" "WMS Demo Server"
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?"
"wms_srs" "EPSG:42304 EPSG:42101 EPSG:4269 EPSG:4326"
"wms_enable_request" "*"
END
END
#IMAGECOLOR 255 255 255
TRANSPARENT ON
SHAPEPATH "oilspill/"
OUTPUTFORMAT
NAME "png"
DRIVER AGG/PNG
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "GAMMA=0.75"
END
SYMBOL
NAME "square"
TYPE vector
POINTS
0 0
0 1
1 1
1 0
0 0
END
FILLED true
ANCHORPOINT 0.5 0.5
END
LAYER
NAME "test"
TYPE POINT
STATUS DEFAULT
DATA "timestep24"
DEBUG 5
SIZEUNITS meters
PROJECTION
"init=epsg:4269"
END
METADATA
"wms_title" "test"
END
CLASSITEM "weight"
CLASS
STYLE
COLOR "#1014FF"
SYMBOL "square"
SIZE 0.0019
END
END
END
END

Any suggestions? Are there any errors in the mapfile? Or am I wrong in
the procedure?

Thanks,
Francesco
Jörg Thomsen
2014-10-16 15:22:38 UTC
Permalink
Hello Francesco,

no error-message, only a blank image?
What's in the error-log? The MS_ERRORFILE ist set in httpd.conf?

I think symbol is veryvery small. Try >= 1.

You can use a csv-file in MapServer via OGR :)
http://mapserver.org/input/vector/ogr.html

Jörg
Post by Francesco Palermo
Hello,
I'm experimenting the use of Mapserver as WMS and I'm encountering some
problems on map rendering. I'm using a shapefile as a map source and
it's a map of points (generated by a csv using ogr2ogr - Could I use
directly csv with Mapserver? I don't know). I can't get the rendering of
this map using for example QGIS or this URL in the browser (which I hope
http://localhost/cgi-bin/mapserv?map=/home/francesco/shared/mapserver/wms.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:4326&BBOX=9.2990,43.0105,9.4894,43.0524&WIDTH=500&HEIGHT=300&FORMAT=image/png&LAYERS=test&
MAP
NAME "test"
STATUS ON
SIZE 500 300
IMAGETYPE PNG
EXTENT 9.2990 43.0105 9.4894 43.0524
UNITS METERS
DEBUG 5
PROJECTION
"init=epsg:4269"
END
WEB
TEMPLATE "template.html"
IMAGEPATH "/var/www/html/tmp/"
IMAGEURL "/tmp/"
METADATA
"wms_title" "WMS Demo Server"
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?"
"wms_srs" "EPSG:42304 EPSG:42101 EPSG:4269 EPSG:4326"
"wms_enable_request" "*"
END
END
#IMAGECOLOR 255 255 255
TRANSPARENT ON
SHAPEPATH "oilspill/"
OUTPUTFORMAT
NAME "png"
DRIVER AGG/PNG
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "GAMMA=0.75"
END
SYMBOL
NAME "square"
TYPE vector
POINTS
0 0
0 1
1 1
1 0
0 0
END
FILLED true
ANCHORPOINT 0.5 0.5
END
LAYER
NAME "test"
TYPE POINT
STATUS DEFAULT
DATA "timestep24"
DEBUG 5
SIZEUNITS meters
PROJECTION
"init=epsg:4269"
END
METADATA
"wms_title" "test"
END
CLASSITEM "weight"
CLASS
STYLE
COLOR "#1014FF"
SYMBOL "square"
SIZE 0.0019
END
END
END
END
Any suggestions? Are there any errors in the mapfile? Or am I wrong in
the procedure?
Thanks,
Francesco
_______________________________________________
mapserver-users mailing list
http://lists.osgeo.org/mailman/listinfo/mapserver-users
thomas bonfort
2014-10-16 17:44:07 UTC
Permalink
sizeunits meters along with size 0.0019 is very probably false unless
you're mapping microscopic particles :) try removing the sizeunits
parameter completely and setting size to something visible in pixels
(e.g. 3-5), once that is working you can start looking into
scale-dependant rendering with sizeunits....

--
thomas
Post by Francesco Palermo
Hello,
I'm experimenting the use of Mapserver as WMS and I'm encountering some
problems on map rendering. I'm using a shapefile as a map source and it's a
map of points (generated by a csv using ogr2ogr - Could I use directly csv
with Mapserver? I don't know). I can't get the rendering of this map using
http://localhost/cgi-bin/mapserv?map=/home/francesco/shared/mapserver/wms.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:4326&BBOX=9.2990,43.0105,9.4894,43.0524&WIDTH=500&HEIGHT=300&FORMAT=image/png&LAYERS=test&
MAP
NAME "test"
STATUS ON
SIZE 500 300
IMAGETYPE PNG
EXTENT 9.2990 43.0105 9.4894 43.0524
UNITS METERS
DEBUG 5
PROJECTION
"init=epsg:4269"
END
WEB
TEMPLATE "template.html"
IMAGEPATH "/var/www/html/tmp/"
IMAGEURL "/tmp/"
METADATA
"wms_title" "WMS Demo Server"
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?"
"wms_srs" "EPSG:42304 EPSG:42101 EPSG:4269 EPSG:4326"
"wms_enable_request" "*"
END
END
#IMAGECOLOR 255 255 255
TRANSPARENT ON
SHAPEPATH "oilspill/"
OUTPUTFORMAT
NAME "png"
DRIVER AGG/PNG
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "GAMMA=0.75"
END
SYMBOL
NAME "square"
TYPE vector
POINTS
0 0
0 1
1 1
1 0
0 0
END
FILLED true
ANCHORPOINT 0.5 0.5
END
LAYER
NAME "test"
TYPE POINT
STATUS DEFAULT
DATA "timestep24"
DEBUG 5
SIZEUNITS meters
PROJECTION
"init=epsg:4269"
END
METADATA
"wms_title" "test"
END
CLASSITEM "weight"
CLASS
STYLE
COLOR "#1014FF"
SYMBOL "square"
SIZE 0.0019
END
END
END
END
Any suggestions? Are there any errors in the mapfile? Or am I wrong in the
procedure?
Thanks,
Francesco
_______________________________________________
mapserver-users mailing list
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Håvard Tveite
2014-10-17 09:03:11 UTC
Permalink
Hi Francesco,

Do you get any error messages?

Your map file looks a bit like the example from the WMS
Server documentation (http://mapserver.org/ogc/wms_server.html),
and that should be a good starting point.

To make it easier to find the source of your problems, I
suggest that you start with the basic example in the
WMS Server documentation and expand it gradually.

Håvard

PS: You are using SIZEUNITS meters in your test layer. That
means that your SIZE 0.0019 symbols will be very small if
you are not operating close to a 1:1 map scale.
Post by Francesco Palermo
Hello,
http://localhost/cgi-bin/mapserv?map=/home/francesco/shared/mapserver/wms.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:4326&BBOX=9.2990,43.0105,9.4894,43.0524&WIDTH=500&HEIGHT=300&FORMAT=image/png&LAYERS=test&
MAP
NAME "test"
STATUS ON
SIZE 500 300
IMAGETYPE PNG
EXTENT 9.2990 43.0105 9.4894 43.0524
UNITS METERS
DEBUG 5
PROJECTION
"init=epsg:4269"
END
WEB
TEMPLATE "template.html"
IMAGEPATH "/var/www/html/tmp/"
IMAGEURL "/tmp/"
METADATA
"wms_title" "WMS Demo Server"
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?"
"wms_srs" "EPSG:42304 EPSG:42101 EPSG:4269 EPSG:4326"
"wms_enable_request" "*"
END
END
#IMAGECOLOR 255 255 255
TRANSPARENT ON
SHAPEPATH "oilspill/"
OUTPUTFORMAT
NAME "png"
DRIVER AGG/PNG
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "GAMMA=0.75"
END
SYMBOL
NAME "square"
TYPE vector
POINTS
0 0
0 1
1 1
1 0
0 0
END
FILLED true
ANCHORPOINT 0.5 0.5
END
LAYER
NAME "test"
TYPE POINT
STATUS DEFAULT
DATA "timestep24"
DEBUG 5
SIZEUNITS meters
PROJECTION
"init=epsg:4269"
END
METADATA
"wms_title" "test"
END
CLASSITEM "weight"
CLASS
STYLE
COLOR "#1014FF"
SYMBOL "square"
SIZE 0.0019
END
END
END
END
Any suggestions? Are there any errors in the mapfile? Or am I wrong in the procedure?
Thanks,
Francesco
_______________________________________________
mapserver-users mailing list
http://lists.osgeo.org/mailman/listinfo/mapserver-users
--
Håvard Tveite
Department of Mathematical Sciences and Technology, NMBU
Drøbakveien 31, POBox 5003, N-1432 Ås, NORWAY
Phone: +47 64965483 Fax: +47 64965401 http://www.nmbu.no/imt/
Francesco Palermo
2014-10-21 20:10:24 UTC
Permalink
No, I don't get any error message.
I tried to remove UNITS on mapfile but it doesn't change anything. Then
I tried to remove SIZEUNITS from the layer and the map finally appears!
Thanks to all!
Now I'll try to overlay this map on the Google Maps ;)

Francesco
Post by HÃ¥vard Tveite
Hi Francesco,
Do you get any error messages?
Your map file looks a bit like the example from the WMS
Server documentation (http://mapserver.org/ogc/wms_server.html),
and that should be a good starting point.
To make it easier to find the source of your problems, I
suggest that you start with the basic example in the
WMS Server documentation and expand it gradually.
Håvard
PS: You are using SIZEUNITS meters in your test layer. That
means that your SIZE 0.0019 symbols will be very small if
you are not operating close to a 1:1 map scale.
Post by Francesco Palermo
Hello,
I'm experimenting the use of Mapserver as WMS and I'm encountering
some problems on map rendering. I'm using a shapefile as a map source
and it's a map of points (generated by a csv using ogr2ogr - Could I
use directly csv with Mapserver? I don't know). I can't get the
rendering of this map using for example QGIS or this URL in the
http://localhost/cgi-bin/mapserv?map=/home/francesco/shared/mapserver/wms.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:4326&BBOX=9.2990,43.0105,9.4894,43.0524&WIDTH=500&HEIGHT=300&FORMAT=image/png&LAYERS=test&
MAP
NAME "test"
STATUS ON
SIZE 500 300
IMAGETYPE PNG
EXTENT 9.2990 43.0105 9.4894 43.0524
UNITS METERS
DEBUG 5
PROJECTION
"init=epsg:4269"
END
WEB
TEMPLATE "template.html"
IMAGEPATH "/var/www/html/tmp/"
IMAGEURL "/tmp/"
METADATA
"wms_title" "WMS Demo Server"
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?"
"wms_srs" "EPSG:42304 EPSG:42101 EPSG:4269 EPSG:4326"
"wms_enable_request" "*"
END
END
#IMAGECOLOR 255 255 255
TRANSPARENT ON
SHAPEPATH "oilspill/"
OUTPUTFORMAT
NAME "png"
DRIVER AGG/PNG
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "GAMMA=0.75"
END
SYMBOL
NAME "square"
TYPE vector
POINTS
0 0
0 1
1 1
1 0
0 0
END
FILLED true
ANCHORPOINT 0.5 0.5
END
LAYER
NAME "test"
TYPE POINT
STATUS DEFAULT
DATA "timestep24"
DEBUG 5
SIZEUNITS meters
PROJECTION
"init=epsg:4269"
END
METADATA
"wms_title" "test"
END
CLASSITEM "weight"
CLASS
STYLE
COLOR "#1014FF"
SYMBOL "square"
SIZE 0.0019
END
END
END
END
Any suggestions? Are there any errors in the mapfile? Or am I wrong in the procedure?
Thanks,
Francesco
_______________________________________________
mapserver-users mailing list
http://lists.osgeo.org/mailman/listinfo/mapserver-users
--
Francesco Palermo
Rahkonen Jukka (Tike)
2014-10-17 13:11:00 UTC
Permalink
Hi,


I tested your mapfile and I believe that you indeed have trouble with 0.0019 meters wide box symbol that does not show easily.
If you leave out sizeunits or use the default unit "pixels" and size of around 10 the symbol should show at all scales. Of course you can use meters as well with some reasonable value as size.

Some comments about your mapfile:
- Do not use the same name for the whole service (MAP-NAME) and a layer (LAYER-NAME). In this case it does not matter because you have only one layer. If you add more, with &layers=test you would get all layers that you have in the mapfile.
- MAP-UNITS should match the MAP-PROJECTION, thus correct for you is UNITS DD

For the developers, shouldn't we have some built-in symbols for the points so that poor new users would not need to create a symbol before getting points visible? Even just a filled circle
SYMBOL
NAME "point"
TYPE ELLIPSE
POINTS
1 1
END
FILLED TRUE
END

That would be used automatically if mapfile has only
CLASS
STYLE
COLOR 0 0 0
SIZE 30
END
END

However, why not to make a built-in support for all these which the SLD specification mandates (copied from Geoserver docs):
Name Description
square A square
circle A circle
triangle A triangle pointing up
star five-pointed star
cross A square cross with space around (not suitable for hatch fills)
x A square X with space around (not suitable for hatch fills)

-Jukka Rahkonen-
Post by HÃ¥vard Tveite
Hi Francesco,
Do you get any error messages?
Your map file looks a bit like the example from the WMS Server documentation
(http://mapserver.org/ogc/wms_server.html),
and that should be a good starting point.
To make it easier to find the source of your problems, I suggest that you start
with the basic example in the WMS Server documentation and expand it
gradually.
Håvard
PS: You are using SIZEUNITS meters in your test layer. That means that your SIZE
0.0019 symbols will be very small if you are not operating close to a 1:1 map
scale.
Post by Francesco Palermo
Hello,
I'm experimenting the use of Mapserver as WMS and I'm encountering some
problems on map rendering. I'm using a shapefile as a map source and it's a map
of points (generated by a csv using ogr2ogr - Could I use directly csv with
Mapserver? I don't know). I can't get the rendering of this map using for
Post by Francesco Palermo
http://localhost/cgi-bin/mapserv?map=/home/francesco/shared/mapserver/
wms.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=
EPSG:4326
&BBOX=9.2990,43.0105,9.4894,43.0524&WIDTH=500&HEIGHT=300&FORMAT=i
mage/
Post by Francesco Palermo
png&LAYERS=test&
MAP
NAME "test"
STATUS ON
SIZE 500 300
IMAGETYPE PNG
EXTENT 9.2990 43.0105 9.4894 43.0524
UNITS METERS
DEBUG 5
PROJECTION
"init=epsg:4269"
END
WEB
TEMPLATE "template.html"
IMAGEPATH "/var/www/html/tmp/"
IMAGEURL "/tmp/"
METADATA
"wms_title" "WMS Demo Server"
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?"
"wms_srs" "EPSG:42304 EPSG:42101 EPSG:4269 EPSG:4326"
"wms_enable_request" "*"
END
END
#IMAGECOLOR 255 255 255
TRANSPARENT ON
SHAPEPATH "oilspill/"
OUTPUTFORMAT
NAME "png"
DRIVER AGG/PNG
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "GAMMA=0.75"
END
SYMBOL
NAME "square"
TYPE vector
POINTS
0 0
0 1
1 1
1 0
0 0
END
FILLED true
ANCHORPOINT 0.5 0.5
END
LAYER
NAME "test"
TYPE POINT
STATUS DEFAULT
DATA "timestep24"
DEBUG 5
SIZEUNITS meters
PROJECTION
"init=epsg:4269"
END
METADATA
"wms_title" "test"
END
CLASSITEM "weight"
CLASS
STYLE
COLOR "#1014FF"
SYMBOL "square"
SIZE 0.0019
END
END
END
END
Any suggestions? Are there any errors in the mapfile? Or am I wrong in the
procedure?
Post by Francesco Palermo
Thanks,
Francesco
_______________________________________________
mapserver-users mailing list
http://lists.osgeo.org/mailman/listinfo/mapserver-users
--
Håvard Tveite
Department of Mathematical Sciences and Technology, NMBU Drøbakveien 31,
POBox 5003, N-1432 Ås, NORWAY
Phone: +47 64965483 Fax: +47 64965401 http://www.nmbu.no/imt/
_______________________________________________
mapserver-users mailing list
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Continue reading on narkive:
Loading...