[Gdal-dev] plotting data
MChapman at sanz.com
Sat Sep 18 18:00:31 EDT 2004
There are several ways to draw your points in a window. All the ones I know, at a minimum, use the "graphics device context". The DC (device context) or objects that derive from it, have methods to draw to a window that take x, y as parameters. It also lets you control things like line width, fill color, etc. In addition to that, the device context can also be used to pass control of the rendering to a third party graphics library like OpenGL. There is a lot of good code on the internet that shows how to do this for your specific platform.
With that said, I would search google for how to draw points in a window using the device context or opengl on Mac OSX. Once you get that plumbing hooked up it will be obvious how to feed the points to your screen from OGR.
I would strongly recommend using OpenGL for vector, not for raster though...always use the device context for rasters unless you want to project the image into a vector map. Go to http://nehe.gamedev.net/ and try some of the cross-platform examples for OpenGL as well.
From: Roger Persson [mailto:rogper at bredband.net]
Sent: Sat 9/18/2004 6:05 AM
To: gdal-dev at xserve.flids.com
Subject: [Gdal-dev] plotting data
I'm relative new to GIS and GIS data and have compiled GDAL on Mac OS X
10.3. Currently, I'm using the OGR classes, but since those are include
in GDAL I guess I can ask OGR related questions here.
I've created a little program that loads a shape-file and prints the
contents (which include thousands of lines...) However, now I want to
plot this data graphically.
1. From OGR sources, it is mentioned a class named "OGRWin" that shows
how to create a device to plot points graphically on the screen.
However, I can't find any such class in the sources. Where is this
sample class? Maybe this will solve my most worries? :-)
2. I have some sample GIS data in a shape file. However, when it is
load, there is no OGRSpatialReference created in the OGRGeometry
collections and, hence, I can't project coordinates by an
OGRCoordinateTransformation-object from lat/long into 2D pixel-points.
What are am suppose to do? Assume it is lat/long coordinates to create
my own OGRSpatialReference?
Please note that this is my first message on this list, be patient. :-)
Gdal-dev mailing list
Gdal-dev at xserve.flids.com
More information about the Gdal-dev