Hi Eric The class QgsMapToPixel (src/core/qgsmaptopixel.cpp/.h) contains the transformation from map to pixel coordinates. Is this what you are looking for?
Regards, Marco Am Freitag, 30. September 2011, 16.32:13 schrieb Eric MSP Veith: > Hello list, > > first things first: This post is not strictly about QGis itself, but how > about it renders the raw spatial data. If you happen to know a better > place where to ask this question, please point me at it and ignore the > rest of this e-mail. Thanks. > > I am currently creating a simulation environment which lives of an > interactive map. This map has its source in a PostGIS data base, from > which I select only few general data (administrative boundaries, water > areas, land, cities) to provide some points of orientation for the user. > For the displaying itself I use Qt's drawing classes, i.e. QGraphicsView, > QGraphicsScene, etc., which I subclass in cases needed. > > I am currently trying to find a good (technical) way of displaying the data > to the user. I first tried a simple approach: I fetched points from the > PostGIS database, calculated a scale factor from the size of the > QGraphicsView instance and the size of the layer fetched from the > database, and multplied every value with that scaling factor. It worked > (kind of), but of course now everything is upside down, since Qt's drawing > begins from the top-left corner, whereas POINT(x, y) values from the > database are actually POINT(lat, long). > > I am wonderin how QGis does that, because it looks nice. I already checked > out the source files from Git, but without knowledge of it I get lost > fast. > > I'd really appreciate some sentences of advice and/or a pointer to the > relevant methods and classes in the QGis sources. > > Thank you so much in advance. > > Eric > _______________________________________________ > Qgis-developer mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/qgis-developer -- Dr. Marco Hugentobler Sourcepole - Linux & Open Source Solutions Churerstrasse 22, CH-8808 Pfäffikon SZ, Switzerland [email protected] http://www.sourcepole.ch Technical Advisor QGIS Project Steering Committee _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
