Good day all<br><br>I have a non rectangular extent and a raster image with known width and height. Using this data I need to create a world file (with rotation parameters). I got my script working with rectangular extents but<b> I don&#39;t know how to calculate the pixel width and pixel height of a non rectangular extent</b>.<br>
<br>At the moment I have:<br>//works only with rectangular extent<br>$this-&gt;_pixelWidth = ($extent[&#39;topRight&#39;][&#39;x&#39;] - $extent[&#39;bottomLeft&#39;][&#39;x&#39;]) / $size[&#39;width&#39;];<br>$this-&gt;_pixelHeight = ($extent[&#39;topRight&#39;][&#39;y&#39;] - $extent[&#39;bottomLeft&#39;][&#39;y&#39;]) / $size[&#39;height&#39;] * -1;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> $this-&gt;_rotationX = ($this-&gt;_pixelHeight * $size[&#39;height&#39;] + $extent[&#39;topLeft&#39;][&#39;y&#39;] - $extent[&#39;bottomRight&#39;][&#39;y&#39;]) / $size[&#39;width&#39;] * -1;<br>$this-&gt;_rotationY = ($this-&gt;_pixelWidth * $size[&#39;width&#39;] + $extent[&#39;topLeft&#39;][&#39;x&#39;] - $extent[&#39;bottomRight&#39;][&#39;x&#39;]) / $size[&#39;height&#39;] * -1; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>$this-&gt;_topLeftX = $extent[&#39;topLeft&#39;][&#39;x&#39;];<br>$this-&gt;_topLeftY = $extent[&#39;topLeft&#39;][&#39;y&#39;];<br><br>Thank you in advance<br clear="all"><br>-- <br><a href="http://iap.md">http://iap.md</a>, The future is open<br>