WMS service problem with mapserver mapfile layer classes

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

WMS service problem with mapserver mapfile layer classes

gorank
When I try to get WMS service in QGIS from this link

http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&

 I get layers defined in mapserver mapfile. When I call lakes as polygons, and lines there is no problem to show this elements together with google map but when I try to call polygon layer with few classes defined with runtime substitution parameter, the layer is not shown.
How to solve it.

Goran
Reply | Threaded
Open this post in threaded view
|

Re: WMS service problem with mapserver mapfile layer classes

jmckenna
Administrator
That's a cool WMS service!

Regarding your problem, I suppose you should include more details like
parts of your mapfile, so the community can help you.

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/



On 2015-06-02 4:58 PM, gorank wrote:

> When I try to get WMS service in QGIS from this link
>
> http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&
>
>   I get layers defined in mapserver mapfile. When I call lakes as polygons,
> and lines there is no problem to show this elements together with google map
> but when I try to call polygon layer with few classes defined with runtime
> substitution parameter, the layer is not shown.
> How to solve it.
>
> Goran
>
>
_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: WMS service problem with mapserver mapfile layer classes

gorank
Thanks Jeff, part of the mapfile for particular layer is as follow. It shows municipalities in few classes with differrent criteria for attribute YEAR that is chosen from dropdown list in openlayers

LAYER
    DATA "NAS001.shp"
    EXTENT 7407523.716202 4519137.450122 7716943.221608 4697261.550122
    LABELITEM "OPT"
    LABELMAXSCALEDENOM 443652
    METADATA
      "wms_srs" "EPSG:3909 EPSG:4326 EPSG:900913 EPSG:6316"
      "wms_onlineresource" "http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&"
      "wms_enable_request" "*"
      "wms_feature_info_mime_type" "text/html"
      "coordsys_name" "EPSG:3909 - MGI 1901 / Balkans zone 7"
      "wms_title" "Opstini"
         
           
         
    END # METADATA
    NAME "Opstini"
    PROJECTION
      "init=epsg:3909"
    END # PROJECTION
    STATUS ON
    TEMPLATE "query"
    TILEITEM "location"
    TYPE POLYGON
    UNITS METERS
    VALIDATION
      "godina" "^[12][09][0-9][0-9]$"            #THIS IS RUNTIME SUBSTITION PARAMETER IT MEANS "YEAR"
         
    END # VALIDATION
    CLASS
      NAME "klasa_1"
      EXPRESSION ([%godina%] > 0 and [%godina%] < 5)
      LABEL
        FONT "arial"
        SIZE 8
        ENCODING "ISO-8859-5"
        OFFSET 0 0
        POSITION CC
        SHADOWSIZE 1 1
        TYPE TRUETYPE
      END # LABEL
      STYLE
        COLOR 255 255 128
        OUTLINECOLOR 130 130 130
        WIDTH 0.5
      END # STYLE
      TITLE "4.9 -у223"
    END # CLASS
    CLASS
      NAME "klasa_2"
      EXPRESSION ([%godina%] >= 5 and [%godina%] < 10)
      LABEL
        FONT "arial"
        SIZE 8
        ENCODING "CP1251"
        OFFSET 0 0
        POSITION CC
        SHADOWSIZE 1 1
        TYPE TRUETYPE
      END # LABEL
      STYLE
        COLOR 250 209 85
        OUTLINECOLOR 130 130 130
        WIDTH 0.5
      END # STYLE
      TITLE "5.0 - 9.9 -"
    END # CLASS
    CLASS
      NAME "klasa_3"
      EXPRESSION ([%godina%] >=10 and [%godina%] < 15)
      LABEL
        FONT "arial"
        SIZE 8
        ENCODING "CP1251"
        OFFSET 0 0
        POSITION CC
        SHADOWSIZE 1 1
        TYPE TRUETYPE
      END # LABEL
      STYLE
        COLOR 242 167 46
        OUTLINECOLOR 130 130 130
        WIDTH 0.5
      END # STYLE
      TITLE "10.0 - 14.9 -"
    END # CLASS
    CLASS
      NAME "klasa_4"
      EXPRESSION ([%godina%] >= 15 and [%godina%] < 20)
      LABEL
        FONT "arial"
        SIZE 8
        ENCODING "CP1251"
        OFFSET 0 0
        POSITION CC
        SHADOWSIZE 1 1
        TYPE TRUETYPE
      END # LABEL
      STYLE
        COLOR 173 83 19
        OUTLINECOLOR 130 130 130
        WIDTH 0.5
      END # STYLE
      TITLE "15.0 - 19.9 - 5"
    END # CLASS
    CLASS
      NAME "klasa_5"
      EXPRESSION ([%godina%] >= 20 and [%godina%] < 10000)
      LABEL
        FONT "arial"
        SIZE 8
        ENCODING "CP1251"
        OFFSET 0 0
        POSITION CC
        SHADOWSIZE 1 1
        TYPE TRUETYPE
      END # LABEL
      STYLE
        COLOR 107 0 0
        OUTLINECOLOR 130 130 130
        WIDTH 0.5
      END # STYLE
      TITLE "20 и повеќе"
    END # CLASS
    CLASS
      NAME "klasa_0"
      EXPRESSION ([%godina%] = 100000)
      LABEL
        FONT "arial"
        SIZE 8
        ENCODING "CP1251"
        OFFSET 0 0
        POSITION CC
        SHADOWSIZE 1 1
        TYPE TRUETYPE
      END # LABEL
      STYLE
        COLOR 100 100 100
        OUTLINECOLOR 130 130 130
        WIDTH 0.5
      END # STYLE
      TITLE "нема појава"
    END # CLASS
    CLASS
      EXPRESSION ([%godina%] = 10000)
      LABEL
        FONT "arial"
        SIZE 8
        ENCODING "ISO-8859-5"
        OFFSET 0 0
        POSITION CC
        SHADOWSIZE 1 1
        TYPE TRUETYPE
      END # LABEL
      STYLE
        COLOR 200 200 200
        OUTLINECOLOR 130 130 130
        WIDTH 0.5
      END # STYLE
    END # CLASS
  END # LAYER

