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

Chaitanya kumar CH chaitanya.ch at gmail.com
Mon Mar 19 10:48:46 EDT 2012


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.
To save the enclosed pixels, get the extents of the shape geometry and
translate them to the pixel/line of the raster. Make a copy of the raster
to those pixel/line extents.

On Mon, Mar 19, 2012 at 7:49 PM, akshay gupta <akshaygupta202 at gmail.com>wrote:

> 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 regards,
> Akhy Huckelheim
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120319/e53e109e/attachment.html


More information about the gdal-dev mailing list