Quantcast

WMS Client does not recognize "wms_extent"

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

WMS Client does not recognize "wms_extent"

Heiko Schröter
Hello,

mapserver seems not to take "wms_extent" into account when receiving raster images via WMS.
According to the docs this tag should take precedence over all others.

Case 1, SRC Projection = DST Projection :
a) Images are displayed correctly when read via DATA statement. msResampleGDALToMap() called.
b) Images are displayed incorrectly when read via WMS. wld_file does not matter. msDrawRasterLayerGDAL() called. Calling msResampleGDALToMap() instead fixes this.

Case 2, SRC Projection != DST Projection
a) Images are displayed correctly when read via DATA statement. msResampleGDALToMap() called.
b) Images are displayed incorrectly when read via WMS. wld_file does matter. msResampleGDALToMap() called. "wms_extent" not recognized and does not take precedence. Bug(?) in msGetGDALGeoTransform().
Force Removing the wld_file in mapwmslayer.c in function msDrawWMSLayerLow() before msDrawLayer() is called, forces same proceeding as with images read via DATA statement and fixes it.


Else something is broken in the processing logic of the WMS (client) handling or i'am doing something completely wrong (and stupid).

Thanks and Regards
Heiko


/var/www/localhost/mapserver/mapserv -v
MapServer version 5.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE


The image recieved via WMS is the same as the in the DATA statment.
        LAYER
                EXTENT -180 -90 180 90
                NAME "GRID_TEST"
                OPACITY 60
                STATUS ON
                DEBUG ON
                METADATA
                        "wms_timeextent" "1970-01-01/2030-12-31"
                        "wms_timeitem" "datum" #column in postgis table of type timestamp
                        "wms_timedefault" "2007-12-10/2007-12-11"
                        "wms_title" "grid_test"
                        "wms_name" "grid_test"
                        "wms_format" "image/png"
                        "wms_server_version" "1.1.1"
                        "wms_srs" "EPSG:4326"
                        "wms_extent" "-180 -90 180 90"
                END
                PROJECTION
                        "init=epsg:4326"
                END
                CONNECTION "http://mailserv2/cgi-bin/grid_test.pl?"
                CONNECTIONTYPE WMS
# DATA "/var/www/localhost/htdocs/grafik/wackelkontakt.png"
                TYPE RASTER
        END # Layer



        LAYER
                EXTENT -180 -90 180 90
                NAME "GRID_TEST1"
                OPACITY 60
                STATUS ON
                DEBUG ON
                METADATA
                        "wms_timeextent" "1970-01-01/2030-12-31"
                        "wms_timeitem" "datum" #column in postgis table of type timestamp
                        "wms_timedefault" "2007-12-10/2007-12-11"
                        "wms_title" "grid_test1"
                        "wms_name" "grid_test1"
                        "wms_format" "image/png"
                        "wms_server_version" "1.1.1"
                        "wms_srs" "EPSG:4326"
                        "wms_extent" "-180 -90 180 90"
                END
                PROJECTION
                        "init=epsg:4326"
                END
# CONNECTION "http://mailserv2/cgi-bin/grid_test.pl?"
# CONNECTIONTYPE WMS
                DATA "/var/www/localhost/htdocs/grafik/wackelkontakt.png"
                TYPE RASTER
        END # Layer
_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: WMS Client does not recognize "wms_extent"

Jukka Rahkonen
Hi,

I am not sure about what is going wrong but I do not really believe that changing from a local image to remote WMS service is quite as straight forward as you seem to suppose.

When you use a local image you are creating the original WMS layer yourself.  The METADATA section is describing your service.  In case of cascading WMS the METADATA section has (mostly) different meaning: it is telling the instructions for your Mapserver about how to make a connection with the remote server.  Therefore some of your METADATA lines do not make sense with a remote WMS.  I suppose "wms_extent" is one of those.  You cannot set the extents of the remote WMS layer, they are set by the remote server which in this case is http://mailserv2/cgi-bin/grid_test.pl?

Perhaps it is a bit misleading that METADATA section has a rather different function in these two use cases. Maybe something like CONNECTION_METADATA would describe better the cascading WMS case.

Read again the document http://mapserver.org/ogc/wms_client.html and have a try by making a cascading WMS layer as described there and pasted below:

LAYER
  NAME "prov_bound"
  TYPE RASTER
  STATUS ON
  CONNECTION "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?"
  CONNECTIONTYPE WMS
  METADATA
    "wms_srs"             "EPSG:42304"
    "wms_name"            "prov_bound"
    "wms_server_version"  "1.1.1"
    "wms_format"          "image/gif"
  END
END


I suppose that you will loose most of the metadata sent by the remote server because Mapserver concentrates in capturing images and processing them further. This is taken from the same WMS client document:

"MapServer does not attempt to fetch the layer's capabilities. Doing so at every map draw would be extremely inefficient. And caching that information does not belong in the core of MapServer. This is better done at the application level, in a script, and only the necessary information is passed to the MapServer core via the CONNECTION string and metadata."

-Jukka Rahkonen-


Heiko Schröter wrote:

> Hello,
>
> mapserver seems not to take "wms_extent" into account when
> receiving raster images via WMS.
> According to the docs this tag should take precedence over all others.
>
> Case 1, SRC Projection = DST Projection :
> a) Images are displayed correctly when read via DATA
> statement. msResampleGDALToMap() called.
> b) Images are displayed incorrectly when read via WMS.
> wld_file does not matter. msDrawRasterLayerGDAL() called.
> Calling msResampleGDALToMap() instead fixes this.
>
> Case 2, SRC Projection != DST Projection
> a) Images are displayed correctly when read via DATA
> statement. msResampleGDALToMap() called.
> b) Images are displayed incorrectly when read via WMS.
> wld_file does matter. msResampleGDALToMap() called.
> "wms_extent" not recognized and does not take precedence.
> Bug(?) in msGetGDALGeoTransform().
> Force Removing the wld_file in mapwmslayer.c in function
> msDrawWMSLayerLow() before msDrawLayer() is called, forces
> same proceeding as with images read via DATA statement and fixes it.
>
>
> Else something is broken in the processing logic of the WMS
> (client) handling or i'am doing something completely wrong
> (and stupid).
>
> Thanks and Regards
> Heiko
>
>
> /var/www/localhost/mapserver/mapserv -v
> MapServer version 5.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG
> OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG
> SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER
> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER
> INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>
>
> The image recieved via WMS is the same as the in the DATA statment.
> LAYER
> EXTENT -180 -90 180 90
> NAME "GRID_TEST"
> OPACITY 60
> STATUS ON
> DEBUG ON
> METADATA
> "wms_timeextent" "1970-01-01/2030-12-31"
> "wms_timeitem" "datum" #column in
> postgis table of type timestamp
> "wms_timedefault" "2007-12-10/2007-12-11"
> "wms_title" "grid_test"
> "wms_name" "grid_test"
> "wms_format" "image/png"
> "wms_server_version" "1.1.1"
> "wms_srs" "EPSG:4326"
> "wms_extent" "-180 -90 180 90"
> END
> PROJECTION
> "init=epsg:4326"
> END
> CONNECTION "http://mailserv2/cgi-bin/grid_test.pl?"
> CONNECTIONTYPE WMS
> # DATA
> "/var/www/localhost/htdocs/grafik/wackelkontakt.png"
> TYPE RASTER
> END # Layer
>
>
>
> LAYER
> EXTENT -180 -90 180 90
> NAME "GRID_TEST1"
> OPACITY 60
> STATUS ON
> DEBUG ON
> METADATA
> "wms_timeextent" "1970-01-01/2030-12-31"
> "wms_timeitem" "datum" #column in
> postgis table of type timestamp
> "wms_timedefault" "2007-12-10/2007-12-11"
> "wms_title" "grid_test1"
> "wms_name" "grid_test1"
> "wms_format" "image/png"
> "wms_server_version" "1.1.1"
> "wms_srs" "EPSG:4326"
> "wms_extent" "-180 -90 180 90"
> END
> PROJECTION
> "init=epsg:4326"
> END
> # CONNECTION "http://mailserv2/cgi-bin/grid_test.pl?"
> # CONNECTIONTYPE WMS
> DATA
> "/var/www/localhost/htdocs/grafik/wackelkontakt.png"
> TYPE RASTER
> END # Layer
> _______________________________________________
> 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
|  
Report Content as Inappropriate
star

Re: Sharpmap WMS Client and calling Map layer is not working

vivek.srivastawa@gmail.com
Hi All,

I am stuck in one position, hope I will get solution from here.

I am calling Map server layer with help of Sharpmap WMS client, I have created two layers, one is of Shrapmap layers and second one is of Map server layer, I am using below Map file to accomplish this

MAP

NAME GMAP_DEMO
STATUS ON
SIZE 400 300
SYMBOLSET ../etc/symbols.txt
SHAPEPATH "../data"
IMAGECOLOR 255 0 0
FONTSET ../etc/fonts.txt
UNITS DD
EXTENT   -180 -90 180 90 # Geographic
CONFIG "PROJ_LIB" "C:/ms4w/apps/gmap/proj/nad/epsg"
TRANSPARENT off


#
# Start of web interface definition
#
WEB
 
#
# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the root
# of the drive where the .MAP file resides.
#
  IMAGEPATH "C:/ms4w/tmp/ms_tmp/"
  IMAGEURL "/ms_tmp/"

  METADATA
        "wms_srs"  "EPSG:4326"
  END
END


#
# Start of layer definitions
#


LAYER
PROJECTION
  "proj=latlong"
  "ellps=WGS84"
END
    NAME   "world_poly"
    DATA         'C:/ms4w/apps/gmap/shapefile/world_adm0.shp'
        STATUS       ON
    TYPE         POLYGON
    CLASS
        NAME       'The World'
        STYLE
            OUTLINECOLOR    0 0 0
        END
    END
END # layer


END # Map File


and I am calling this above map by my WMS client here is my WMS clint

string wmsUrl = "http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/gmap/htdocs/gmap_modified.map";
                WmsLayer layWms = new WmsLayer("GMAP_DEMO", wmsUrl);
                layWms.AddLayer("world_poly");                
                layWms.SetImageFormat(layWms.OutputFormats[1]);
                //Map Server Transparancy
                layWms.Transparancy = false;          
                layWms.SetImageFormat("image/png");
                layWms.ContinueOnError = false;
                layWms.BgColor = System.Drawing.Color.Red;
                layWms.Enabled = true;
                //Set timeout to 5 seconds
                layWms.TimeOut = 5000;

                //Map Server Projection ID
                layWms.SRID = 4326;
                map.Layers.Add(layWms);  

The problem is this not showing any map, only blank screen is coming.

Please guide me to do this.

Thanks,
Vivek
Loading...