I'm using Proj4Leaflet to use tile layers with a different CRS (EPSG:25832) in my leaflet project.

Now I am somehow lost in finding the correct values for the bounds and origin of the tiles I want to use (https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/EU_EPSG_25832_TOPPLUS/{z}/{y}/{x}.png). I've constructed this tile request by inspecting the capabilities of this WMTS (here is a link to the metadata of the service).

Thanks to this post, I've already figured out how to calculate the values for the resolution.

var epsg25832 = new L.Proj.CRS(
  '+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs', {
    origin: ? ? ? ,
    bounds: ? ? ? ,
    resolutions: [

But I have no clue how to find the right values for bounds and origin. I can only find <ows:WGS84BoundingBox> in the capabilities of the WMTS. Does anyone know how to get the right values?


An excerpt from your webservice tilematrix EU_EPSG_25832_TOPPLUS in https://sgx.geodatenzentrum.de/wmts_topplus_open/1.0.0/WMTSCapabilities.xml

        <TopLeftCorner>-3803165.98427 8805908.08285</TopLeftCorner>

0.00028 = 0.00028m = 0.28mm => explanation at https://enonline.supermap.com/iServer9D/Appendix/scale.htm (if you know better docs, comments welcome)

pixelsize = resolution = 0.00028 * scaledenominator

The origin should be

TopLeftCorner x and y values in an Javascript array, e.g [-3803165.98427, 8805908.08285]

To calculate the bounds, you may look at:

Formula for bottom right corner X

TopLeftCorner X + MatrixWidth * TileWidth * ScaleDenominator * 0.00028 = 3710899.64428


Formula for bottom right corner Y

TopLeftCorner Y - MatrixHeight * TileWidth * ScaleDenominator * 0.00028 = 2544186.72573

You now have the values to make the bounds as coordinates for top left corner and bottom right corner can help you deduce xmin, xmax, ymin, ymax

According to Proj4Leaflet, bounds should be an L.bounds

Althought it was a bit annoying to sort out my calculations, I've confirmed them using WMTS with your web service within QGIS and also using QGIS Network Logger (need QGIS 3.5 or more and it rocks to learn OGC by inspecting network calls although you need to be aware of cache)

| improve this answer | |
  • nice tip about the plugin, I always use (perhaps used) something like Fiddler as a proxy and configure the network settings accordingly – nmtoken Feb 28 at 11:51
  • Me too in the old days but not on Windows anymore so this plugin is welcome, for me, at least – ThomasG77 Feb 28 at 11:54

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.