<div dir="ltr"><div class="gmail_default" style="font-family:arial,sans-serif">Pham,</div><div class="gmail_default" style="font-family:arial,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,sans-serif">My point was that I use gdalwarp itself along with all the options (such as setting the target resolution), but to VRT format. I imagine the "commandline gdalwarp API" interface would be able to do this from Java.</div><div class="gmail_default" style="font-family:arial,sans-serif"> If often just shell out and run the command.</div><div class="gmail_default" style="font-family:arial,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,sans-serif">Best regards,</div><div class="gmail_default" style="font-family:arial,sans-serif">Frank</div><div class="gmail_default" style="font-family:arial,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 19, 2020 at 12:37 PM Pham Huu Bang <<a href="mailto:a09550@gmail.com">a09550@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><a class="gmail_plusreply" id="gmail-m_1135646369086925692plusReplyChip-1" href="mailto:even.rouault@spatialys.com" target="_blank">@Even Rouault</a> <br><div><br></div><div>Unfortunately, this method is not enough to solve my problem as I <b>also have a given geo X, Y resolutions </b>in target CRS (EPSG:4326) as input.</div><div><br></div><div>Below is what I've with Python GDAL:</div><div><br></div><div> src_ds = gdal.GetDriverByName("VRT").Create("", 1830, 1830)<br> src_ds.SetGeoTransform([600000.000, 60, 0, 5900040, 0, -60])<br></div><div><br></div><div> // source CRS EPSG:32632</div><div> src_srs = osr.SpatialReference()<br> src_srs.ImportFromEPSG(32632)<br> src_wkt = src_srs.ExportToWkt()<br><br> // destination CRS EPSG:4326<br> dst_srs = osr.SpatialReference()<br> dst_srs.ImportFromEPSG(4326)<br> dst_wkt = dst_srs.ExportToWkt()<br></div><div><br></div><div> // This method doesn't have the possibility to add the given geo X, Y resolutions in EPSG:4326 (!)</div><div> dst_ds = gdal.AutoCreateWarpedVRT(src_ds,<br> src_wkt,<br> dst_wkt,<br> gdal.GRA_NearestNeighbour,<br> 0.125)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 19 May 2020 at 18:14, Even Rouault <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div style="font-family:monospace;font-size:9pt;font-weight:400;font-style:normal">
<p style="margin:0px;text-indent:0px">On mardi 19 mai 2020 12:01:58 CEST Frank Warmerdam wrote:</p>
<p style="margin:0px;text-indent:0px">> Pham,</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> I have sometimes taken the approach of doing a "gdalwarp to VRT" which</p>
<p style="margin:0px;text-indent:0px">> creates the configuration of the target dataset in VRT format, but does not</p>
<p style="margin:0px;text-indent:0px">> actually resample any imagery. The you can open the VRT and query it's</p>
<p style="margin:0px;text-indent:0px">> configuration. There are also lower level apis to get this information but</p>
<p style="margin:0px;text-indent:0px">> they are not normally exposed through SWIG in Java, Python, etc as far as I</p>
<p style="margin:0px;text-indent:0px">> know.</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">gdal.AutoCreateWarpedVRT() is available in Java bindings:</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px"><a href="https://gdal.org/java/org/gdal/gdal/gdal.html" target="_blank">https://gdal.org/java/org/gdal/gdal/gdal.html</a></p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Even</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">-- </p>
<p style="margin:0px;text-indent:0px">Spatialys - Geospatial professional services</p>
<p style="margin:0px;text-indent:0px"><a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a></p></div></blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><font face="monospace">---------------------------------------+--------------------------------------<br>I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a><br>light and sound - activate the windows | +1 650-701-7823<br>and watch the world go round - Rush | Geospatial Software Developer</font></div></div></div></div></div>