[Qgis-developer] Details of rendering GIS map data in QGis

Eric MSP Veith eveith at wwweb-library.net
Fri Sep 30 11:45:30 EDT 2011


Hello Marco,

thank you for your friendly and helpful reply!

On Friday 30 September 2011, 17:02:22, Marco Hugentobler 
<marco.hugentobler at sourcepole.ch> wrote:
> The class QgsMapToPixel  (src/core/qgsmaptopixel.cpp/.h) contains the
> transformation from map to pixel coordinates. Is this what you are looking
> for?

I'm 98% positive that yes, this is what I was looking for. One last 
confirmation, through:

---%<---
QgsPoint QgsMapToPixel::toMapPoint( double x, double y ) const
{
  double mx = x * mMapUnitsPerPixel + xMin;
  double my = -1 * (( y - yMax ) * mMapUnitsPerPixel - yMin );
  return QgsPoint( mx, my );
}
--->%---

Is this everything that QGis does to transform a POINT(long, lat) to a Pixel-
Point(x, y)? Because this is kind of what my naive approach (or what I thought 
it was) looked like, i.e., scaling factor plus correction of the counting 
direction.

			Eric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.osgeo.org/pipermail/qgis-developer/attachments/20110930/c3bf321f/attachment.bin


More information about the Qgis-developer mailing list