How to use WMTS ImageryProvider using EPSG:26917 (NAD83 / UTM zone 17N)

320 views
Skip to first unread message

jesse...@gmail.com

unread,
Nov 13, 2019, 10:33:24 AM11/13/19
to cesium-dev
1. A concise explanation of the problem you're experiencing.

Hi, I'm quite new to Cesium and mapping in general so please bear with me. I'm trying to load an ImageryProvider using WebMapTileServiceImageryProvider into our Cesium mapping application and I am getting 404's when requesting tiles. The WMTS loads fine using QGIS.


I believe the issue is related to the fact that the supported CRS of the image server is EPSG:26917. I think I need to use the GeographicTilingScheme.

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

Using the bounds for EPSG:26917 from QGIS:

  var epsg_26917_rect = Cesium.Rectangle.fromDegrees(-84, 23.81, -78, 84);      
  var epsg_26917 = new Cesium.GeographicTilingScheme({      
    rectangle: epsg_26917_rect,      
    // numberOfLevelZeroTilesX: ?,      
    // numberOfLevelZeroTilesY: ?,
    // ellipsoid: ?,
  });      

  imageryProvider = new Cesium.WebMapTileServiceImageryProvider({
    layer: 'swoop2015',
    style: 'default',
    tileMatrixSetID: 'default028mm',
    tilingScheme: epsg_26917,
   });

In the WMTSCapabilities.xml, it says the 0th layer has 

<MatrixWidth>84</MatrixWidth>
<MatrixHeight>76</MatrixHeight>

so I tried that for numberOfLevelZeroTilesX and numberOfLevelZeroTilesY but that didn't work. I was able to get values for these that appeared somewhat in the correct general area but the image was very skewed.

Am I supposed to use GRS80 insead of WGS84? How do I define that ellipsoid in Cesium?

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I want to display hi-res local imagery in an internal mapping tool made with Cesium. 

4. The Cesium version you're using, your operating system and browser.

Cesium 1.63, Ubuntu 19.10, Chrome 78.0.3904.97


Thanks

Omar Shehata

unread,
Nov 13, 2019, 12:02:36 PM11/13/19
to cesium-dev
CesiumJS doesn't support loading imagery tiles that aren't in web mercator. Are you able to reproject your imagery? Uploading it to Cesium ion does that automatically. 

Here's the feature request for adding support for this, which I've just bumped: https://github.com/AnalyticalGraphicsInc/cesium/issues/3877 

Feel free to plus one that or chime in there!

jesse...@gmail.com

unread,
Nov 19, 2019, 3:21:35 PM11/19/19
to cesium-dev
I was able to get something working by using MapProxy in the mean time.

Thanks for your help.
Reply all
Reply to author
Forward
0 new messages