The Full URL

http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:7269&FORMAT=image/png&LAYERS=Opstini%2CRegioni%2CDrzGran%2CEzera&GODINA=2009&BBOX=436350.358101,4509075,688350.358101,4698075&WIDTH=800&HEIGHT=600 

shows the map in the browser.

Goran
Reply | Threaded
Open this post in threaded view
|

Re: WMS service problem with mapserver mapfile layer classes

Ben Madin-2
Goran,

It is not clear to me what you are trying to do. It appears that you are suggesting including a year (‘godina’?) in your request,

> On 2015-06-03, at 04:33 , gorank <[hidden email]> wrote:
>
>    VALIDATION
>      "godina" "^[12][09][0-9][0-9]$"            #THIS IS RUNTIME SUBSTITION PARAMETER IT MEANS “YEAR"
>    END # VALIDATION


 but the classes in the mapfile seem to be expecting numbers from 0 up? Is this what you wanted, or are there values in the dbf columns that you wanted to be using?

>    CLASS
>      NAME "klasa_1"
>      EXPRESSION ([%godina%] > 0 and [%godina%] < 5)
>      LABEL
>        FONT "arial"
>        SIZE 8
>        ENCODING "ISO-8859-5"


cheers

Ben

--

Ben Madin

t : +61 8 6102 5535
m : +61 448 887 220
e : [hidden email]

AusVet Animal Health Services
Western Australia

AusVet's website:  http://www.ausvet.com.au

This transmission is for the intended addressee only and is confidential information. If you have received this transmission in error, please delete it and notify the sender. The contents of this email are the opinion of the writer only and are not endorsed by AusVet Animal Health Services unless expressly stated otherwise. Although AusVet uses virus scanning software we do not accept liability for viruses or similar in any attachments. Thanks for reading.

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: WMS service problem with mapserver mapfile layer classes

gorank
This post was updated on .
Here is image of all layers defined in mapfile and called with URL

http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:7269&FORMAT=image/png&LAYERS=Opstini%2CRegioni%2CDrzGran%2CEzera&GODINA=2009&BBOX=436350.358101,4509075,688350.358101,4698075&WIDTH=800&HEIGHT=600 



Here is image of QGIS with all layers called plus Google Maps. All defined layers in mapfile are shown except of layer Opstini (means municipalities).



Why I cannot see the layer with municipalities and few classes?

Goran
Reply | Threaded
Open this post in threaded view
|

Re: WMS service problem with mapserver mapfile layer classes

Jörg Thomsen
Hi Goran,

problem solved? it seems to work...?

these two requests result in different maps:

http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:7269&FORMAT=image/png&LAYERS=Opstini%2CRegioni%2CDrzGran%2CEzera&&BBOX=436350.358101,4509075,688350.358101,4698075&WIDTH=800&HEIGHT=600&GODINA=2013%20%3E%3E%20mapsermapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:7269&FORMAT=image/png&LAYERS=Opstini,Regioni,DrzGran,Ezera&&BBOX=436350.358101,4509075,688350.358101,4698075&WIDTH=800&HEIGHT=600&GODINA=2013

http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:7269&FORMAT=image/png&LAYERS=Opstini%2CRegioni%2CDrzGran%2CEzera&&BBOX=436350.358101,4509075,688350.358101,4698075&WIDTH=800&HEIGHT=600&GODINA=2013%20%3E%3E%20mapsermapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:7269&FORMAT=image/png&LAYERS=Opstini,Regioni,DrzGran,Ezera&&BBOX=436350.358101,4509075,688350.358101,4698075&WIDTH=800&HEIGHT=600&GODINA=2009

What I don't understand is your classification. The validation only
allows 4-digit values and there's only one class that fits ( EXPRESSION
([%godina%] >= 20 and [%godina%] < 10000)).

