[OpenLayers-Users] the same ol' 4326/900913 stuff-up

Puneet Kishor punk.kish at gmail.com
Sat Oct 15 17:45:41 EDT 2011


Thanks Richard. That was it.


On Oct 15, 2011, at 4:25 PM, Richard Greenwood wrote:

> On Sat, Oct 15, 2011 at 2:36 PM, Puneet Kishor <punk.kish at gmail.com> wrote:
>> I am confounded by this basic problem, so instead of wasting any more time on it, I ask your help (at the risk it being a stupid question). My data are stored in EPSG:4326, and I am having MapServer pull it out with the following incantations
>> 
>>        MAP
>>        ..
>>                PROJECTION
>>                        "init=epsg:4326"
>>                        "init=epsg:900913"
>>                END
> 
> 
> Only one coordinate system may defined with the PROJECTION block. It
> doesn't matter which one you define if all of your layers also have a
> PROJECTION block
> 
> 
>>                WEB
>>                        METADATA
>>                                ows_enable_request "*"
>>                                wms_srs "EPSG:900913 EPSG:4326"
>>                        END
>>                END
>> 
>>                LAYER
>>                ..
>>                        NAME "lyr"
>>                        DATA "the_geom FROM table USING UNIQUE gid USING srid=4326"
>> 
>> 
>>                        PROJECTION
>>                                "init=epsg:4326"
>>                                "init=epsg:900913"
>>                        END
> 
> Within the LAYER, the PROJECTION block defines the coordinate system
> that the layer is in. So only one of the above can be correct.
> 
> 
>>                        METADATA
>>                                ows_enable_request "*"
>>                                wms_srs "EPSG:900913 EPSG:4326"
>>                        END
>> 
>> I am adding the layer to my map with
>> 
>>    map = new OpenLayers.Map("map", {
>>        projection: new OpenLayers.Projection("EPSG:900913"),
>>        displayProjection: new OpenLayers.Projection("EPSG:4326"),
>>        units: "dd",
>>        maxResolution: 156543.0339,
>>        maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508)
>>    });
>> 
>>    var lyr = new OpenLayers.Layer.WMS(
>>        "lyr",
>>        "http://server/cgi-bin/app",
>>        {layers: "lyr"},
>>        {isBaseLayer: false}
>>    );
>> 
>>    map.addLayers([lyr]);
>> 
>> Yet, I get the following error
>> 
>>        <ServiceException code="InvalidSRS">
>>        msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS must be valid for all requested layers.
>>        </ServiceException>
>> 
>> What am I doing wrong?
>> 
>> 
>> --
>> Puneet Kishor _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>> 
> 
> 
> 
> -- 
> Richard Greenwood
> richard.greenwood at gmail.com
> www.greenwoodmap.com



More information about the Users mailing list