[OpenLayers-Users] Problem with polar projection on Antartica

coastalrocket andy at planetnomad.com
Thu Oct 2 11:13:28 EDT 2008


hello there,

I'm very much a geoserver/openlayers newbie but i've cobbled together a
basic map showing blue marble imagery of the antartic region. The problem i
have can be best described by the attached image - a radial section from the
pole is not being displayed followed by a rectangluar section on the right
hand side. The radial chunk missing i would have thought relates to the
extent of my coverage stored in geoserver but it looks good - -180 to 180 on
X and -48 to -90 on Y. I have no idea what would be causing the straight
rectangular gap in the image. Image here: 
http://www.nabble.com/file/p19781303/wms.png wms.png 

I would appreciate any pointers to fixing this. As i say, i've only been
using geoserver and openlayers for a day now. Before then i was happily
doing unprojected google map code so this is my first WMS trial.

WMS is in EPSG:4030 but openlayers is projecting in EPSG:3031. I've used the
bounds as described by nsdic.org: -12400000,-12400000,        
12400000,12400000.

Here is the native SRS WKT from geoserver,  if relevant:  
* Native Spatial Reference System for Coverage: Generate Envelope after
setting the property.
Native SRS WKT: GEOGCS["Unknown datum based upon the WGS 84 ellipsoid",
DATUM["Not specified (based on WGS 84 ellipsoid)", SPHEROID["WGS 84",
6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6030"]], PRIMEM["Greenwich", 0.0,
AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295],
AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH],
AUTHORITY["EPSG","4030"]]

My Openlayers script;
        <script
src="http://localhost:8081/geoserver/openlayers/OpenLayers.js"
type="text/javascript">
        </script>
        <script defer="defer" type="text/javascript">
        var map;
        var untiled;
        var tiled;
        function setHTML(response) {
            document.getElementById('nodelist').innerHTML =
response.responseText;
        };
       
        OpenLayers.IMAGE_RELOAD_ATTEMPTS = 5;
        OpenLayers.DOTS_PER_INCH = 25.4 / 0.28;
       
        function init(){
            var bounds = new OpenLayers.Bounds(
                -12400000,-12400000,
                12400000,12400000
            );
            var options = {
                controls: [],
                maxExtent: bounds,
                maxResolution: 25000,
                projection: "EPSG:3031", //WGS 84 / Antarctic Polar
Stereographic
                units: 'meters'
            };
            map = new OpenLayers.Map('map', options);        
           
            // setup tiled layer
            tiled = new OpenLayers.Layer.WMS(
                "QQ:Antarctica_Image - Tiled",
"http://localhost:8081/geoserver/wms",
                {
                    width: '800',
                    styles: '',
                    height: '800',
                    layers: 'QQ:Antarctica_Image',
                    srs: 'EPSG:4030',
                    format: 'image/png',
                    tiled: 'true',
                    tilesOrigin : "-180,-90"
                },
                {buffer: 0}
            );
           
            // setup single tiled layer
            untiled = new OpenLayers.Layer.WMS(
                "QQ:Antarctica_Image - Untiled",
"http://localhost:8081/geoserver/wms",
                {
                    width: '800',
                    styles: '',
                    height: '800',
                    layers: 'QQ:Antarctica_Image',
                    srs: 'EPSG:4030',
                    format: 'image/png'
                },
                {singleTile: true, ratio: 1}
            );
       
            map.addLayers([untiled, tiled]);
           
            // setup controls and initial zooms
            map.addControl(new OpenLayers.Control.PanZoomBar());
            map.addControl(new OpenLayers.Control.Navigation());
            map.addControl(new OpenLayers.Control.Scale($('scale')));
            map.addControl(new OpenLayers.Control.MousePosition({element:
$('location')}));
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            //map.addControl(new OpenLayers.Control.OverviewMap());
            map.zoomToExtent(bounds);
           
            // support GetFeatureInfo
            map.events.register('click', map, function (e) {
                document.getElementById('nodelist').innerHTML = "Loading...
please wait...";
                var url =  map.layers[0].getFullRequestString(
                    {
                        request: "GetFeatureInfo",
                        EXCEPTIONS: "application/vnd.ogc.se_xml",
                        BBOX: map.getExtent().toBBOX(),
                        X: e.xy.x,
                        Y: e.xy.y,
                        INFO_FORMAT: 'text/html',
                        QUERY_LAYERS: map.layers[0].params.LAYERS,
                        FEATURE_COUNT: 50,
                        WIDTH: map.size.w,
                        HEIGHT: map.size.h
                    },
                    "http://localhost:8081/geoserver/wms"
                );
                OpenLayers.loadURL(url, '', this, setHTML, setHTML);
                OpenLayers.Event.stop(e);
            });
        }
        </script>
-- 
View this message in context: http://www.nabble.com/Problem-with-polar-projection-on-Antartica-tp17475860p19781303.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list