0

I'm using a javascript app to get the borders coordinates of a TIFF file. I'm having trouble getting these coordinates. I'm using this example, but the corner coordinates are returning incorrectly.

The correct thing would be to return coordinates lng -51... and lat -25...

Agro SEEN
  • 11
  • 1

1 Answers1

0

This is the output I get with node examples/gdalinfo.js:

Upper Left   (-5721999.51, -2925751.47) ( 25d24'23.23"W,  51d24' 5.75"S)
Upper Right  (-5721770.19, -2925751.47) ( 25d24'23.23"W,  51d23'58.33"S)
Bottom Right (-5721770.19, -2926104.99) ( 25d24'33.56"W,  51d23'58.33"S)
Bottom Left  (-5721999.51, -2926104.99) ( 25d24'33.56"W,  51d24' 5.75"S)
Center       (-5721884.85, -2925928.23) ( 25d24'28.40"W,  51d24' 2.04"S)

The first numbers par is in the projected coordinates system, the second pair is in WGS84.

The example uses gdal.CoordinateTransformation and gdal.decToDMS to obtain this result.

mmomtchev
  • 2,497
  • 1
  • 8
  • 23
  • Hi, thanks for the explanation and I understand perfectly. However, this return gdal.decToDMS is not in lng, lat decimal format. How do I convert this to decimal. – Agro SEEN Mar 08 '22 at 18:12
  • Then you don't need `gdal.decToDMS`, the return value of `gdal.CoordinateTransformation` is the result you need – mmomtchev Mar 08 '22 at 18:41