[gdal-dev] Saving shape files in GDAL/OGR

2012-03-19 Thread akshay gupta
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

Re: [gdal-dev] Saving shape files in GDAL/OGR

2012-03-19 Thread Chaitanya kumar CH
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.