<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> gdal-dev <gdal-dev-bounces@lists.osgeo.org> on behalf of gdal-dev-request@lists.osgeo.org <gdal-dev-request@lists.osgeo.org><br>
<b>Sent:</b> Tuesday, October 4, 2022 12:30 AM<br>
<b>To:</b> gdal-dev@lists.osgeo.org <gdal-dev@lists.osgeo.org><br>
<b>Subject:</b> gdal-dev Digest, Vol 221, Issue 1</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Send gdal-dev mailing list submissions to<br>
        gdal-dev@lists.osgeo.org<br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
or, via email, send a message with subject or body 'help' to<br>
        gdal-dev-request@lists.osgeo.org<br>
<br>
You can reach the person managing the list at<br>
        gdal-dev-owner@lists.osgeo.org<br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of gdal-dev digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. ECRG RasterIO problem (mchapman@hyperacktive.com)<br>
   2. How to obtain the raster footprint poly of actual data with<br>
      python (gdisk.mike)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 3 Oct 2022 11:05:48 -0600<br>
From: <mchapman@hyperacktive.com><br>
To: <gdal-dev@lists.osgeo.org><br>
Subject: [gdal-dev] ECRG RasterIO problem<br>
Message-ID: <00b701d8d74a$62942f60$27bc8e20$@hyperacktive.com><br>
Content-Type: text/plain; charset="us-ascii"<br>
<br>
All,<br>
<br>
 <br>
<br>
I have an ECRG dataset that fails when reading pixels from the<br>
gdalrasterband object on one of the subdatasets.  It appears that the<br>
underlying proxy dataset has a macro check called<br>
RB_PROXY_METHOD_WITH_RET_WITH_INIT_BLOCK that fails because the block sizes<br>
are different.  This happens for all the ECRG subdatasets that I read from,<br>
in other words it's not just specific to a single dataset.  FYI, the same<br>
code works fine for RPFTOC datasets and all other GDAL formats.  I am using<br>
GDAL version 3.4.2.<br>
 <br>
// code snippet from gdalproxydataset.cpp line 247<br>
else if( nSrcBlockXSize != nBlockXSize || nSrcBlockYSize != nBlockYSize) \<br>
{ \<br>
        CPLError(CE_Failure, CPLE_AppDefined, "Inconsistent block dimensions<br>
between proxy and source"); \<br>
        ret = CE_Failure; \<br>
} \<br>
 <br>
The variables nBlockXSize and nBlockYSize are (2304, 1) and nSrcBlockXSize<br>
and nSrcBlockYSize are {128, 128).<br>
 <br>
I think this is because the ECRG frame size is 2304 x 2304 but the block<br>
size of the frame file is 128 x 128.<br>
 <br>
Does anybody know what my problem might be or is this an error in the driver<br>
code?<br>
 <br>
Best regards,<br>
Martin<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221003/a36eceb1/attachment-0001.htm">http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221003/a36eceb1/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Mon, 3 Oct 2022 11:20:05 -0600<br>
From: "gdisk.mike" <gdisk.mike@gmail.com><br>
To: Gdal Dev <gdal-dev@lists.osgeo.org><br>
Subject: [gdal-dev] How to obtain the raster footprint poly of actual<br>
        data with python<br>
Message-ID:<br>
        <CAKTSvBjS-FjZqi8p2_wgWR+YX-OFphQt2-4gbWp-Q6pKgQAPGw@mail.gmail.com><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
To get the result using command line, I found the 3 commands did the trick.<br>
<br>
gdal_translate -b mask -of vrt -a_nodata 0 'path/to/input.tif' test.vrt<br>
gdal_translate -b 1 -of vrt -a_nodata 0 test.vrt test2.vrt<br>
gdal_polygonize.[bat/py] -q  -8 test2.vrt -b 1 -f "ESRI Shapefile"<br>
testdata.shp<br>
<br>
This was off Stack exchange somewhere.<br>
<br>
However, I'd like to get this same geometry in python.<br>
<br>
I keep hitting roadblocks as I'm not real sure how to use<br>
gdal.Translate or gdal.TranslateOptions<br>
<br>
ive tried<br>
gtp = gdal.TranslateOptions(format="vrt",bandList="mask", noData=0)<br>
in attempt to start with the first gdal_translate command.<br>
<br>
I'm also curious if there's another way, perhaps using --oo or something<br>
different.<br>
<br>
In the end I'd ultimately like to get a geometry poly object of where the<br>
actual imagery data is in the file.<br>
<br>
Any pointers?<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221003/2147d699/attachment-0001.htm">http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221003/2147d699/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
gdal-dev@lists.osgeo.org<br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<br>
<br>
------------------------------<br>
<br>
End of gdal-dev Digest, Vol 221, Issue 1<br>
****************************************<br>
</div>
</span></font></div>
</body>
</html>