Hi,
I have a loaded an raster image using GDAL, and i want to provide a drawing
tool using which user can draw an irregular shape on the raster image and
then save the shape and the enclosing pixels in a vector format for future
use. Can any one tell me how to do this in GDAL/OGR?
Thanks and
Akshay,
While loading the image you need to mind the coordinates of the visible
pixels. When the user clicks on a pixel, add a point to the shape based on
the coordinates at that pixel.
For saving the shape(s), add the shape(s) and their attributes to a layer
and close the datasource to save it.