Open perhallstroem opened 7 years ago
Okay, so after reading a bit more code it is clear that gdalinfo actually does not print WGS84 coordinates but coordinates based on the GEOGCS of the projected coordinate system. To get the same numbers, this function roughly mimics the behaviour of gdalinfo, as far as I can understand:
const getBestGeoCs = (ds) => {
const wgs84 = gdal.SpatialReference.fromEPSG(4326);
if(!ds.srs) return wgs84;
const cloneGeogCS = ds.srs.cloneGeogCS();
return !cloneGeogCS ? wgs84 : cloneGeogCS;
};
Hi, I have noticed that the coordinates that I get with the example implementation of "gdalinfo" is different from those that my installed gdalinfo binary/command gives me.
Relevant sections of the output:
From "real" gdalinfo:
From example gdalinfo:
Notice that the coordinates in the native CRS (EPSG:27700) are the same, but the transformed WGS84 coordinates differ by quite a substantial amount. Not sure what other information you need. Please let me know and I'll attempt to be as helpful as possible.
WKT: