Proposal for ArcGIS Enterprise to Support KTX2 Textures

454
0
10-17-2024 02:09 AM
Status: Open
Lerman
by
Frequent Contributor

There are two Enhancements related to KTX2 textures:

ENH-000145311: Requesting ArcGIS Enterprise to support KTX2 texture for Scene Layer.
ENH-000167839: Enable KTX2 texture in Scene Layer when publishing ESLPK as a reference from a data store to Portal for ArcGIS.

The first enhancement has already been addressed, but the second one remains unresolved. A significant amount of time has passed, and since this issue is quite important, I believe it should be prioritized. Perhaps ArcGIS Server analysts are not entirely familiar with the I3S standard, which could be the reason for the delay in resolving this issue. After reviewing the JAR files in the ArcGIS Server installation directory, I found that this problem could be easily fixed. The root cause is that ArcGIS Server does not differentiate between KTX2 textures (filename + extension is 1.ktx2) and DDS textures (filename + extension is 0_0_1.bin.dds.gz). The former has a filename equal to "1," while the latter has a filename that ends with "1" but is not equal to "1." Properly distinguishing between these will resolve the issue. Below is a proposed solution:

Regarding the first enhancement:

This enhancement has been resolved in version 11.1, but I believe a more optimal solution could have been implemented. Currently, in SceneTileCouchDBReader.class (from arcgis-client-app-11.3.0.51575.jar as an example), ArcGIS Server first checks if the texture name ends with "1." If it does, it adds the "Content-Encoding": "gzip" header to the request. Once the texture is retrieved, the server checks whether the format is KTX2, and if so, it removes the "Content-Encoding" header.

A better solution would be for ArcGIS Server to first check if the texture name equals "1" or simply ends with "1." If it equals "1," that indicates the texture is in KTX2 format, and the "Content-Encoding" header should not be added. If the name only ends with "1" but is not equal to "1," it signifies a DDS texture, and the "Content-Encoding" header should be added.

Regarding the second enhancement:

Currently, in SceneServerHandler.class (from arcgis-client-app-11.3.0.51575.jar as an example), ArcGIS Server checks if the texture name ends with "1." If it does, the server assumes the texture is DDS and adds the .bin.dds.gz file extension. This logic is flawed, as a texture name ending with "1" could indicate either DDS or KTX2. Because ArcGIS Server doesn't differentiate between these, requests for KTX2 textures return an error. A new condition should be added:

else if (textureId.equals("1")) {
resource = ".ktx2";
contentType = "image/ktx2";
}