help ArcGIS imagery from NGA military servers

simple example with cesium sandcastle that looks wrong.

var viewer = new Cesium.Viewer(‘cesiumContainer’, {
    imageryProvider : new Cesium.ArcGisMapServerImageryProvider({
        url : ‘https://maps.gvs.nga.mil/arcgis/rest/services/Basemap/NGA_ShadedRelief_2D/MapServer
    }),
    baseLayerPicker : false
});

The server doesn't handle CORS so you need to run chrome with --disable-web-security for the initial request to https://maps.gvs.nga.mil/arcgis/rest/services/Basemap/NGA_ShadedRelief_2D/MapServer?f=json

will fail. Also you need a CAC card. Cesium is downloading the jpgs as blobs but seems to be smearing them. The tiles are 512x512 in wkid 4326.

[url=http://imgbin.org/index.php?page=image&id=22982][/url]

And here is how it looks running in a local arcgis javascript map.

[url=http://imgbin.org/index.php?page=image&id=22983][/url]

Hi,

You can probably work around the problem by passing “usePreCachedTilesIfAvailable: false” to the ArcGisMapServerImageryProvider constructor, but that’s not an ideal solution. I don’t know what a CAC card is, but if you can share the result of this URL I may be able to make a better guess about what’s going wrong:

https://maps.gvs.nga.mil/arcgis/rest/services/Basemap/NGA_ShadedRelief_2D/MapServer?f=json&pretty=true

You can email it to me if you don’t want to post it here.

Thanks,

Kevin

{
"currentVersion": 10.22,
"serviceDescription": "This worldwide basemap depicts shaded relief that is derived from NGA\u2019s 1 kilometer and 90 meter TerraForm DTED, 30 meter TerraForm DTED2, NASA and METI\u2019s 30 meter ASTER GDEM v2 (used where TerraForm data is not available), USGS\u2019 10 meter National Elevation Dataset (NED), NGA\u2019s Digital Bathymetric Elevation Dataset (DBED, 1 Kilometer), and NOAA\u2019s 90 meter coastal bathymetry (U.S. Coastal Relief Model).",
"mapName": "Layers",
"description": "",
"copyrightText": "(U) Shaded Relief - SOURCE: NGA, NASA-METI, USGS",
"supportsDynamicLayers": false,
"layers": [
  {
   "id": 0,
   "name": "Shaded Relief",
   "parentLayerId": -1,
   "defaultVisibility": true,
   "subLayerIds": null,
   "minScale": 0,
   "maxScale": 0
  }
],
"tables": ,
"spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
},
"singleFusedMapCache": true,
"tileInfo": {
  "rows": 512,
  "cols": 512,
  "dpi": 96,
  "format": "JPEG",
  "compressionQuality": 75,
  "origin": {
   "x": -180,
   "y": 90
  },
  "spatialReference": {
   "wkid": 4326,
   "latestWkid": 4326
  },
  "lods": [
   {
    "level": 0,
    "resolution": 0.3515625065578945,
    "scale": 1.47748799285417E8
   },
   {
    "level": 1,
    "resolution": 0.17578125327894775,
    "scale": 7.38743996427087E7
   },
   {
    "level": 2,
    "resolution": 0.08789062663947399,
    "scale": 3.69371998213544E7
   },
   {
    "level": 3,
    "resolution": 0.043945313319736994,
    "scale": 1.84685999106772E7
   },
   {
    "level": 4,
    "resolution": 0.021972656659868472,
    "scale": 9234299.95533859
   },
   {
    "level": 5,
    "resolution": 0.010986328329934226,
    "scale": 4617149.97766929
   },
   {
    "level": 6,
    "resolution": 0.005493164164967124,
    "scale": 2308574.98883465
   },
   {
    "level": 7,
    "resolution": 0.0027465820824835504,
    "scale": 1154287.49441732
   },
   {
    "level": 8,
    "resolution": 0.0013732910412417797,
    "scale": 577143.747208662
   },
   {
    "level": 9,
    "resolution": 6.866455206208899E-4,
    "scale": 288571.873604331
   },
   {
    "level": 10,
    "resolution": 3.433227603104438E-4,
    "scale": 144285.936802165
   },
   {
    "level": 11,
    "resolution": 1.716613801552224E-4,
    "scale": 72142.9684010827
   },
   {
    "level": 12,
    "resolution": 8.583069007761132E-5,
    "scale": 36071.4842005414
   },
   {
    "level": 13,
    "resolution": 4.291534503880566E-5,
    "scale": 18035.7421002707
   }
  ]
},
"initialExtent": {
  "xmin": -101.51367376859275,
  "ymin": -22.500000419705394,
  "xmax": 101.51367376859275,
  "ymax": 76.64062642962156,
  "spatialReference": {
   "wkid": 4326,
   "latestWkid": 4326
  }
},
"fullExtent": {
  "xmin": -180,
  "ymin": -89.99999,
  "xmax": 180,
  "ymax": 89.99999,
  "spatialReference": {
   "wkid": 4326,
   "latestWkid": 4326
  }
},
"minScale": 1.47748799285417E8,
"maxScale": 18035.7421002707,
"units": "esriDecimalDegrees",
"supportedImageFormatTypes": "PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,BMP",
"documentInfo": {
  "Title": "Shaded Relief",
  "Author": "GVS",
  "Comments": "This worldwide basemap depicts shaded relief that is derived from NGA\u2019s 1 kilometer and 90 meter TerraForm DTED, 30 meter TerraForm DTED2, NASA and METI\u2019s 30 meter ASTER GDEM v2 (used where TerraForm data is not available), USGS\u2019 10 meter National Elevation Dataset (NED), NGA\u2019s Digital Bathymetric Elevation Dataset (DBED, 1 Kilometer), and NOAA\u2019s 90 meter coastal bathymetry (U.S. Coastal Relief Model).",
  "Subject": "Shaded Relief v3.0",
  "Category": "",
  "AntialiasingMode": "None",
  "TextAntialiasingMode": "Force",
  "Keywords": "NGA,TerraForm,DBED,NASA-METI,NOAA,USGS,NED,ASTER GDEM,DTED"
},
"capabilities": "Map,Query,Data",
"supportedQueryFormats": "JSON, AMF",
"exportTilesAllowed": false,
"maxRecordCount": 1000,
"maxImageHeight": 4096,
"maxImageWidth": 4096,
"supportedExtensions": "KmlServer, WMSServer"
}

Thanks. I see now that this is a bug in ArcGisMapServerImageryProvider. The problem is that it is interpreting the “fullExtent” property incorrectly when it is specified in EPSG:4326 (or works correctly with Web Mercator tiles).

I’ll try to get a fix into Cesium 1.8 (scheduled for April 1). Does the “usePreCachedTilesIfAvailable” property work in the meantime?

Kevin

If I turn the usePreCachedTilesIfAvailable to false, then the browser makes requests for urls ?export and an explicit bbox. They then bounce around on the server for awhile hitting different servlet urls and then most fail with ERR_TOO_MANY_REDIRECTS in chrome. I did see some images actually download in the chrome developer tools network tab, but the cesium globe ball stayed blue.

Ok, that’s strange. Sounds like the server doesn’t support the export service.

Thanks for pointing me in the right direction I was able to patch ArcGisMapServerImageryProvider, and the imagery now loads fine with

if (data.fullExtent.spatialReference.wkid === 4326) {
                        sw = Cartographic.fromDegrees(data.fullExtent.xmin, data.fullExtent.ymin);
                        ne = Cartographic.fromDegrees(data.fullExtent.xmax, data.fullExtent.ymax);
                    }