Or do you only wnat to know why your WMS does not work with qgis?
There you have to add your vendor parameter to the base url:
http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&GODINA=2013&

*AND* you have to check the option 'ingnore getMap-URI from
Capabilities' (or sth like that, don't know the english expression).

Jörg


Am 02.06.2015 um 23:30 schrieb gorank:

> Here is image of all layers defined in mapfile and called with URL
>
> http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:7269&FORMAT=image/png&LAYERS=Opstini%2CRegioni%2CDrzGran%2CEzera&GODINA=2009&BBOX=436350.358101,4509075,688350.358101,4698075&WIDTH=800&HEIGHT=600 
>
> <http://osgeo-org.1560.x6.nabble.com/file/n5208769/WMS_Browser.png>
>
> Here is image of QGIS with all layers called plus Google Maps. All defined
> layers in mapfile are shown except of layer Opstini (means municipalities).
>
> <http://osgeo-org.1560.x6.nabble.com/file/n5208769/WMS_QGis.png>  
>
> Why I cannot see the layer with municipalities and few classes?
>
> Goran
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/WMS-service-problem-with-mapserver-mapfile-layer-classes-tp5208743p5208769.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> _______________________________________________
> mapserver-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: WMS service problem with mapserver mapfile layer classes

gorank
Hi Jorg,
It works with you help. Thanks. Actually I had problem to show municipalities in qgis but your suggestion to add YEAR in service url, solves the problem. I use shapefile with Year as attribute name (time series from 2009 to 2013) so in openlayers I select year from dropdown list and in the map show values from the shossen column.

I would like from you confirmation url that you gave
http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&GODINA=2013&

is final WMS url that users should have from our side, to access our WMS service?

Goran
Reply | Threaded
Open this post in threaded view
|

Re: WMS service problem with mapserver mapfile layer classes

Jörg Thomsen
Hi Goran,

> I would like from you confirmation url that you gave
>
http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&GODINA=2013&

yes that's what I meant yesterday for testing it in qgis, but if you
want provide your url to others you should have a look at
http://mapserver.org/cgi/runsub.html#default-values-if-not-provided-in-the-url

Jörg


Am 03.06.2015 um 17:59 schrieb gorank:

> Hi Jorg,
> It works with you help. Thanks. Actually I had problem to show
> municipalities in qgis but your suggestion to add YEAR in service url,
> solves the problem. I use shapefile with Year as attribute name (time series
> from 2009 to 2013) so in openlayers I select year from dropdown list and in
> the map show values from the shossen column.
>
> I would like from you confirmation url that you gave
> http://mapserver.stat.gov.mk/cgi-bin/GDZS/wms?map=/ms4w/apps/GDZS/NAS001_op.map&GODINA=2013&
>
> is final WMS url that users should have from our side, to access our WMS
> service?





> Goran
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/WMS-service-problem-with-mapserver-mapfile-layer-classes-tp5208743p5208979.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> _______________________________________________
> mapserver-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: WMS service problem with mapserver mapfile layer classes

gorank
Hi Jorg,

I have put default value for 2010 on LAYER and CLASS level validation part
VALIDATION
        "default_godina" "2010"
END #VALIDATION

but i'm not sure is it enough for others to use wms service without problems.

Goran
Reply | Threaded
Open this post in threaded view
|

Re: WMS service problem with mapserver mapfile layer classes

gorank
I have changed it, actually deleted validation statement on CLASS level and add in LAYER METADATA

"default_godina" "2010"

and now the map for 2010 is shown.

My question is, what should have the user to get map for year 2011 or 2013, because, I suppose, that always when I call the mapfile I will receive map for year 2010 (as default value) .

Any suggestions?

Goran
Reply | Threaded
Open this post in threaded view
|

Re: WMS service problem with mapserver mapfile layer classes

Jörg Thomsen
Am 04.06.2015 um 13:00 schrieb gorank:

> I have changed it, actually deleted validation statement on CLASS level and
> add in LAYER METADATA
>
> *"default_godina" "2010"*
>
> and now the map for 2010 is shown.
>
> My question is, what should have the user to get map for year 2011 or 2013,
> because, I suppose, that always when I call the mapfile I will receive map
> for year 2010 (as default value) .

The user has to add the &GODINA Paramater to the url, it will overwrite
the default. That's why it is called default ;)

If you want to tell the user what to, you could use a default which is
not in your data (e.g. 1000) and create an annotation (label) within
this class where you decribe that he needs the &GODINA parameter for
proper work of the wms.

the OGC-Way would be to include the paramater in the Capabilities XML
(s.
http://cite.opengeospatial.org/OGCTestData/wms/1.1.1/spec/wms1.1.1.html#basic_elements.params.vsps).
But I don't know how to do that.

Jörg

>
> Any suggestions?
>
> Goran
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/WMS-service-problem-with-mapserver-mapfile-layer-classes-tp5208743p5209115.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> _______________________________________________
> mapserver-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: WMS service problem with mapserver mapfile layer classes

gorank
Hi Jorg, thanks for your explanations that are very useful for me.

Goran