Limited Region Tileset

We would like to create TMS tilesets that only cover a small region (for example the size of a city). However, we are having odd results that seem to be related to the boundingbox.

We can successfully create a tileset that covers the globe, but when we try to display one that covers any size that is less than the full globe we run into the boundingbox issues.

If the boundingbox is larger than the area covered by the tileset Cesium throws missing image errors and no tiles appear. In some cases we can adjust the size of the boundingbox (by setting the rectangle in the TMS constructor) so that it is slightly smaller than the area covered by the tiles... and the tiles will appear. But in other cases we can only get tiles to appear if we significantly reduce the size of the boundingbox. This, however, results in many of the tiles that fall beyond the boundingbox being filtered and not being displayed.

We've been creating the tiles with Global Mapper. We recently attempted to use GDAL2Tiles, however we haven't had much luck with it either.

I can’t comment about Global Mapper - had not heard of it till now (sorry), but I’ve made good use of MapTiler - bit pricey but there are various versions and trials you can experiment with.

Exactly as you describe, I had issues seeing the tiles until I made the bounding rectangle slightly smaller than the area of interest:

fkLayer = myLayers.addImageryProvider(new Cesium.TileMapServiceImageryProvider({
url : ‘/Apps/shc/gisimages/MapTiler/fk’,
rectangle : Cesium.Rectangle.fromDegrees(-61.271, -52.456, -57.713, -51.013), // wsen
minimumLevel : 6,
maximumLevel : 11
}));

We're finding that the tiles appear if we adjust the boundingbox slightly smaller than the area covered by the tiles for tilesets that cover smaller regions. However, if we create a much larger tileset (for instance one that covers all of the Americas) then in order to get the tiles to appear the east/west sides of the boundingbox need to be slightly smaller than (reduce east and west bounds by 1 degree or less) the area covered by the tiles, but the north/south sides of the bounding box need to be significantly smaller than (reduce north and south bounds by 25 degrees or so) the area covered by the tiles.

This seems to be a Cesium issue as we get the exact same results if we use Global Mapper or gdal2tiles (which is what MapTiler is built on top of) to produce the tiles.

Hi,

Can you share your tilemapresource.xml? gdal2tiles.py should certainly produce one, hopefully Global Mapper does, too.

Kevin

Thanks for looking into this! I don't have the issue number handy, but I think I found an issue you guys have worked on that is scheduled to be released in 1.3 that may address the problem we're experiencing. I'll see if I can find that issue number and point to it.

Here's the content of the tilemapresource file generated by gdal2tiles (Global Mapper does produce an almost identical file). This is for a larger tileset that covers most of North America. We only generated a couple of levels for testing. You'll notice the original boundingbox we've commented out and the adjusted boundingbox it takes to make the tiles appear.

<?xml version="1.0" encoding="utf-8"?>
    <TileMap version="1.0.0" tilemapservice="http://tms.osgeo.org/1.0.0">
      <Title>A1.jpg</Title>
      <Abstract></Abstract>
      <SRS>EPSG:900913</SRS>
<!-- <BoundingBox minx="-179.99999593098963" miny="0.00273339248304" maxx="179.99967354795967" maxy="85.05112878000000"/>-->
      <BoundingBox minx="-179.0" miny="25.0" maxx="-91.0" maxy="65.0"/>
      <Origin x="-179.99999593098963" y="0.00273339248304"/>
      <TileFormat width="256" height="256" mime-type="image/png" extension="png"/>
      <TileSets profile="mercator">
        <TileSet href="3" units-per-pixel="19567.87923750000118" order="3"/>
        <TileSet href="4" units-per-pixel="9783.93961875000059" order="4"/>
      </TileSets>
    </TileMap>

What options did you use when running gdal2tiles.py? And what version of GDAL is this? The tilemapresource.xml file looks a bit different than I’m used to seeing.

Kevin

We're using GDAL 1.11.1. And for that tileset the following arguments were used...

gdal2tiles -z 3-4 -s EPSG:4326 A1.jpg Test2

-z restricting zoom level
-s setting SRS

Setting the SRS to EPSG:4326 on the commandline only seems to affect the units used in the boundingbox. We've created the tileset using the defaults (mercator), and the results are the same. In fact we've created this and several other tilesets with a whole list of variations. However, we experience the same issues no matter what we do. The specific issues being that if the boundingbox is not smaller than the area covered by the tiles then the tiles don't show up.

When you say the file looks different than you're used to what exactly are you referring to?

We found this issue request in github :
https://github.com/AnalyticalGraphicsInc/cesium/pull/2181

We thought it was related to the problem we're experiencing, but we upgraded to Cesium 1.3 and the issue still exists.