[Mapserver-users] Change Projection (e.g. Geographic to Robinson)

Pagurek, Debbie PAGUREKD at AGR.GC.CA
Tue Jul 13 12:41:34 PDT 2004


This is a multi-part message in MIME format.

------_=_NextPart_001_01C46911.6742318C
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Maybe if you post your code we could all look at it to see what you are
trying to do...

=20

Debbie

=20

=20

-----Original Message-----
From: Stefan Schwarzer [mailto:stefan.schwarzer at grid.unep.ch]=20
Sent: Tuesday, July 13, 2004 10:21 AM
To: Pagurek, Debbie
Cc: mapserver-users at lists.gis.umn.edu
Subject: RE: [Mapserver-users] Change Projection (e.g. Geographic to
Robinson)

=20

Thanks Debbie.

Yes, that's actually the code I've found as well in a thread which dates
back a year or so. But it doesn't work with me. I assume that I have to
change as well the projection definition in the map file, which is now

        PROJECTION
          'init=3Depsg:4326'
        END

Am I right? But what is the code? I din't find on the Internet...

Stefan





This works for me:
=20
  =
$newproj=3Dms_newprojectionObj("proj=3Drobin,lon_0=3D0,x_0=3D0,y_0=3D0");=

=20
$latlon=3Dms_newprojectionObj("proj=3Dlonglat,ellps=3DGRS80,datum=3DNAD83=
,no_def
s");
=20
  $oldext=3D ms_newRectObj();
  $oldext->setextent($bounds[0],$bounds[1],$bounds[2],$bounds[3]);
//this is the extent of my map in geographic
  $oldext->project($latlon,$newproj);  //reproject to Robinson
=20
=20
$map->setextent($oldext->minx,$oldext->miny,$oldext->maxx,$oldext->maxy)
;  //set the new map extent
=20
=20
Hope that helps,
D. Pagurek
=20
-----Original Message-----
From: mapserver-users-admin at lists.gis.umn.edu
[mailto:mapserver-users-admin at lists.gis.umn.edu] On Behalf Of Stefan
Schwarzer
Sent: Monday, July 12, 2004 10:56 AM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] Change Projection (e.g. Geographic to
Robinson)
=20
Hi there,

it seems that either the "change projection on-the-fly" feature isn't
widely used or nobody has problems with it. At least, the number of
threats using the ms_newprojectionObj command is relatively small. And
the WIKI is empty on the subject of "Projections".

Could somebody provide me with a working example? I tried to change the
projection of my data from "geographic" to "robinson" using the
ms_newprojectionObj object, but it didn't work,  and honestly, I am a
bit confused by the different parameters...

Thanks for any help,

Stefan


                _______________________________________

                Stefan Schwarzer
        GIS & Data Management

        UNEP/DEWA/GRID-Geneva
        Chemin des Anemones 11
        CH - 1219 Chatelaine
        Switzerland

        Tel: (+41) 22.917.83.49
        Fax: (+41) 22.917.80.29

        Email: stefan.schwarzer at grid.unep.ch
        Internet: http://geodata.grid.unep.ch/
        _______________________________________=20

        _______________________________________

        Stefan Schwarzer
        GIS & Data Management

        UNEP/DEWA/GRID-Geneva
        Chemin des Anemones 11
        CH - 1219 Chatelaine
        Switzerland

        Tel: (+41) 22.917.83.49
        Fax: (+41) 22.917.80.29

        Email: stefan.schwarzer at grid.unep.ch
        Internet: http://geodata.grid.unep.ch/
        _______________________________________=20


------_=_NextPart_001_01C46911.6742318C
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">


<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Courier;
	panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:blue;
	text-decoration:underline;}
p
	{margin-right:0in;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman";}
span.EmailStyle18
	{font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-CA link=3Dblue vlink=3Dblue>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Maybe if you post your code we =
could all
look at it to see what you are trying to do…</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Debbie</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
lang=3DEN-US style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original
Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> Stefan Schwarzer
[mailto:stefan.schwarzer at grid.unep.ch] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Tuesday, July 13, =
2004 10:21
AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> Pagurek, Debbie<br>
<b><span style=3D'font-weight:bold'>Cc:</span></b>
mapserver-users at lists.gis.umn.edu<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> RE: =
[Mapserver-users]
Change Projection (e.g. Geographic to Robinson)</span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'> </span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>Thanks Debbie.<br>
<br>
Yes, that's actually the code I've found as well in a thread which dates =
back a
year or so. But it doesn't work with me. I assume that I have to change =
as well
the projection definition in the map file, which is now<br>
<br>
<x-tab>        </x-tab>PROJECTION=
<br>
<x-tab>        </x-tab> 
'init=3Depsg:4326'<br>
<x-tab>        </x-tab>END<br>
<br>
Am I right? But what is the code? I din't find on the Internet...<br>
<br>
Stefan<br>
<br>
<br>
<br>
</span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>This works for =
me:<br>
 <br>
  =
$newproj=3Dms_newprojectionObj("proj=3Drobin,lon_0=3D0,x_0=3D0,y_0=3D=
0");<br>
 
$latlon=3Dms_newprojectionObj("proj=3Dlonglat,ellps=3DGRS80,datum=3D=
NAD83,no_defs");<br>
 <br>
  $oldext=3D ms_newRectObj();<br>
 
$oldext->setextent($bounds[0],$bounds[1],$bounds[2],$bounds[3]); =

//this is the extent of my map in geographic<br>
  $oldext->project($latlon,$newproj);  //reproject to =
Robinson<br>
 <br>
 
$map->setextent($oldext->minx,$oldext->miny,$oldext->maxx,$ol=
dext->maxy); 
//set the new map extent<br>
 <br>
 <br>
Hope that helps,<br>
D. Pagurek<br>
 <br>
</span></font><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>-----Original Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> =
mapserver-users-admin at lists.gis.umn.edu
[<a href=3D"mailto:mapserver-users-admin at lists.gis.umn.edu" =
eudora=3Dautourl>mailto:mapserver-users-admin at lists.gis.umn.edu</a>]
<b><span style=3D'font-weight:bold'>On Behalf Of </span></b>Stefan =
Schwarzer<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Monday, July 12, =
2004 10:56
AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b>
mapserver-users at lists.gis.umn.edu<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> =
[Mapserver-users] Change
Projection (e.g. Geographic to Robinson)<br>
</span></font> <br>
Hi there,<br>
<br>
it seems that either the "change projection on-the-fly" =
feature isn't
widely used or nobody has problems with it. At least, the number of =
threats
using the <b><span =
style=3D'font-weight:bold'>ms_newprojectionObj</span></b>
command is relatively small. And the WIKI is empty on the subject of
"Projections".<br>
<br>
Could somebody provide me with a working example? I tried to change the
projection of my data from "geographic" to =
"robinson" using
the ms_newprojectionObj object, but it didn't work,  and honestly, =
I am a
bit confused by the different parameters...<br>
<br>
Thanks for any help,<br>
<br>
Stefan<br>
<br>
<br>
<x-tab>        </x-tab> &nbs=
p;     
_______________________________________<br>
<br>
<font size=3D2 face=3DCourier><x-tab><span =
style=3D'font-size:10.0pt;font-family:
Courier'>        </x-tab> &n=
bsp;     
<b><span style=3D'font-weight:bold'>Stefan Schwarzer<br>
</span></b><x-tab>        </x-tab=
>GIS
& Data Management<br>
<br>
<x-tab>        </x-tab>UNEP/DEWA/=
GRID-Geneva<br>
<x-tab>        </x-tab>Chemin =
des
Anemones 11<br>
<x-tab>        </x-tab>CH - 1219
Chatelaine<br>
<x-tab>        </x-tab>Switzerlan=
d<br>
<br>
<x-tab>        </x-tab>Tel: =
(+41)
22.917.83.49<br>
<x-tab>        </x-tab>Fax: =
(+41)
22.917.80.29<br>
<br>
<x-tab>        </x-tab>Email:
stefan.schwarzer at grid.unep.ch<br>
<x-tab>        </x-tab>Internet: =
<a
href=3D"http://geodata.grid.unep.ch/" =
eudora=3Dautourl>http://geodata.grid.unep.ch/</a><br>
</span></font><x-tab>        </x-=
tab>_______________________________________
</p>

<p style=3D'margin-left:.5in'></x-sigsep><x-tab><font size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'><x-sigsep>      =
  </x-tab>_______________________________________<br>
<br>
</span></font><font size=3D2 face=3DCourier><x-tab><span =
style=3D'font-size:10.0pt;
font-family:Courier'>        <b><=
span
style=3D'font-weight:bold'></x-tab>Stefan Schwarzer<br>
</span></b><x-tab>        </x-tab=
>GIS
& Data Management<br>
<br>
<x-tab>        </x-tab>UNEP/DEWA/=
GRID-Geneva<br>
<x-tab>        </x-tab>Chemin =
des
Anemones 11<br>
<x-tab>        </x-tab>CH - 1219
Chatelaine<br>
<x-tab>        </x-tab>Switzerlan=
d<br>
<br>
<x-tab>        </x-tab>Tel: =
(+41)
22.917.83.49<br>
<x-tab>        </x-tab>Fax: =
(+41)
22.917.80.29<br>
<br>
<x-tab>        </x-tab>Email:
stefan.schwarzer at grid.unep.ch<br>
<x-tab>        </x-tab>Internet: =
<a
href=3D"http://geodata.grid.unep.ch/" =
eudora=3Dautourl>http://geodata.grid.unep.ch/<br>
</a></span></font><x-tab>        =
</x-tab>_______________________________________
</p>

</div>

</body>

</html>

------_=_NextPart_001_01C46911.6742318C--



More information about the MapServer-users mailing list