[OpenLayers-Users] Problem Setting maxExtent for Polar Projection(EPSG:3995)

Arnd Wippermann arnd.wippermann at web.de
Tue Nov 19 13:47:30 PST 2013


Hi Scott,

The maxExtent have to be set in map projections coordinates. 
EPSG:3995 is a projection with the north pole as center and the coordinates
0,0. 
The maxExtent in the OL example describe a square with the north pole in the
center.

As you want your map in projection EPSG:3995, you don't need the maxExtent
in UTM coordinates.

Add maxResolution: 43008.234375 ( = 5505054 / 128) to your map options and
zoom to maxExtent.

See this example
http://gis.ibbeck.de/OLClient/OLClient.asp?WMC=data/wmc/epsg_3995_Arctic_pol
ar.wmc.xml

Arnd


-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von ScottCh
Gesendet: Dienstag, 19. November 2013 18:16
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] Problem Setting maxExtent for Polar
Projection(EPSG:3995)

Hello OpenLayers Users,

I appear to be setting the maxExtent values for my EPSG:3995 projection
incorrectly.

According to  http://spatialreference.org/ref/epsg/3995/
<http://spatialreference.org/ref/epsg/3995/>  , the bounds for this
projection in degrees are "everything north of 60 degrees north latitude" or
bounds -180, 60 and 180, 90.

I used the Earth Point online calculator (
http://www.earthpoint.us/convert.aspx
<http://www.earthpoint.us/convert.aspx>  ) to convert this to UTM.  This
gave me 332705mE 6655205mN and 2000000mE 2000000mN.

Does this mean that I need to use 332705, 6655205, 2000000, 2000000 as the
bounds in meters?  

This seems incorrect to me, in part because of this OpenLayers
implementation example:
http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/polar-projecti
ons.html
<http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/polar-project
ions.html>
The bounds used for each polar projection it provides are -5505054,
-5505054, 5505054, 5505054.

I looked up EPSG:3576 (which it uses), and it uses "everything above 45
degrees" for its bounds.  This suggests that my guess (to use UTM
conversion) is wrong.

I decided to try using the same maxExtent values as the polar projection
demo.

This gave me:

      map0 = new OpenLayers.Map(
        "Map", {
          controls:[
            new OpenLayers.Control.PanZoomBarMod({zoomWorldIcon:true,
forceFixedZoomLevel:true}),
            new OpenLayers.Control.ArgParser(),
            new OpenLayers.Control.Navigation(),
            new OpenLayers.Control.Attribution()
          ],
          projection: new OpenLayers.Projection('EPSG:3995'),
          units: 'm',
          //maxExtent:new OpenLayers.Bounds(-180,60,180,90),
          maxExtent:new OpenLayers.Bounds(-5505054, -5505054, 5505054,
5505054),
          
          numZoomLevels: 7
        }
      );

I show the bounds in degrees commented out as a form of documentation.  The
problem with this code is that it does not work properly.  When I display my
map in Firefox, it takes several seconds before showing a blank rectangle
for the map.  Then I get an "unresponsive script" alert box.  The map never
draws.  

I have experimented with other values for the maxExtent, and the results
vary a lot.  If I use the degree values on the commented out line, I get a
map that looks like this:

<http://osgeo-org.1560.x6.nabble.com/file/n5089954/olprojection.jpg> 

This map rendering has several problems. You can see from the edges of the
graticule that the extents are not set correctly.  The graticule is supposed
to be radial with the center at the north pole instead of rectangular.

At this point I have tried several different sets of values - admittedly
guesses - as the maxExtent bounds, and the results are always similar to
these two situations.  Either it times out and does not draw, or it draws
something similar to the standard EPSG:4326 projection over my base layer
map.  I have looked through a lot of documentation, but haven't found enough
clues yet.  Can someone point me in the right direction where to find out
how to correctly set the maxExtent bounds for my projection?

Thanks for your help,

Scott C.




--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/Problem-Setting-maxExtent-for-Polar-Proj
ection-EPSG-3995-tp5089954.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list