[Mapserver-users] Change Projection (e.g. Geographic to Robinson)
Pagurek, Debbie
PAGUREKD at AGR.GC.CA
Tue Jul 13 05:55:30 PDT 2004
This is a multi-part message in MIME format.
------_=_NextPart_001_01C468D8.AD9A0424
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
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
=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
------_=_NextPart_001_01C468D8.AD9A0424
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'>This works for =
me:</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'> =
$newproj=3Dms_newprojectionObj("proj=3Drobin,lon_0=3D0,x_0=3D0,y_0=3D=
0");</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'> =
$latlon=3Dms_newprojectionObj("proj=3Dlonglat,ellps=3DGRS80,datum=3D=
NAD83,no_defs");</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'> $oldext=3D =
ms_newRectObj();</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'> $oldext->setextent($b=
ounds[0],$bounds[1],$bounds[2],$bounds[3]);
//this is the extent of my map in geographic</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'> =
$oldext->project($latlon,$newproj);
//reproject to Robinson</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'> =
$map->setextent($oldext->minx,$oldext->miny,$oldext->maxx,$ol=
dext->maxy);
//set the new map extent</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><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Hope that helps,</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'>D. Pagurek</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>
mapserver-users-admin at lists.gis.umn.edu
[mailto:mapserver-users-admin at lists.gis.umn.edu] <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> </span></font><font =
size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>Monday,
July 12, 2004</span></font><font size=3D2 face=3DTahoma><span =
lang=3DEN-US
style=3D'font-size:10.0pt;font-family:Tahoma'> </span></font><font
size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>10:56
AM</span></font><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Tahoma'><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)</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'>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>
</span></font></p>
<x-sigsep>
<p style=3D'margin-left:.5in'></x-sigsep><font size=3D3 face=3D"Times =
New Roman"><x-tab><span
style=3D'font-size:12.0pt'> &nbs=
p;</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> </span></x-tab></f=
ont><font
size=3D2 face=3DCourier><span =
style=3D'font-size:10.0pt;font-family:Courier'>Switzerland</span></font><=
font
size=3D2 face=3DCourier><span =
style=3D'font-size:10.0pt;font-family:Courier'><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_01C468D8.AD9A0424--
More information about the MapServer-users
mailing list