Select to view content in your preferred language

The best way to place JFIF on the Map

397
1
03-09-2023 02:46 AM
KHTRE
by
New Contributor II

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

image.png

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.

image.png



Is there a good way to place JFIF on the Map, without tons of conversions and black background?




Tags (1)
0 Kudos
1 Reply
UndralBatsukh
Esri Regular Contributor

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;
    }
  });
});

 

 

0 Kudos