[gdal-dev] Python/Java GDAL - How to estimate the geo coordinates and width / height without warping dataset?

Frank Warmerdam warmerdam at pobox.com
Tue May 19 09:01:58 PDT 2020


Pham,

I have sometimes taken the approach of doing a "gdalwarp to VRT" which
creates the configuration of the target dataset in VRT format, but does not
actually resample any imagery.  The you can open the VRT and query it's
configuration.  There are also lower level apis to get this information but
they are not normally exposed through SWIG in Java, Python, etc as far as I
know.

Best regards,


On Tue, May 19, 2020 at 11:59 AM Pham Huu Bang <a09550 at gmail.com> wrote:

> Hello,
>
> I have a Sentinel 2 in UTM32 with these metadata from gdalinfo:
>
> Size is 1830, 1830
> Pixel Size = (60.000000000000000,-60.000000000000000)
> Lower Left  (  600000.000, 5790240.000)
> Upper Left  (  600000.000, 5900040.000)
>
> How can I have these same metadata* by GDAL Python/Java binding* but in
> EPSG:4326, given Pixel Size = (0.000700000000000,-0.000700000000000) *without
> running gdalwarp*?
>
> Because, the input file can be big and I don't need the reprojected file,
> just need these metadata in EPSG:4326, for example:
>
> Size is 2395, 1454
> Lower Left  (  10.4649804,  52.2224083)
> Upper Left  (  10.4649804,  53.2402083)
>
> I've tried to find some method, but this one only exist in C++ (
> GDALSuggestedWarpOutput)
> https://github.com/OSGeo/gdal/blob/106c8288e7a05f4efc1a588c5a3b2da7ec52d915/gdal/alg/gdaltransformer.cpp#L177
>
> Thanks,
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev



-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | +1 650-701-7823
and watch the world go round - Rush    | Geospatial Software Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200519/617fcbf6/attachment.html>


More information about the gdal-dev mailing list