Skip to main content

Hello there

we are using the staticImageFeatcher transformer in order to get a satellite image that fit the bounding box of vector

the bounding box changes based on each vector's data

is there any way to extract the right value for the  Height/width in the image to set the parameter of the staticMapfetcher dynamic?

 

imageThanks

 

Hi @boubcher

 

Please, could you share your Workspace template?

 

Thanks,


I think google maps uses a similar tiling scheme to TMS - For each zoom level each pixel has a (somewhat defined size) - I think if you reproject to Spherical Mercator (EPSG:3857) and then calculate the size of your bounding box you should be able to use the following table to calculate the row and height in number of pixels for a given zoom level

 

https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Resolution_and_Scale

 

for example at level 10 each pixel covers 152.87x152.87 meters (in EPSG:3857) so you can just calculate (xmax-xmin)/152.87 to get the required width.

 

I don't have a google API token so I didn't test it with the transformer but I think that it should work


I think google maps uses a similar tiling scheme to TMS - For each zoom level each pixel has a (somewhat defined size) - I think if you reproject to Spherical Mercator (EPSG:3857) and then calculate the size of your bounding box you should be able to use the following table to calculate the row and height in number of pixels for a given zoom level

 

https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Resolution_and_Scale

 

for example at level 10 each pixel covers 152.87x152.87 meters (in EPSG:3857) so you can just calculate (xmax-xmin)/152.87 to get the required width.

 

I don't have a google API token so I didn't test it with the transformer but I think that it should work

yes, Works,

Thanks to @virtualcitymatt​ 

 

 

image


Reply