<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Right, I can do this for my already opened and read-from data set. However, I want to have a separate file. This means I have to copy that original data set, right? I can't seem
to figure out how to copy a data set without actually copying the raster data (which is huge in comparison to the meta). Are you suggesting I just add another band to the already opened file? Not entirely sure I like this approach, but it may be doable.<br>
<br>
Derek<br>
<div style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF911417"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Chaitanya kumar CH [chaitanya.ch@gmail.com]<br>
<b>Sent:</b> Tuesday, July 05, 2011 1:35 PM<br>
<b>To:</b> Cole, Derek<br>
<b>Cc:</b> gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> Re: [gdal-dev] Creating modified copies of a file<br>
</font><br>
</div>
<div></div>
<div>Derek,<br>
<br>
Writing into a raster band is a lot like reading into it. Use the function you use to read the pixels to write the pixels back.
<br>
Don't forget to close the dataset at the end using GDALClose() [1]. Also, check out the GDALFlushCache() and similar functions in [2].<br>
<br>
[1]: <a href="http://www.gdal.org/gdal_8h.html#0984222d45a72028fcbbf1f44831ffbc" target="_blank">
http://www.gdal.org/gdal_8h.html#0984222d45a72028fcbbf1f44831ffbc</a><br>
[2]: <a href="http://www.gdal.org/gdal_8h.html" target="_blank">http://www.gdal.org/gdal_8h.html</a><br>
<br>
<div class="gmail_quote">On Tue, Jul 5, 2011 at 9:16 PM, Cole, Derek <span dir="ltr">
<<a href="mailto:dcole@integrity-apps.com" target="_blank">dcole@integrity-apps.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>
<div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt;">
Hello,<br>
<br>
I think I started to ask about this before on this forum, but I have since used GDAL a bit more and might be better to generate a new thread.
<br>
<br>
I have been using GDAL to read in NITF files, getting the RasterBand data, and manipulating it, and displaying the results in my viewer.
<br>
<br>
Now, I would like to be able process data, then save it into a new NITF. This new NITF will have the same geocoords and all of the same data as the original, with the exception of a new raster band replacing the original. Is there a way to create a clone of
the original image WITHOUT copying the data? I do not want to have to replicate the old data on disk, only the overwrite it with my new data that is coming from the external processing. I looked into creating the virtual data sets, but I am not sure if that
is my answer. If I just pass in an empty "" as the destination, it says it will create that dataset in memory. Is this what I want to do?<br>
<br>
My algorithm processes only a portion of the image at a time, so what I envisioned in my head was being able to essentially write out header /meta information in a file, and "append" blocks of raster data into the right place in the file, as they complete processing.
This way there is no single lag-point while waiting to create a copy of data on disk to another place on disk, or having to create a large file on disk all at once. These image files are 1GB+<br>
<br>
Any tips for trying to set up this scenario?<br>
<br>
Thanks<br>
<br>
Derek<br>
</div>
</div>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Best regards,<br>
Chaitanya kumar CH.<br>
/tʃaɪθənjə/ /kʊmɑr/ <br>
+91-9494447584<br>
17.2416N 80.1426E<br>
</div>
</div>
</div>
</body>
</html>