I want to add a custom TileLayer to QGIS that doesn't use only x and y coordinate.

Here is a link to a custom tile:


According to this I need to use my current map canvas min/max coordinates, i.e. something like

bpx = iface.mapCanvas().extent()
xmin = bpx.xMinimum()
ymin = bpx.yMinimum()
xmax = bpx.xMaximum()
ymax = bpx.yMaximum()

and paste it into bbox attributes. But how end this by creating a new tile layer?

  • I do not understand why you want to add your WMS using Python and not the QGIS user interface. – Jakob Miksch Oct 25 at 7:44
  • @JakobMiksch If it is possible to add wms that has only bbox using qgis interface this method would be preferrable – Pavel Pereverzev Oct 25 at 7:55
  • Sorry, I do not understand the problem. Maybe you can explain a bit more context. – Jakob Miksch Oct 26 at 16:28
  • @JakobMiksch well actually I deal with my task by direct tile download using python, requests and gdal to make tiles georeferenced. However I still would like to know how to make my certain WMS work in QGIS. As far as I know, a connection to WMS requires at least a link to service like http://mt.google.com/vt/lyrs=m&x={x}&y={y}&z={z} where x, y and z - are parameters of coordinates and zoom level I suppose. Service that I need to connect provides only a link with a bbox parameter only like x_min, y_min, x_max and y_max. Just because it's in an ArcGIS Rest Server. – Pavel Pereverzev Oct 27 at 12:54
  • @JakobMiksch So I thought about a possible solution in giving to a bbox parameters coordinates of current qgis extent but it didn't work. – Pavel Pereverzev Oct 27 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.