[OpenLayers-Users] conversion of bounding boxes to various
projections
Eric Lemoine
eric.lemoine at camptocamp.com
Mon May 18 18:35:54 EDT 2009
On Monday, May 18, 2009, <stephane.poirier at usherbrooke.ca> wrote:
>
>
>
>
>
>
>
> Hi All,
>
> Is it easy to use openlayers to convert bounding
> boxes from one EPSG to another.
>
> With WGS84 world geodesic datum projection
> EPSG:4326, North America has a bounding box of
> defaultBounds=new OpenLayers.Bounds(-180, 5, -10,
> 85); //north america, working with google, nasa, metacarta, etc.
> var myproj=new
> OpenLayers.Projection(myepsg);
>
> With Lambert Conic Conformal projection EPSG:42304,
> Canada has a bounding box of
> defaultBounds=new
> OpenLayers.Bounds(-2750564.75,-936638.5,3583872.5,4673125); //canada
> var
> myepsg="EPSG:42304"; //Lambert Conic Conformal, working with http://atlas.gc.ca/cgi-bin/atlaswms_en
> var
> myproj=new OpenLayers.Projection(myepsg);
>
> Q: How can I have the bounding box for North
> America in EPSG:42304?
Hi
bounds.transform(fromProj, toProj);
Cheers,
>
>
>
> Stephane
>
>
>
> Stephane Poirier - Research professional
> Center
> of Applications in Remote Sensing
> Applied Geomatics Department
> University
> of Sherbrooke
> Sherbrooke (Quebec), CANADA J1K 2R1
> Tel.: (+1 819) 821 8000
> #61904
> Fax.: (+1 819) 821 7944
> Stephane.Poirier at USherbrooke.ca
> http://www.usherbrooke.ca/cartel
>
> P.S.:
>
> //works fine
> defaultBounds=new
> OpenLayers.Bounds(-180, 5, -10, 85); //north america
> var myepsg="EPSG:4326";
> //working with google, nasa, metacarta, etc.)
>
> //works
> fine
> //BBOX=-2750564.75,-936638.5,3583872.5,4673125 //for
> canada
> defaultBounds=new
> OpenLayers.Bounds(-2750564.75,-936638.5,3583872.5,4673125); //north
> america
> var myepsg="EPSG:42304"; //Lambert Conic Conformal, working with http://atlas.gc.ca/cgi-bin/atlaswms_en
> var
> myproj=new OpenLayers.Projection(myepsg);
>
> //How to specify northern hemisphere
> //defaultBounds=new OpenLayers.Bounds(-180, 0,
> +180, 90); //north hemisphere?
> defaultBounds=new OpenLayers.Bounds(?, ?,?,?);
> //north hemisphere
> var myepsg="EPSG:102018"; //North Pole Stereographic,
> working with http://atlas.gc.ca/cgi-bin/atlaswms_en
>
> var myproj=new OpenLayers.Projection(myepsg);
>
>
>
>
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
More information about the Users
mailing list