[mapserver-users] projections [shpmidx] [shpmidy]
Marco
marco@mediaeval.nl
Wed, 11 Sep 2002 09:14:48 +0200
This is a multi-part message in MIME format.
------=_NextPart_000_0031_01C25973.AD791560
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi list,
If the next question is a stupid one, excuse me. I am newbe.
context:
I use mapserv CGI (no mapscript) and a Apache webserver with PHP (on a =
windows machine for testing). I am building a web-application with =
dynamic maps.=20
problem:
I use a template file to get information about the map-features on the =
current map. The tags [shpmidx] and [shpmidy] provides information on =
the exact position of a feature (see =
http://mapserver.gis.umn.edu/doc36/template-reference.html ).
With simple lineair algebra it is possible to calculate the xy-position =
of this feature on the actual generated image. (a lineair transformation =
from "real world" lat-lon coordinates to "image" x-y pixelcoordinates).
I use these information to create some kind of javascript rollover =
interface; if the mouse hovers a feature, the webapplication respons =
immediately, without the need of connecting to the server.
So far so good. Everything works fine. So now for the problem. If I =
deploy a projection ("proj=3Dstere") Nothing works anymore. That is =
because [shpmidx] and [shpmidy] gives the lon-lat stuff, but i need the =
xy coordanates on the generated image of the map. Sure it should be =
possible to write transformations for projected maps (a lot of sinus and =
cosinus, arctangens etcetera i suppose) but i believe that's a ticket to =
the nearest snake pit.
Is there a solution for this (withhout the need of writing my own =
transformation formulas)
Or, if I have to write transformation, does anybody now the formulas for =
this projection:
PROJECTION
"proj=3Dstere"
"lat_0=3D52.156160556"
"lon_0=3D5.387638889"
"k=3D0.0000999908"
"x_0=3D0.000"
"y_0=3D0.000"
"ellps=3Dbessel"
END
Cheers,
Marco
Marco Pieck, marco@mediaeval.nl
Mediaeval Vorm & Visie
http://www.mediaeval.nl/
postbus 1050, 6501 BB Nijmegen, the Netherlands=20
tel: ++ 31 24-3818196, fax: ++ 31 24-3818183
------=_NextPart_000_0031_01C25973.AD791560
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4807.2300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi list,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>If the next question is a stupid one, =
excuse me. I=20
am newbe.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>context:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I use mapserv CGI (no mapscript) and a =
Apache=20
webserver with PHP (on a windows machine for testing). I am building a=20
web-application with dynamic maps. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>problem:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I use a template file to get =
information about the=20
map-features on the current map. The tags [shpmidx] and [shpmidy] =
provides=20
information on the exact position of a feature (see <A=20
href=3D"http://mapserver.gis.umn.edu/doc36/template-reference.html">http:=
//mapserver.gis.umn.edu/doc36/template-reference.html</A> ).</FONT><=
/DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>With simple lineair algebra it is =
possible to=20
calculate the xy-position of this feature on the actual generated image. =
(a lineair transformation from "real world" lat-lon coordinates to =
"image"=20
x-y pixelcoordinates).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I use these information to create some =
kind of=20
javascript rollover interface; if the mouse hovers a feature, the =
webapplication=20
respons immediately, without the need of connecting to the =
server.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>So far so good. Everything works fine. =
So now for=20
the problem. If I deploy a projection ("proj=3Dstere") Nothing =
works=20
anymore. That is because [shpmidx] and [shpmidy] gives the lon-lat =
stuff, but i=20
need the xy coordanates on the generated image of the map. Sure it =
should be=20
possible to write transformations for projected maps (a lot of sinus and =
cosinus, arctangens etcetera i suppose) but i believe that's a ticket to =
the=20
nearest snake pit.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Is there a solution for this (withhout =
the need of=20
writing my own transformation formulas)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Or, if I have to write transformation, =
does anybody=20
now the formulas for this projection:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>
<P>PROJECTION</P>
<P>"proj=3Dstere"</P>
<P>"lat_0=3D52.156160556"</P>
<P>"lon_0=3D5.387638889"</P>
<P>"k=3D0.0000999908"</P>
<P>"x_0=3D0.000"</P>
<P>"y_0=3D0.000"</P>
<P>"ellps=3Dbessel"</P>
<P>END</P></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Cheers,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Marco</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Marco Pieck, <A=20
href=3D"mailto:marco@mediaeval.nl">marco@mediaeval.nl</A><BR>Mediaeval =
Vorm &=20
Visie<BR><A=20
href=3D"http://www.mediaeval.nl/">http://www.mediaeval.nl/</A><BR>postbus=
1050,=20
6501 BB Nijmegen, the Netherlands <BR>tel: ++ 31 24-3818196, =
fax: ++=20
31 24-3818183<BR></DIV></FONT></BODY></HTML>
------=_NextPart_000_0031_01C25973.AD791560--