如何使用ArcGIS Maps SDK for JavaScript显示*.jp2文件

huangapple go评论97阅读模式
英文:

How to display *.jp2 using ArcGIS Maps SDK for JavaScript

问题

I have a *.jp2 file (direct link if you need it) and I need to display it as a layer using ArcGIS Maps SDK for JavaScript.

I have tried to convert it into COGeoTIFF using OSGeo4W (gdal):

gdal_translate -of COG NC_2022-12-17.jp2 result.tif

And it looks like it became COD. This is the result of gdalinfo.

After that, I have tried to use it with the Imagery Tile Layer.

But it is not visible on the map. There are no errors in the console.

On the other hand, if I use the file from the example for Imagery Tile Layer (this one) it works perfectly fine.

So, the issue is not in the code.
How do I display the provided *.jp2 file on the map?

英文:

I have a *.jp2 file (direct link if you need it) and I need to display it as a layer using ArcGIS Maps SDK for JavaScript.

I have tried to convert it into COGeoTIFF using OSGeo4W (gdal)

gdal_translate -of COG NC_2022-12-17.jp2 result.tif
And it looks like it became COD. This is the result of gdalinfo.

After that I have tried to use it with the Imagery Tile Layer.

But it is not visible on the map. There are no errors in the console.

On the other hand, if I use the file from the example for Imagery Tile Layer (this one) it works perfectly fine.

So, the issue is not in the code.
How do I display the provided *.jp2 file on the map?

答案1

得分: 1

我已经找到了问题。
我只需要将GDAL更新到3.6.2版本,它就可以工作了。

gdal_translate -ot UInt16 -of COG MSAVIC_2022-12-17.jp2 result.tif

这就可以解决问题了。

英文:

I have found the issue.
I simply had to update GDAL to 3.6.2 and it worked.

gdal_translate -ot UInt16 -of COG MSAVIC_2022-12-17.jp2 result.tif

This does the trick

huangapple
  • 本文由 发表于 2023年2月24日 16:20:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/75554116.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定