I have a JFIF file and its corners coords.
Right now I have found 2 to ways to place it on the map.
1. Add it as a PictureMarkerSymbol.
The problem in this case is that I get a black background with the image
2. I can convert it to COgeoTIFF using GDAL.
In this case it looks much better, but I still have 2 issues:
a) The black background removed by adding NODATA values is not removed completely. Some of it is still visible.
b) There is a lot of conversion that must to be done.
Is there a good way to place JFIF on the Map, without tons of conversions and black background?
Hi there,
JPEG is a lossy compression. If you inspect it closely, you'll find pixel values like 0, 1, 2 etc around the edge. Something probably cannot be removed with a simple use of nodata. There's another aspect, because source is a lossy compression, there's a high chance of false positives when declaring a value as nodata.
You can investigate the pixel values by calling identify method on the layer as shown below.
view.on(["pointer-move"], (event) => {
const point = view.toMap({ x: event.x, y: event.y });
layer.identify(point).then((results) => {
if (results.value) {
console.log(results.value);
}
})
.catch((error) => {
if (!promiseUtils.isAbortError(error)) {
throw error;
}
});
});