Good day all

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* I don't
know how to calculate the pixel width and pixel height of a non rectangular
extent*.

At the moment I have:
//works only with rectangular extent
$this->_pixelWidth = ($extent['topRight']['x'] - $extent['bottomLeft']['x'])
/ $size['width'];
$this->_pixelHeight = ($extent['topRight']['y'] -
$extent['bottomLeft']['y']) / $size['height'] * -1;

$this->_rotationX = ($this->_pixelHeight * $size['height'] +
$extent['topLeft']['y'] - $extent['bottomRight']['y']) / $size['width'] *
-1;
$this->_rotationY = ($this->_pixelWidth * $size['width'] +
$extent['topLeft']['x'] - $extent['bottomRight']['x']) / $size['height'] *
-1;

$this->_topLeftX = $extent['topLeft']['x'];
$this->_topLeftY = $extent['topLeft']['y'];

Thank you in advance

-- 
http://iap.md, The future is open
_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to