QPainter; Setting correct coordinatesystem
Hello!
I have two questions and I hope someone here can help me out a bit.
Question nr 1:
I'm using ShapeLib to import a shape-file into a QGLWidget. At the moment the map is really small and positioned at the top left corner of the widget. The shapes coordinates are in wgs84 and I want my widget to have the same coordinates as the shapefile. Is this possible? (I have spent two days trying to understand QPainters window, viewport, matrix etc but I'm seriously starting to doubt myself because I just don't get it.)
Question nr 2:
If the above is possible and I would like to draw things on the map(Basic primitives really). How would I solve this? Some kind of overlay?
/Robert
Re: QPainter; Setting correct coordinatesystem
I expect that you have already read the documentation about coordinate systems, but I also found this video quite helpful.
http://qt.nokia.com/developer/learni...inate-systems/
I am interested in how you are using ShapeLib in Qt - do you have a simple example project?
Re: QPainter; Setting correct coordinatesystem
Yes you are so right. I have read everything there is to read about this topic. Obviously not enough though... Very interesting video. I will look into it as soon as everything else is working. (I just posted a new thread about a problem I´m afraid).
And I will post the code so you can see how I´m using shapelib when it´s working again :) Thank you for the reply sir it was very helpful :)
Re: QPainter; Setting correct coordinatesystem
Hi,
I am also trying to render shapefile but fail using Shapelib and qgraphicsview. I can render shapefile using QtOpengl but this is not suitable for my ARM device so want to do that using qgraphicsview. Can you please share me the source code.
Regards,
Swapan ghosh
Re: QPainter; Setting correct coordinatesystem
wgs84 is coordinates on sphere, you need to transform all the points to x,y coordinates
I have my own library to read and draw SHAPE files.
I use QWidget to draw primitives and it very fast for me. For example, about 500 000 points(points, polylines, polygons) and it takes about 0.5 sec to draw. QgraphicsView was too slow.
for coordination transformation i use proj.4.
Re: QPainter; Setting correct coordinatesystem
Is it possible to share your library ang usage to display shapefile.
Swapan
Re: QPainter; Setting correct coordinatesystem
Hi folibis,
till I am failed to display shape file. Can you please help me by supplying source code.
Swapan
Re: QPainter; Setting correct coordinatesystem