<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Scott,</p>
<p>due to the Abstraction word in GDAL , doing a gdal_translate in
the same format doesn't automatically applies the characteristics
from the input dataset to the output one, because in general you
translate into a different format, or if it is in the same format,
you may apply options to gdal_translate that could invalidate the
characteristics of the input dataset. So to do what you want, you
need to write a specialized code.</p>
<p>You would need to create a CreateCopy() implementation in the
ISCE driver that fetches from the source dataset the original
scheme (it would have to be expose as a INTERLEAVING metadata item
in the ISCE metadata domain for example), and uses that to force
the SCHEME creation option.</p>
<p><a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/blob/master/gdal/frmts/raw/ehdrdataset.cpp#L1811">https://github.com/OSGeo/gdal/blob/master/gdal/frmts/raw/ehdrdataset.cpp#L1811</a>
would probably be the closest starting point.</p>
<p>But you may also need the logic at
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/blob/master/gdal/frmts/pds/pds4dataset.cpp#L4477">https://github.com/OSGeo/gdal/blob/master/gdal/frmts/pds/pds4dataset.cpp#L4477</a>
to extract the source dataset from the in-memory VRT created by
gdal_translate if applying for example a subsetting option.</p>
<p>Even<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">Le 24/09/2021 à 01:45, Scott Staniewicz
a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CAN4_TO9Ev7G+mHsyPoMy3Wob9=91HRU8tu1FLfKNrpSzufj=eQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<div>I've got a 2 band, band-interleaved-line file gendered
from the ISCE software. I was doing some subsetting of it
with gdal_translate, and I noticed that the format got
changed to BIP:<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>$ ls<br>
20130719_20150427.unw 20130719_20150427.unw.vrt
20130719_20150427.unw.xml<br>
</div>
<div><br>
$ grep -i -n3 scheme 20130719_20150427.unw.xml<br>
96- <value>2</value><br>
97- <doc>Number of image bands.</doc><br>
98- </property><br>
99: <property name="scheme"><br>
100- <value>BIL</value><br>
101: <doc>Interleaving scheme of the
image.</doc><br>
102- </property><br>
103- <property name="width"><br>
104- <value>586</value><br>
</div>
<div><br>
</div>
<div>After running gdal_translate, the format has changed to
BIP:<br>
</div>
<div><br>
</div>
<div>$ gdal_translate 20130719_20150427.unw test.unw -of ISCE<br>
Input file size is 586, 882<br>
0...10...20...30...40...50...60...70...80...90...100 - done.<br>
(mapping) [scott@grace gdal-translate-bug]$ grep -i -n3
scheme test.unw.xml<br>
11- <property name="DATA_TYPE"><br>
12- <value>FLOAT</value><br>
13- </property><br>
14: <property name="SCHEME"><br>
15- <value>BIP</value><br>
16- </property><br>
17- <property name="BYTE_ORDER"></div>
<div><br>
</div>
<div><br>
</div>
<div>I'm assuming it's related to this line for creating a
dataset with default BIP:</div>
<div><br>
</div>
<div><a
href="https://github.com/OSGeo/gdal/blob/master/gdal/frmts/raw/iscedataset.cpp#L839"
target="_blank" moz-do-not-send="true">https://github.com/OSGeo/gdal/blob/master/gdal/frmts/raw/iscedataset.cpp#L839</a></div>
<div><br>
</div>
<div>But I'm not familiar enough with the gdal_translate code
to know where the options are getting generated and passed
here.</div>
<div>Any advice on where might be a good place to fix the ISCE
raster generation?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Scott
<div class="gmail-adL"><br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>