It is tricky to manage the extent of a coordinate system when that extent is not an aligned rectangle in another coordinate system.
For example consider Thursday Island, located at:
- 142.2°, -10.2° (WGS84, EPSG:4326) or equivalently,
- 1146km, -1156.5km (Australian Albers projection, EPSG:3577).
According to SpatialReference.org (similar values to epsg.io) this latter projection has:
- WGS84 Bounds: 108.0000, -45.0000, 155.0000, -10.0000
- Projected Bounds: -2690013.3995, -5098960.4467, 2579169.8548, -1281018.4757
Notice that Thursday Island is well inside of the lat/lon bounds, however it (along with sections of Australian mainland at both Cape York Peninsula and Kakadu) falls outside of the projected bounds.
Say I want to create a web map application using OpenLayers, I need to know the maximum extent of the map in the projected coordinates. The problem is that if I source this information from a standard online reference, I will mistakenly cut off parts of Australia even when choosing a projection that was specifically designed to cover Australia.
Presumably the root cause is that the extent has been represented by an aligned bounding-box and then, rather than transforming the entire boundary of this region precisely (before generating a new bounding box), only two vertices of the box have been properly projected (the bottom-left and top-right corners). Such a method is invalid due to curvature/nonlinearity.
How is this problem normally handled? Is there any authorative source for the extent of a map projection? In particular, is Proj.4 able to report the maximum domain of validity for a transformation? I'd like a solution that works in all cases, including those where the region of validity does not resemble a rectangular coordinate patch (e.g. rHEALPix and QSC).
Best Answer
The primary source of these extents is the EPSG Geodetic Parameter Registry, e.g.:
PROJ version 6+
If you have a newer version of PROJ (version 6 or later), use projinfo to extract a WKT2_2018 string:
See the
USAGE
at the bottom forAREA
andBBOX
.pyproj
Using pyproj >=2.0, you can access various properties of a CRS in Python:
EPSG.io
Websites like EPSG.io (code) have converted the EPSG registry to a SQLite db (gml.sqlite), which is queried to extract the XML and show the same information. You can also fetch a "bbox" from their API, e.g. http://epsg.io/?q=3577&format=json
Note that these bounds are different than SpatilaReference.org, shown in the question, but that's because that website was based on an older edition of the EPSG database. I generally advise to not use SpatilaReference.org as it is essentially abandoned.
Polygon extents
If bounding boxes are not enough, you can register a free account and download "Area polygons in Shapefile format", which has many overlapping areas:
zooming into the point of interest, highlighting urn:ogc:def:area:EPSG::2575 - Australia - onshore:
This is 1 of nearly 20 different areas defined for different coordinate reference systems at that location.