[OpenLayers-Users] Antartica region problem

Christopher Schmidt crschmidt at metacarta.com
Thu Oct 2 13:20:02 EDT 2008


On Thu, Oct 02, 2008 at 04:22:16PM +0100, Andrew Bailey wrote:
> hello there,
> 
> apologies if i've posted this several times today, i seem to have some
> problems with nabble.
> 
> 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://img220.imageshack.us/img220/5153/wmssb9.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.

http://trac.openlayers.org/wiki/TroubleshootingTips#Problemswithimagesbeingincorrect

I expect this is a GeoServer problem, and once you get the URL to an
image, you'll be able to get help as to why. (my first guess is that
you're taking a geographic image and trying to reproject it on the fly
to a polar projection, which seems like it could introduce these kinds
of problems, but I'm not sure.)

> 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>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list