Requesting Seperate tiles from a WMS request.

Hi there,

I'm trying to change the terrain based on RGB images. For that, I've written a function that will read the RGB Value of a certain image ( pixel by pixel)

Now, the function itself is called using the parameters [x,y,tile] (where tile is the image of the corresponding tile.)

Here I run into issues. I'm trying to get the Image of the Tile from the WMS server I'm using (URL: https://geodata.nationaalgeoregister.nl/ahn2/wms - This is the dutch heightmap which I'm using for testing.) so I can input it in the tile parameter.

How can I request the tile, from the WMS request that I have created? The code I've used for the request is as follows:

var AHN = layers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
    url: ‘https://geodata.nationaalgeoregister.nl/ahn2/wms’,
    layers: ‘ahn2_5m’,
    parameters: {
        transparent : ‘true’,
        format : ‘image/png’
        
    }
}));

Many thanks in advance.

Heerco

Unfortunately not solved. Currently I am only receiving the promise and trying to use that promise in Cesium.loadImage(AHN.imageryProvider.requestImage(3,3,3)).then(function(image){ >code< }).otherwise(function(error){ >errorcode<} ); which automatically (and always) returns to the error.

Hello,

You need to wait until the imagery provider is ready before calling the requestImage function.

Try doing something like

imageryProvider.readyPromise.then(function() {
return imaageryProvider.requestImage();
})
.then(function(image) {

})

``

Best,

Hannah

I am getting the specific tiles, I presume, but it's not reading them properly. Console logging shows them giving me an image, and I'm "reading" the image to get the height from them based on the RGB Value. This works.

However, I am only interested in the tiles that actually have this, since I'm working only with data from certain countries (I'm running tests with the Dutch AHN WMS server.). However I've figured out that if I'm 'looking' for the tiles, I get all the tiles, including those that are white / empty (I've got transparent set to true.).

It even seems to request them outside the actual area I'm viewing / loading with the camera.

I'm doing all of my testing with the Hello World showcase.

Sorry, hit post by mistake:

The questions I have is, how can I request only the Data from those certain tiles, that are actually being read from the images I'm putting through? Is there some kind of reference I could create to keep track of each of the tiles I need?