Hi Ben,<br />Finally I found time to think about this problem: how to
store the geographic coordinates of a mouse clik on the map image, and
thank to you I found a solution; I'm happy to share it.<br /><br />I use
the php-mapscript '$map-&gt;cellsize' property to get the delta of a pixel
in projected coordinates, both in x and y.<br /><br />A piece of code:<br
/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /><font
color="#3366ff"><font color="#000000">/* </font></font><font
color="#000000">$_REQUEST['mapimg_x'] and </font><font
color="#000000">$_REQUEST['mapimg_y'] are the </font><font
color="#3366ff"><font color="#000000">coordinates in pixel of the
&lt;INPUT TYPE=IMAGE&gt; of a form on my page that contains the image of
the map.<br /> I multiply the X &amp; Y for the </font></font><font
color="#3366ff">$oMap-&gt;cellsize <font color="#000000">to obtain
</font></font> the projected coordinates relatively to the current extent
of the image, and I sum the result to the <font
color="#3366ff">$oMap-&gt;extent-&gt;minx<font color="#000000">, for the
X, and substract to </font></font><font
color="#3366ff">$oMap-&gt;extent-&gt;miny <font color="#000000">for the Y,
to obtain the absolute coordinates.</font></font><font
color="#3366ff"><font color="#000000"> */<br /></font></font><font
color="#3366ff">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $newPoint =
ms_newpointobj();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
$newPoint-&gt;setXY(($oMap-&gt;extent-&gt;minx +
($oMap-&gt;cellsize*$_REQUEST['mapimg_x'])),($oMap-&gt;extent-&gt;maxy -
($oMap-&gt;cellsize * $_REQUEST['mapimg_y'])));<br /></font><font
color="#3366ff"><font color="#000000"><br /></font></font><font
color="#3366ff"><font color="#000000">/*&nbsp;&nbsp;&nbsp;  I get two new
Projection objects, first is a lat/lon projection and second is projection
of the map.&nbsp; */<br /> </font></font><font
color="#3366ff">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $olatlonProj =
ms_newprojectionobj(&quot;proj=latlong,ellps=WGS84&quot;);<br
/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $osProj =
$oMap-&gt;getProjection();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
$omapProj = ms_newprojectionobj($osProj);<br /><br /></font><font
color="#3366ff"><font color="#000000">/* I project the point from the map
projection to the lat/lon projection */</font><br /> </font><font
color="#3366ff">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
$newPoint-&gt;project($omapProj,$olatlonProj);<br /><br /></font><font
color="#3366ff"><font color="#000000">/* now I can store the point&nbsp;
(in this case in a mysql db) */</font></font><br /> <font
color="#3366ff">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $myconn =
mysql_connect(&quot;host&quot;,&quot;usr&quot;,&quot;pw&quot;);<br
/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
mysql_select_db(&quot;db&quot;);<br />&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; $sql = &quot;INSERT INTO clickpoints (lon,lat) VALUES
(&quot;.$newPoint-&gt;x.&quot;,&quot;.$newPoint-&gt;y.&quot;)&quot;;<br
/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $res = mysql_query($sql);<br
/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mysql_close($myconn);<br
/></font><br />Limitedly to the accuracy due of the scale of the map,
result is good. I tried in lat/lon projection and also in Mercator,
Mollweide, Sanson-flamsteed, UTM, orthographic, geostationary satellite
... !<br /><br />cheers<br />...............................pg<br /><br
/><br />-- <br />Pietro Giannini<br />Bytewise srl - Area GIS<br
/>41&deg;50'38.58&quot;N 12&deg;29'13.39&quot;E<br /><br /><br /><br />On
Gio, 14 Dicembre 2006 7:18 am, Ben Madin wrote:<br />&gt; Pietro,<br
/>&gt; <br />&gt; I noticed your question re map coordinates vs pixels.
There may be a<br />&gt; better way, but I compare the proportion of the
pixels with the<br />&gt; proportion of the map extents, for each of X
&amp; Y / Long &amp; Lat /<br />&gt; Easting &amp; Northing or
whatever.<br />&gt; <br />&gt; So,<br />&gt; <br />&gt; if the pixels is
400,200 (when the map is 600 x 300 pixels), then we<br />&gt; are 400/600
of the way from the minimum extent to the maximum extent<br />&gt; on the
map (in this case in both directions).<br />&gt; <br />&gt; I'm sure
someone else will be more articulate about this, or have a<br />&gt;
better idea, which I will be happy to see.<br />&gt; <br />&gt; Actually,
here is a really good resource: (don't forget to have a<br />&gt; look on
the mapserver website first!)<br />&gt; <br />&gt;
http://mapserver.gis.umn.edu/docs/howto/phpmapscript-byexample<br />&gt;
<br />&gt; cheers<br />&gt; <br />&gt; Ben<br />&gt; <br />&gt; <br />&gt;
--<br />&gt; <br />&gt; Ben Madin<br />&gt; REMOTE INFORMATION<br />&gt;
<br />&gt; t : +61 8 9192 5455<br />&gt; f : +61 8 9192 5535<br />&gt; m :
0448 887 220<br />&gt; Broome   WA   6725<br />&gt; <br />&gt;
ben@remoteinformation.com.au<br />&gt; <br />&gt; <br />&gt; <br />&gt;
<br />&gt; <br />&gt;                                         Out here, it pays to know...<br />&gt; <br
/>&gt; <br />&gt; <br />&gt; <br />&gt; <br />&gt; <br />&gt; <br />&gt;
<br />&gt; <br />&gt; <br />