英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论