Hi Adam and Steve,<br><br>Thanks very much for the advice.&nbsp; The thing is, the shift I&#39;m seeing is way more than 1/2 pixel on the edges.&nbsp; I&#39;m off by quite a few degrees actually.&nbsp; I suspect it&#39;s as Julien thought earlier: I&#39;m specifying an image size that is not consistent with the geographic extents.&nbsp; So I get back the number of pixels I&#39;ve requested, but force a larger area than want.&nbsp; I guess what I&#39;m looking for is WMS logic, but without having to make a WMS request.<br>
<br>Thanks again,<br><br>Roger<br>--<br><br><br><div class="gmail_quote">On Mon, Dec 8, 2008 at 5:20 PM, Adam Ryan <span dir="ltr">&lt;<a href="mailto:adamdryan@gmail.com">adamdryan@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Roger,<br>
<br>
I don&#39;t know if this would help, but I recently came across a similar<br>
problem which was fixed by adding the processing directive to the<br>
layer:<br>
<br>
PROCESSING &quot;RESAMPLE=NEAREST&quot;<br>
<br>
This fixed a problem when zooming in very close on a raster layer.<br>
Apparently without this, mapserver changes the extent so that whole<br>
source pixels are included and not split.<br>
<br>
More here...<br>
<br>
<a href="http://www.nabble.com/Raster-alignment-problem-td19900625.html" target="_blank">http://www.nabble.com/Raster-alignment-problem-td19900625.html</a><br>
<br>
Cheers,<br>
<font color="#888888"><br>
Adam<br>
</font><div class="Ih2E3d"><br>
On Mon, Dec 8, 2008 at 2:33 PM, Kralidis,Tom [Ontario]<br>
&lt;<a href="mailto:Tom.Kralidis@ec.gc.ca">Tom.Kralidis@ec.gc.ca</a>&gt; wrote:<br>
&gt;<br>
</div><div><div></div><div class="Wj3C7c">&gt; Roger: you can use MapScript WxS <a href="http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript" target="_blank">http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript</a> as an approach to run a WMS request via mapscript. &nbsp;Maybe that can work for you?<br>

&gt;<br>
&gt; ..Tom<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; -----Original Message-----<br>
&gt; From: <a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> on behalf of Roger André<br>
&gt; Sent: Mon 08-Dec-08 16:21<br>
&gt; To: Julien-Samuel Lacroix<br>
&gt; Cc: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt; Subject: Re: [mapserver-users] Difference in appearance between &quot;mode=map&quot; andWMS<br>
&gt;<br>
&gt; Hi Julien,<br>
&gt;<br>
&gt; That makes sense, but it doesn&#39;t work. &nbsp;I modified my mapfile so that I now<br>
&gt; generate a 20_deg x 20_deg tile that is 600_pixels x 600_pixels. &nbsp;If I<br>
&gt; georeference that image using the extents, I still get incorrect placement.<br>
&gt; Maybe if I choose an output projection which always has square pixels, like<br>
&gt; spherical mercator (?) this will work. &nbsp;I&#39;ll give it a shot.<br>
&gt;<br>
&gt; Is there any way to give a WMS request via mapscript and NOT go through CGI?<br>
&gt;<br>
&gt; Roger<br>
&gt; --<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Dec 8, 2008 at 12:25 PM, Julien-Samuel Lacroix &lt;<br>
&gt; <a href="mailto:jlacroix@mapgears.com">jlacroix@mapgears.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; I guess would be that the WMS use non-square pixels. So if your BBOX x/y<br>
&gt;&gt; &nbsp;(rectangle in your case) doesn&#39;t match you WIDTH/HEIGHT ratio (square in<br>
&gt;&gt; your case) the map will appear stretched. MapServer will actually stretch<br>
&gt;&gt; the map to fit the extent in the WIDTH/HEIGHT.<br>
&gt;&gt;<br>
&gt;&gt; The mode=map don&#39;t do that. If your extent doesn&#39;t have the same ratio, it<br>
&gt;&gt; adds some degree in your extent to fit the size.<br>
&gt;&gt;<br>
&gt;&gt; Make sure your BBOX and EXTENT are a square in your requests and retry<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Julien<br>
&gt;&gt;<br>
&gt;&gt; Roger André wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi All,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I think I&#39;m having an instance of cranial flatulation, but maybe not.<br>
&gt;&gt;&gt; &nbsp;Hopefully you can set me straight.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I need to create an image with Mapserver using mapscript that I can then<br>
&gt;&gt;&gt; georeference manually and use in another application. &nbsp;It needs to look<br>
&gt;&gt;&gt; exactly the same as the image I can already generate via a WMS call that<br>
&gt;&gt;&gt; looks like this:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; <a href="http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/hydro/hydro.map" target="_blank">http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/hydro/hydro.map</a><br>
&gt;&gt;&gt; &amp;SERVICE=WMS<br>
&gt;&gt;&gt; &amp;version=%221.1.1%22<br>
&gt;&gt;&gt; &amp;REQUEST=GetMap<br>
&gt;&gt;&gt; &amp;LAYERS=imagery<br>
&gt;&gt;&gt; &amp;STYLES=&amp;BBOX=-125,39,-108,54<br>
&gt;&gt;&gt; &amp;WIDTH=600<br>
&gt;&gt;&gt; &amp;HEIGHT=600<br>
&gt;&gt;&gt; &amp;FORMAT=png<br>
&gt;&gt;&gt; &amp;SRS=epsg:4326<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;m testing my mapscript parameters using a simple &quot;mode=map&quot; call to<br>
&gt;&gt;&gt; Mapserver, and the results I&#39;m getting so far don&#39;t match the appearance of<br>
&gt;&gt;&gt; the WMS output at all. &nbsp;My mapfile has the following extent and projection<br>
&gt;&gt;&gt; info in it:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &nbsp;PROJECTION<br>
&gt;&gt;&gt; &nbsp; &nbsp;&quot;init=epsg:4326&quot;<br>
&gt;&gt;&gt; &nbsp;END<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &nbsp;EXTENT -125.0 &nbsp;39.0 -108.0 &nbsp;54.0<br>
&gt;&gt;&gt; &nbsp;SIZE 600 600<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; In addition to the mapfile projection specification, I am also specifying<br>
&gt;&gt;&gt; the same projection info in each of my LAYERS as well.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Is it possible to do what I&#39;m trying to accomplish here?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Roger<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ------------------------------------------------------------------------<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; mapserver-users mailing list<br>
&gt;&gt;&gt; <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt;&gt;&gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Julien-Samuel Lacroix<br>
&gt;&gt; Mapgears<br>
&gt;&gt; <a href="http://www.mapgears.com/" target="_blank">http://www.mapgears.com/</a><br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; mapserver-users mailing list<br>
&gt; <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
&gt;<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</div></div></blockquote></div><br>