3

I am looking at the Define custom grid section of the morecantile documentation. They define an EPSG:3031 based custom grid this way:

import morecantile
from pyproj import CRS

crs = CRS.from_epsg(3031)
extent = [-948.75, -543592.47, 5817.41, -3333128.95]  # From https:///epsg.io/3031
customEPGS3031 = morecantile.TileMatrixSet.custom(extent, crs, id="MyCustomTmsEPSG3031")

The comment says the values are from https:///epsg.io/3031. Unfortunately, I haven't found the values -948.75, -543592.47, 5817.41, -3333128.95 on that website.

How can I find out what extent should be used for a custom TMS grid?

1 Answer 1

2

This variable extent = [-948.75, -543592.47, 5817.41, -3333128.95] looks like the bbox of the Antarctica bounds transformed from the WGS84 to the EPSG:3031.

from pyproj import CRS, Transformer

crs1 = CRS.from_epsg(4326)
crs2 = CRS.from_epsg(3031)

bbox_dict = dict(crs2.to_json_dict()).get("bbox")
bbox = list(bbox_dict.values())

print(bbox) # [-90, -180, -60, 180]

transformer = Transformer.from_crs(crs2, crs1)

extent = [-948.75, -543592.47, 5817.41, -3333128.95]
bbox_ = list(transformer.transform(extent[0], extent[1]))
bbox_.extend(transformer.transform(extent[2], extent[3]))

print(bbox_) # [-85.00000000152139, -179.89999987377152, -60.00000000847028, 179.90000005782724]

Also, after verifying extent-coordinates by means http://projfinder.com/ it is possible to see

Pair #1: pair1

Pair #2: pair2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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