[mapserver-users] MapScript WMS request

Daniel Morissette dmorissette at mapgears.com
Thu Sep 8 19:52:48 EDT 2011


On 11-09-08 07:44 PM, Mr. Puneet Kishor wrote:
>
>>
>> 2- Try a GetCapabilities instead of GetMap, and make sure your layer shows up properly and with no WARNING in the GetCapabilities XML output. Make sure the name of the layer is not changed: if you have multiple layers with the same name then the WMS handler will rename them to make them unique (WMS spec requirement)
>
>
> That was very useful. No errors, but I do notice the following funky issue (see below)
>
>     <Layer queryable="0" opaque="0" cascaded="0">
>          <Name>gmna</Name>
>          <Title>gmna</Title>
>          <SRS>EPSG:4326</SRS>
>          <LatLonBoundingBox minx="-2.5e+07" miny="-2.5e+07" maxx="2.5e+07" maxy="2.5e+07" />
>          <BoundingBox SRS="EPSG:4326"
>                      minx="-2.5e+07" miny="-2.5e+07" maxx="2.5e+07" maxy="2.5e+07" />
>          <Style>
>            <Name>default</Name>
>            <Title>default</Title>
>            <LegendURL width="167" height="7029">
>               <Format>image/png</Format>
>               <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://lucknow-2.local/test/mapscript/test3.cgi?version=1.1.0&amp;service=WMS&amp;request=GetLegendGraphic&amp;layer=gmna&amp;format=image/png&amp;STYLE=default"/>
>            </LegendURL>
>          </Style>
>
>
> Where the heck did that (+-)2.5e+07 business get into the BoundingBox? I didn't add that. All I did was query in lat/lon. Maybe that is where my error remains now.
>

What is your data? a Shapefile? What is the source projection of the data?

I suspect the BoundingBox is invalid because the layer projection is not 
set to the right value. Those funky numbers look like values in meters, 
so presumably your data is in a projected coordinate system.

In your script you set:
	$layerOne->setProjection("init=epsg:4326");

This will work only if your data is in EPSG:4326. If that's not the case 
then you need to set the layer projection to match the source data.

-- 
Daniel Morissette
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000



More information about the mapserver-users mailing list