You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if a functionality exists in the geotiff.js library, but the issue is that I have a set of Ground control points (GCPS) which have the image points (x,y,0) and (lat, lng, 0). Now I want to write a geotiff using a raw image object or an image url, and the set of ground control points. I have tried to use tags such as the ModelTiePoint and ModelPixelScale, however, they do not do georeferning. The ground control point is an array in this example [ x, y, 0, lng, lat, 0].
const metadata = {
width: rawImageDocument.width,
height: rawImageDocument.height,
ModelTiepoint: controlPoints.flat(),
ModelPixelScale: [pixelWidth, pixelHeight, 0.0], // ModelPixelScale
ExtraSamples: 0,
SamplesPerPixel: 3, // 3=RGB, 4=RGBA Set the SamplesPerPixel tag for RGBA image
ProjectedCSTypeGeoKey: 4326, // (EPSG code for WGS 84)
GeoAsciiParams: 'WGS 84',
};
// Generate the GeoTIFF synchronously
const tiffData = GeoTIFF.writeArrayBuffer(rgbArray, metadata);
The following ground control points, if I have georeferenced marker:
// [x, y, 0, lng, lat, 0]
[ [0,0,0,121.53644574764846,-28.488382393735773,0],
[1258,0,0,121.6301344525469,-28.488382393735773,0],
[1258,1761,0,121.6301344525469,-28.603588342154737,0],
[0,1761,0,121.53644574764846,-28.603588342154737,0],
[544.90,712.057,0,121.57085806131366,-28.58478369021423,0]]
Here is the georeferenced image:
Here is a generated geo tiff file result in QGIS for the above image:
It will be a great idea to add functions like set_gcps, provided in gdal, to geotiff if possible, only if the functionality is not available currently.
The text was updated successfully, but these errors were encountered:
I am not sure if a functionality exists in the geotiff.js library, but the issue is that I have a set of Ground control points (GCPS) which have the image points (x,y,0) and (lat, lng, 0). Now I want to write a geotiff using a raw image object or an image url, and the set of ground control points. I have tried to use tags such as the ModelTiePoint and ModelPixelScale, however, they do not do georeferning. The ground control point is an array in this example [ x, y, 0, lng, lat, 0].
The following ground control points, if I have georeferenced marker:
Here is the georeferenced image:
Here is a generated geo tiff file result in QGIS for the above image:
It will be a great idea to add functions like set_gcps, provided in gdal, to geotiff if possible, only if the functionality is not available currently.
The text was updated successfully, but these errors were encountered: