Puneet, 

As far as I know, OpenLayers still has support for a layer based on MapServer 
CGI.  Because MapServer can also serve up WMS well, this layer type isn't 
necessarily recommended or as well supported.  

http://dev.openlayers.org/docs/files/OpenLayers/Layer/MapServer-js.html

David.

-----Original Message-----
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Puneet Kishor
Sent: Thursday, September 08, 2011 9:32 PM
To: Daniel Morissette
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] MapScript WMS request


On Sep 8, 2011, at 8:28 PM, Daniel Morissette wrote:

> On 11-09-08 09:02 PM, Mr. Puneet Kishor wrote:
>> 
>> On Sep 8, 2011, at 7:43 PM, Daniel Morissette wrote:
>>> 
>>> Maybe call $map->save("/tmp/my.map") in your script after the map and layer 
>>> have been populated and paste the result... that may give us a hint...
>>> 
>> 
>> wow! this is a super-awesome debugging technique. I have sent you the map 
>> file off list to not pollute the entire list serve.
>> 
> 
> I was able to reproduce the issue with the copy of the mapfile you sent 
> off-list.
> 
> It turns out that mappostgis.c's msPostGISLayerGetExtent() is hardcoded to 
> always return
> 
> {minx = -25000000, miny = -25000000, maxx = 25000000, maxy = 25000000}
> 
> ...and then it returns MS_SUCCESS.
> 
> I think this function should either be left unimplemented (this way MapServer 
> would fallback on other mechanisms), or return MS_FAILURE to indicate to the 
> calling code that it didn't do anything useful.
> 
> A quick search indicates an open ticket about the issue:
> 
> http://trac.osgeo.org/mapserver/ticket/3585
> 
> You could bump the ticket and hope someone works on it at the FOSS4G code 
> sprint next week.
> 
> The short term fix for you would be to set the "ows_extent" metadata in your 
> layer:
> 
>    METADATA
>      "ows_extent" "-180 -90 180 90"
>   ...
>    END
> 


Thanks Daniel. I will bump the ticket. For now, see below --

Using the "my.map" file I sent you, with no further modifications to it, I am 
able to successfully get an image back via 
[http://localhost.local/cgi-bin/gmna?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=-180,-90,180,90&SRS=EPSG:4326&WIDTH=1200&HEIGHT=600&LAYERS=gmna&STYLES=&FORMAT=image/png&TRANSPARENT=true]

Note, no further modifications is required, that is, not even the "ows_extent" 
"-180 -90 180 90" bit in the layer METADATA. and I still get a good image.


However, if I use the following program to access the same map file, I get the 
spurious "minx = -25000000, miny = -25000000, maxx = 25000000, maxy = 25000000" 
in the GetCapabilities.

Finally, if I add the "ows_extent" "-180 -90 180 90" line in the layer METADATA 
in the "my.map" file, the GetCapabilities returns the correct bounds now, 
however, the image is still blank.

        #!/opt/local/bin/perl
        
        use strict;
        use mapscript;
        
        my $wms = new mapscript::OWSRequest();
        $wms->setParameter("SERVICE", "WMS" );
        $wms->setParameter("VERSION", "1.1.1" );
        $wms->setParameter("REQUEST", "GetMap" );
        $wms->setParameter("BBOX", "-180,-90,180,90" );
        $wms->setParameter("LAYERS", "gmna");
        $wms->setParameter("SRS", "EPSG:4326");
        $wms->setParameter("WIDTH", "1200");
        $wms->setParameter("HEIGHT", "600");
        $wms->setParameter("FORMAT", "image/png");
        $wms->setParameter("TRANSPARENT", "true");
        
        my $map = new 
mapscript::mapObj("/Users/punkish/Sites/test/mapscript/my.map");
        
        if(!$map) {
                warn "New mapObj() error: $mapscript::ms_error->{message}\n";
        }
        
        my $io = mapscript::msIO_installStdoutToBuffer();
        my $dispatch_out = $map->OWSDispatch( $wms );
        printf "%s\n", mapscript::msIO_getStdoutBufferString();

I have now spent an enormous amount of time on this, and for now, I have to 
move on. This is just not working out. Maybe I will try some other technique, 
perhaps this mode=tile to see if I can get MapServer powered maps in my apps.

Thanks much for your help. If you (or anyone else) can come up with a bright 
idea, I will be happy to try it.

Puneet.

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to